Documentation
Quickstart
Go from zero to structured JSON in under 5 minutes. Send any document — URL, PDF, or image — and get back clean, validated data.
Authentication
All API requests require a Bearer token in the Authorization header.
Header format
Authorization: Bearer YOUR_API_KEYTest key available: Use px_test_parsex_demo_2026 to try the API without signing up.
Endpoint Reference
POST/api/extract
Request body
| Field | Type | Description |
|---|---|---|
| url | string | URL of the document to extract data from |
| file | string | Base64-encoded file content (PDF or image) |
| schema | object | Optional JSON schema to validate extracted data against |
Response
| Field | Type | Description |
|---|---|---|
| data | object | Extracted structured JSON data |
| meta.pages | number | Number of pages processed |
| meta.source_type | string | "url", "pdf", or "image" |
| meta.processing_time_ms | number | Processing time in milliseconds |
Examples
Extract data from a URL
curl
curl -X POST https://parsex.nanocorp.app/api/extract \
-H "Authorization: Bearer px_test_parsex_demo_2026" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/invoice.pdf"
}'Extract with a custom schema
curl
curl -X POST https://parsex.nanocorp.app/api/extract \
-H "Authorization: Bearer px_test_parsex_demo_2026" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/receipt.html",
"schema": {
"type": "object",
"properties": {
"vendor": { "type": "string" },
"total": { "type": "number" },
"date": { "type": "string", "format": "date" },
"line_items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"description": { "type": "string" },
"amount": { "type": "number" }
}
}
}
}
}
}'PDF & image support
For PDFs and images, you can either pass a public URL or upload the file as a base64-encoded string in the file field.
curl — base64 upload
curl -X POST https://parsex.nanocorp.app/api/extract \
-H "Authorization: Bearer px_test_parsex_demo_2026" \
-H "Content-Type: application/json" \
-d '{
"file": "'$(base64 -w0 document.pdf)'"
}'Error Codes
| Code | Status | Description |
|---|---|---|
| 400 | Bad Request | Missing or invalid url / file field |
| 401 | Unauthorized | Missing or invalid API key |
| 422 | Unprocessable | Document could not be parsed (corrupt file, unsupported format) |
| 429 | Rate Limited | Too many requests — back off and retry with exponential delay |
| 500 | Server Error | Internal error — retry or contact support |
Common Issues
- •Empty response data: Ensure the URL is publicly accessible. Private or authenticated URLs will return empty extractions.
- •Schema validation errors: Check that your JSON schema is valid. Use standard JSON Schema draft-07 format.
- •Large files timing out: Files over 50MB may take longer to process. Consider splitting large PDFs into smaller chunks.
- •Base64 encoding issues: Ensure your file is encoded without line breaks. Use
base64 -w0on Linux.
We're in beta — your feedback matters
Found a bug? Have a feature request? We'd love to hear from you.
Share Feedback