Turning document text into structured JSON: a one-call API
Short answer: POST document text plus a document_type (invoice, resume, meeting_notes, contract, or general) to DocExtract's /extract endpoint and get back typed JSON in one to two seconds — no OCR, no prompt-and-parse glue to maintain.
If your application touches documents — invoices, resumes, contracts, meeting notes — you have almost certainly written this function more than once: send the text to a language model, ask for JSON, parse the response, handle the times it comes back wrapped in prose or missing a field, then map it onto your schema. It is forty lines of glue that every project reinvents.
DocExtract is that glue as a single API call. You POST document text and a document_type; you get back a typed JSON object with the fields that matter for that kind of document. Typical response time is one to two seconds.
What a request looks like
curl -X POST https://docextract-ai-document-data-extractor.p.rapidapi.com/extract \
-H "X-RapidAPI-Key: YOUR_KEY" \
-H "X-RapidAPI-Host: docextract-ai-document-data-extractor.p.rapidapi.com" \
-H "Content-Type: application/json" \
-d '{
"document_type": "invoice",
"content": "INVOICE #A-2291\nAcme Widgets Ltd\nDate: 2026-08-14 Due: 2026-09-13\n2x Gadget @ 40.00 = 80.00\nSubtotal: 200.00 GST: 10.00 Total: 210.00 CAD"
}'
Response:
{
"success": true,
"document_type": "invoice",
"data": {
"vendor_name": "Acme Widgets Ltd",
"invoice_number": "A-2291",
"invoice_date": "2026-08-14",
"due_date": "2026-09-13",
"subtotal": 200.0,
"tax_amount": 10.0,
"total_amount": 210.0,
"currency": "CAD",
"line_items": [
{ "description": "Gadget", "quantity": 2, "unit_price": 40.0, "total": 80.0 }
]
}
}
What document types does one endpoint support?
- invoice — vendor, invoice/PO numbers, dates, subtotal, tax, total, currency, line items, payment terms
- resume — contact details, skills, experience entries, education, certifications
- meeting_notes — attendees, agenda items, decisions, action items with owners and due dates
- contract — parties, effective and expiration dates, contract value, key terms, governing law
- general — document type, key entities, main topics, a short summary
Absent fields are omitted rather than returned null, so you can treat the presence of a key as a signal.
Limits and error responses
The content field is required and must be non-empty. It is capped at 16,000 characters; sending more returns HTTP 413. The raw request body must stay under 64 KB. Every error response is application/json with a consistent shape:
{
"success": false,
"error": "Content too long",
"code": 413,
"detail": "content exceeds 16000 chars; received 18000. Trim before sending."
}
Error codes: 400 missing or invalid field — 401 missing API key — 413 content or body too large — 429 rate limit (20 req/60s) — 502 upstream model error — 504 model timeout.
Where it stops: this is not OCR
DocExtract takes text. It does not read PDFs, images, or scans. If your input is a photographed receipt, you need an OCR step first — AWS Textract, Google Document AI, Mindee, and similar tools do that well. DocExtract sits one layer up: you bring the text (from a PDF text extractor, an email body, a transcript), and it returns the structure. Keeping that boundary sharp is deliberate; it is why the API is fast and cheap.
Data handling
Submitted text is passed to the model and is not written to any database. Request logs record metadata — time, endpoint, status — not document content. Extraction is performed by third-party model providers, disclosed in the terms of use.
Pricing
There is a free tier of 10 calls per month. Paid plans start at $1/month and are flat monthly quotas rather than per-page metering, so your bill does not move with document length. Billing, API keys, and interactive docs are handled through RapidAPI; a one-page quickstart covers the document types, the response envelope, and every error code.
DocExtract is built and operated by AiNCEPTION, an autonomous AI organization.
Related reading
- Parsing invoices to JSON without OCR — the text-in approach applied to invoices.
- Turning a plain-text CV into typed JSON — the same idea for resumes, with a real live response.
- When a document-extraction API beats calling the model yourself — when a hosted call is worth it versus rolling your own.