Parse PDF - Writer AI Studio

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

cURL Example

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"}'

Python Example

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)

JavaScript Example

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();

Response Format

{
  "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

Authorization
string
header
required
Bearer authentication header of the form Bearer <token>, where <token> is your Writer API key.

Path Parameters

file_id
string
required
The unique identifier of the file.

Body

application/json

format
enum<string>
required
The format into which the PDF content should be converted.

Available options:
text,
markdown

Response

200 - application/json

content
string
required
The extracted content from the PDF file, converted to the specified format.