Convert

Convert documents between formats.

POST /convert

Convert a document from one format to another. Supports PDF, DOCX, HTML, Markdown, images, and plain text.

Request Body

Provide a file using either file_id (from /upload) or file_url (a public URL):

{
  "file_id": "clx7abc123def",
  "from": "pdf",
  "to": "text"
}
{
  "file_url": "https://example.com/doc.pdf",
  "from": "pdf",
  "to": "text"
}

Parameters

FieldTypeRequiredDescription
file_urlstringYes*Public URL of the source file
file_idstringYes*File ID from /upload
fromstringYesSource format (see table below)
tostringYesTarget format (see table below)

*Provide either file_url or file_id, not both.

Supported Conversions

FromToDescription
pdftextExtract text from PDF (OCR fallback for scanned docs)
pdfhtmlConvert PDF content to HTML
pdfimagesRender each page as PNG (ZIP for multi-page)
docxpdfConvert Word document to PDF
docxtextExtract text from Word document
docxhtmlConvert Word document to HTML
htmlpdfRender HTML to PDF via headless browser
htmlmarkdownConvert HTML to Markdown
htmltextStrip tags and extract text
markdownhtmlRender Markdown to HTML
markdownpdfRender Markdown to PDF
imagetextOCR — extract text from image
imagepdfEmbed image in a PDF
txtpdfRender plain text as PDF
txtmarkdownWrap plain text as Markdown

Image formats accepted for `image` source type

.png, .jpg, .jpeg, .gif, .webp, .tiff

Examples

curl -X POST https://api.parsekit.dev/convert \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"file_id": "clx7abc123def", "from": "pdf", "to": "text"}'

# Using a public URL
curl -X POST https://api.parsekit.dev/convert \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"file_url": "https://example.com/doc.pdf", "from": "pdf", "to": "html"}'

Response (202 Accepted)

{
  "job_id": "clx7job456ghi",
  "status": "queued"
}

Polling for Results

curl https://api.parsekit.dev/job/clx7job456ghi \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
  "id": "clx7job456ghi",
  "status": "complete",
  "output_url": "https://files.parsekit.dev/signed/...",
  "from_type": "pdf",
  "to_type": "text",
  "created_at": "2026-01-15T10:30:05.000Z"
}

Download the result from output_url. The signed URL expires in 2 hours.