API Documentation

Send documents to DataExtract from any language or tool using an API key — no browser needed. Authenticate with your key, upload a file, and get structured text, tables and fields back as JSON.

Authentication

Create a key in Account → API keys. It is shown in full only once — store it securely. Pass it on every request in the X-API-Key header (or as a Bearer token):

# preferred
X-API-Key: nocr_sk_xxxxxxxxxxxxxxxx

# also accepted
Authorization: Bearer nocr_sk_xxxxxxxxxxxxxxxx
Each request spends points from the key owner's account balance. Keep your key secret — anyone with it can consume your points.

Quick start

Extract text from an image in one call:

# cURL
curl -X POST https://www.dataextract.net/upload \
  -H "X-API-Key: nocr_sk_xxxxxxxx" \
  -F "file=@invoice.jpg" \
  -F "document_type=invoice" \
  -F "ocr_engine=gpt4o" \
  -F "perfect_table=true"
# Python
import requests
r = requests.post(
    "https://www.dataextract.net/upload",
    headers={"X-API-Key": "nocr_sk_xxxxxxxx"},
    files={"file": open("invoice.jpg", "rb")},
    data={"document_type": "invoice", "ocr_engine": "gpt4o",
          "perfect_table": "true"},
)
print(r.json()["text"])
// Node.js (fetch + form-data)
const FormData = require("form-data");
const fs = require("fs");
const fd = new FormData();
fd.append("file", fs.createReadStream("invoice.jpg"));
fd.append("document_type", "invoice");
const res = await fetch("https://www.dataextract.net/upload", {
  method: "POST",
  headers: { "X-API-Key": "nocr_sk_xxxxxxxx", ...fd.getHeaders() },
  body: fd,
});
console.log((await res.json()).text);

POST/upload

Processes one image or PDF. Multipart form fields:

FieldRequiredDescription
fileyesImage (JPG/PNG) or PDF.
document_typenogeneral_purpose, invoice, medical, bank, id_document, parts_catalog, legal, khata_book, handwritten. For Indic handwriting use handwritten:devanagari (or bengali, tamil, telugu, kannada, gujarati, gurmukhi, malayalam, odia).
ocr_enginenovision (default) or gpt4o (higher accuracy).
perfect_tablenotrue to AI-refine tables.
deep_scannotrue for recursive field extraction.
visual_replicanotrue to build a visual-replica PDF.

Response (200)

{
  "doc_id": "6e5bf4df-491f-4c0a-86ad-4a06858759b8",
  "text": "| SL | Date | Veh No | ... |",
  "ocr_provider": "gpt4o_vision",
  "points_charged": 41,
  "points_remaining": 959
}

If async processing is enabled, the response instead returns {"job_id": "...", "doc_id": "...", "status": "queued"} — poll the job (see below).

GET/api/v1/document/<doc_id>/json

Fetch the full structured result for a document any time after processing.

curl https://www.dataextract.net/api/v1/document/<doc_id>/json \
  -H "X-API-Key: nocr_sk_xxxxxxxx"
{
  "id": "6e5bf4df-...",
  "filename": "invoice.jpg",
  "doc_type": "invoice",
  "extracted_text": "...",
  "structured_data": { "fields": {...}, "pages": [...] }
}

You can also download rendered files at /download/<doc_id>/<fmt> where fmt is one of txt, json, csv, xlsx, docx, pdf (and tally for ledgers).

GET/api/v1/jobs/<job_id>

When async is enabled, poll until status is done, then fetch the result.

curl https://www.dataextract.net/api/v1/jobs/<job_id> \
  -H "X-API-Key: nocr_sk_xxxxxxxx"
# → {"status": "done", "progress": 100, "doc_id": "..."}

Point costs

Each page is billed additively from the options you select:

OperationPoints / page
Base extraction (Google Vision)8
ChatGPT engine or handwritten/khata+30
Perfect tables+7
Deep scan+12
Visual replica PDF+60

The exact charge is returned as points_charged in the upload response. Post-processing actions cost extra: Q&A 4 pts/question, GST check 10 pts (first run, then cached free).

Rate limits & budgets

Each key has two optional, independent guards (set when you create the key):

  • Rate limit — max requests per minute (default 60; 0 = unlimited). Exceeding it returns 429.
  • Point budget — a lifetime cap on points the key may spend (0 = unlimited). Once reached, uploads return 403 while the key stays valid.

Use these to safely hand a key to a third party or a single integration without exposing your whole balance.

Errors

StatusMeaning
401Missing, invalid or revoked API key.
403Insufficient account points, or key point budget exhausted.
429Key's per-minute rate limit exceeded — retry after 60s.
400Bad request (missing file / unsupported format).
500Processing failed — points are auto-refunded.