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
| Field | Type | Required | Description |
|---|---|---|---|
file_url | string | Yes* | Public URL of the source file |
file_id | string | Yes* | File ID from /upload |
from | string | Yes | Source format (see table below) |
to | string | Yes | Target format (see table below) |
*Provide either file_url or file_id, not both.
Supported Conversions
| From | To | Description |
|---|---|---|
pdf | text | Extract text from PDF (OCR fallback for scanned docs) |
pdf | html | Convert PDF content to HTML |
pdf | images | Render each page as PNG (ZIP for multi-page) |
docx | pdf | Convert Word document to PDF |
docx | text | Extract text from Word document |
docx | html | Convert Word document to HTML |
html | pdf | Render HTML to PDF via headless browser |
html | markdown | Convert HTML to Markdown |
html | text | Strip tags and extract text |
markdown | html | Render Markdown to HTML |
markdown | pdf | Render Markdown to PDF |
image | text | OCR — extract text from image |
image | pdf | Embed image in a PDF |
txt | pdf | Render plain text as PDF |
txt | markdown | Wrap 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.