cURL
curl --location --request POST https://api.writer.com/v1/tools/pdf-parser/{file_id} \
--header "Authorization: Bearer <token>" \
--header "Content-Type: application/json" \
--data-raw '{"format":"text"}'import os
from writerai import Writer
client = Writer(
# This is the default and can be omitted
api_key=os.environ.get("WRITER_API_KEY"),
)
response = client.tools.parse_pdf(
file_id="file_id",
format="text",
)
print(response.content)import Writer from 'writer-sdk';
const client = new Writer({
apiKey: process.env['WRITER_API_KEY'], // This is the default and can be omitted
});
async function main() {
const response = await client.tools.parsePdf('file_id', { format: 'text' });
console.log(response.content);
}
main();{
"content": "<string>"
}Tools API
Parse PDF
Parse PDF to other formats.
POST
/
v1
/
tools
/
pdf-parser
/
{file_id}
cURL
curl --location --request POST https://api.writer.com/v1/tools/pdf-parser/{file_id} \
--header "Authorization: Bearer <token>" \
--header "Content-Type: application/json" \
--data-raw '{"format":"text"}'import os
from writerai import Writer
client = Writer(
# This is the default and can be omitted
api_key=os.environ.get("WRITER_API_KEY"),
)
response = client.tools.parse_pdf(
file_id="file_id",
format="text",
)
print(response.content)import Writer from 'writer-sdk';
const client = new Writer({
apiKey: process.env['WRITER_API_KEY'], // This is the default and can be omitted
});
async function main() {
const response = await client.tools.parsePdf('file_id', { format: 'text' });
console.log(response.content);
}
main();{
"content": "<string>"
}Deprecation notice: The parse PDF API endpoint at
/v1/tools/pdf-parser/{file_id} is deprecated and will be removed on December 22, 2025.Migration path: We plan to introduce a prebuilt PDF parsing tool for chat completions that will provide similar functionality. This tool will work similarly to other prebuilt tools like the LLM tool. We will provide more details about this alternative when it becomes available.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your Writer API key.
Path Parameters
The unique identifier of the file.
Body
application/json
The format into which the PDF content should be converted.
Available options:
text, markdown Response
200 - application/json
The extracted content from the PDF file, converted to the specified format.
Was this page helpful?