Build document conversion into your application.
Convert documents to structured Markdown, JSON, or chunks ready to use in retrieval and vector database workflows.
Quickstart
Create an account, then create an API key from your dashboard. Send a document as multipart form data using either a local file or a public HTTP(S) document URL, and choose the output format.
curl --request POST "https://docuapi.dev/convert" \
--header "Authorization: Bearer $DOCUAPI_API_KEY" \
--form "file=@./annual-report.pdf" \
--form "output_format=json" \
--form "enable_ocr=true"import os
import docuapi
docuapi.api_credentials = os.environ["DOCUAPI_API_KEY"]
result = docuapi.convert(
{"File": "/path/to/my_file.pdf", "EnableOcr": "true"},
output_format="json",
)
print(result["document"])
print(result["content"])curl --request POST "https://docuapi.dev/convert" \
--header "Authorization: Bearer $DOCUAPI_API_KEY" \
--form "url=https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf" \
--form "output_format=json"Convert a batch through the API
curl --request POST "https://www.docuapi.dev/batches" \
--header "Authorization: Bearer $DOCUAPI_API_KEY" \
--form "files=@./invoice.pdf" \
--form "files=@./report.docx" \
--form "output_format=json" \
--form "enable_ocr=true"
# Copy batch_id from the HTTP 202 response.
BATCH_ID="REPLACE_WITH_RETURNED_ID"
curl "https://www.docuapi.dev/batches/$BATCH_ID" \
--header "Authorization: Bearer $DOCUAPI_API_KEY"
# Download when status is completed or completed_with_errors.
curl --fail --location --remove-on-error "https://www.docuapi.dev/batches/$BATCH_ID/results" \
--header "Authorization: Bearer $DOCUAPI_API_KEY" \
--output results.zip && unzip -t results.zipimport os
import docuapi
docuapi.api_credentials = os.environ["DOCUAPI_API_KEY"]
batch = docuapi.create_batch(
["invoice.pdf", "report.docx"],
enable_ocr=True,
output_format="json",
)
batch_id = batch["batch_id"]
docuapi.wait_for_batch(batch_id)
docuapi.download_batch_results(batch_id, "results.zip")Supported formats
Extract text from images (OCR)
curl --fail-with-body "https://www.docuapi.dev/convert" \
--header "Authorization: Bearer $DOCUAPI_API_KEY" \
--form "file=@./scan.png" \
--form "enable_ocr=true" \
--form "output_format=json"import os
import docuapi
docuapi.api_credentials = os.environ["DOCUAPI_API_KEY"]
result = docuapi.convert(
{"File": "./scan.png", "EnableOcr": "true"},
output_format="json",
)
print(result["content"])Output formats
Markdown
Readable text with headings and tables where the converter can preserve them.
output_format: markdownDocument JSON
A normalized schema for content blocks, page references, and document metadata.
output_format: jsonChunks
Paragraph-based chunks with source and section metadata, ready to send to your embedding pipeline and inject into any vector database.
output_format: chunksCheck usage
Send a valid API key as a Bearer token. The period is the current UTC calendar month. The response includes the plan's page allowance and pages remaining. Failed and in-progress conversions count as requests; only successful conversions consume the page allowance.
curl "https://docuapi.dev/usage" \\
--header "Authorization: Bearer $DOCUAPI_API_KEY"{
"plan": "pro",
"period": {
"start": "2026-10-01T00:00:00Z",
"end": "2026-11-01T00:00:00Z"
},
"requests": {
"total": 9,
"succeeded": 8,
"failed": 1,
"processing": 0
},
"pages_processed": 47,
"limits": {
"monthly_pages": 50000
},
"pages_remaining": 49953
}Explore the API reference
Review endpoint behavior and response details.