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_KEY

Test key available: Use px_test_parsex_demo_2026 to try the API without signing up.

Endpoint Reference

POST/api/extract

Request body

FieldTypeDescription
urlstringURL of the document to extract data from
filestringBase64-encoded file content (PDF or image)
schemaobjectOptional JSON schema to validate extracted data against

Response

FieldTypeDescription
dataobjectExtracted structured JSON data
meta.pagesnumberNumber of pages processed
meta.source_typestring"url", "pdf", or "image"
meta.processing_time_msnumberProcessing 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

CodeStatusDescription
400Bad RequestMissing or invalid url / file field
401UnauthorizedMissing or invalid API key
422UnprocessableDocument could not be parsed (corrupt file, unsupported format)
429Rate LimitedToo many requests — back off and retry with exponential delay
500Server ErrorInternal 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 -w0 on Linux.

We're in beta — your feedback matters

Found a bug? Have a feature request? We'd love to hear from you.

Share Feedback