Document extraction API

POST a PDF or image, get back structured JSON. No templates, no model training, no per-vendor setup.

Quick start

curl -X POST https://extractfox.com/api/extract \
  -F "file=@invoice.pdf" \
  -F "mode=prebuilt" \
  -F "schemaId=invoice"

# Response
{
  "result": {
    "vendor": "Acme Supplies Ltd.",
    "invoice_number": "INV-00284",
    "issue_date": "2026-04-12",
    "line_items": [...],
    "subtotal": 232.00,
    "tax": 46.40,
    "total": 278.40
  }
}

Endpoints

POST/api/extract

Run extraction on one document, public URL, or pasted text. Returns the JSON object matching the chosen schema.

multipart/form-data with file, url, or text; mode (prebuilt|custom); schemaId or prompt

POST/api/infer-schema

Generate a JSON Schema from a free-text request. Use the result with /api/extract for a two-step pipeline.

multipart/form-data with file, prompt

Product APIs

Dedicated docs for high-volume document types — curl examples, response schemas, and error codes:

  • Invoice OCR APIInvoice OCR API (session-auth beta): POST a PDF or scan, get vendor, line_items[
  • Resume parser APIResume parser API (session-auth beta): POST a CV PDF, get contact, experience, e

Schemas

Six prebuilt schemas ship out of the box: invoice, receipt, passport, bank_statement, contract, resume. Pass schemaId with one of these to get the canonical extraction.

For anything else, pass mode=custom with a free-text prompt describing what you want.

Frequently asked questions

Is there a document extraction API I can call?+

Yes. The same /api/extract endpoint powers the app and enforces your account quota. First-party session auth is available now; bearer API keys are not enabled yet.

What's the latency per extraction?+

Typical latency is 2–6 seconds for a single PDF or image, dominated by the model call. Larger documents and multi-page scans take longer.

Can I use the API to bulk-process documents?+

Yes. Loop on the client with a sensible concurrency cap (3–5 in flight). Server-side monthly quotas still apply to every request.

Does the API support custom schemas?+

Yes. Pass mode=custom with a prompt and the server infers a schema before extracting. Direct JSON Schema submission is not exposed yet.

How do I authenticate?+

Session-auth beta: sign in through the app and call /api/extract with your browser session cookie. Scoped bearer API keys are planned but not exposed yet — not suitable for unattended server-to-server production until keys ship.

Use the API

Sign up, choose a plan, and call the same quota-enforced endpoints the app uses.

See pricing