API reference

AIDataParser extracts structured JSON from PDFs and images. Base URL: https://aidataparser.com. Machine-readable spec at /openapi.json.

Quickstart

1. Issue an API key (50 free credits, no card)

curl -X POST https://aidataparser.com/v1/keys \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com"}'

# => 201
# {
#   "object": "api_key",
#   "api_key": "adp_live_xxxxxxxx",   // store this now — shown once
#   "credits": 50,
#   "free_credits_granted": 50
# }

2. Parse a document

curl -X POST https://aidataparser.com/v1/parse/document \
  -H "Authorization: Bearer adp_live_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/receipt.png" }'

Authentication

Pass your key as a bearer token: Authorization: Bearer adp_live_... (or the x-api-key header). Keys are shown once at creation and stored only as a hash.

POST /v1/parse/document

Accepts a PDF or image via a URL, base64 payload, or multipart file. Costs 1 credit per document, charged only on success. Text-first PDFs are parsed with a pure-JS reader; images are sent to the model as vision input.

Request body (JSON)

urlstring

http(s) URL to a PDF or image.

base64string

Base64-encoded file bytes (data-URI prefixes are stripped automatically).

media_typestring

MIME type for base64 input: application/pdf, image/png, image/jpeg, image/gif, or image/webp.

schemaobject · optional

A JSON Schema describing the desired output. When provided, the data field is guaranteed to match it.

instructionsstring · optional

Natural-language guidance for the extraction.

Multipart form upload

curl -X POST https://aidataparser.com/v1/parse/document \
  -H "Authorization: Bearer adp_live_xxxxxxxx" \
  -F "file=@/path/to/invoice.pdf" \
  -F 'schema={"type":"object","properties":{"total":{"type":"number"}}}'

Base64 upload

curl -X POST https://aidataparser.com/v1/parse/document \
  -H "Authorization: Bearer adp_live_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "base64": "JVBERi0xLjc...", "media_type": "application/pdf" }'

Response

dataobject

The extracted structured JSON (matches your schema when supplied).

confidence"high" | "medium" | "low"

Model's self-assessed confidence in the extraction.

review_neededboolean

True when the document was ambiguous or low quality — gate on this in agent workflows.

notesstring | null

Optional note about issues encountered.

credits_charged / credits_remaininginteger

Credits used by this call and your remaining balance.

Errors

401unauthorized

Missing, invalid, or revoked API key.

402payment required

Insufficient credits — top up to continue.

415unsupported media type

The file type is not a supported PDF or image.

422unprocessable

Scanned/image-only PDF with no embedded text — send the page as an image instead (OCR-grade PDF support is on the roadmap).

Errors return { "error": { "message": "..." } }. Failed extractions are never charged.