PDF to JSON API

A PDF to JSON API reads a PDF and returns its content as JSON. Some return the raw layout (every text block with coordinates); others return only the fields you ask for, like total or due_date. Our Document to JSON API is the second kind: one POST with a PDF link and your field list, $0.03 per document, and a field it can't find comes back as null.

Try it free Document to JSON API — extract fields from any file · $0.03 / call

Two kinds of "PDF to JSON"

Layout JSON describes the page: blocks of text, fonts, positions and tables. It's complete, but you still write code to find the invoice number inside it.

Field JSON answers your questions directly: {"invoice_number": "A-1042", "total": 1890.5}. You decide the keys, so the output drops straight into a database row or a spreadsheet.

One request with curl

curl only shows you the 402 and the price. To get the data, use any x402 v2 client, for example Coinbase's x402 packages or Coinbase AgentKit with the iamai-agentkit plugin. It pays in USDC on Base and repeats the request with the PAYMENT-SIGNATURE header.

curl -i -X POST https://iamai.markets/api/x402/services/YJwWWlLP8th0 \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/invoice.pdf",
       "fields": {"invoice_number": "the invoice number",
                  "total": "amount due as a number",
                  "due_date": "YYYY-MM-DD"}}'

# HTTP/1.1 402 Payment Required  (price: $0.03)
# Repeat with an x402 v2 client to pay and get the 200 answer.

What comes back

{
  "order_id": "...",
  "transaction": "0x...",
  "price_usd": 0.03,
  "result": {
    "source_url": "https://example.com/invoice.pdf",
    "fields": {"invoice_number": "A-1042", "total": 1890.5, "due_date": "2026-12-15"},
    "found": 3,
    "requested": 3
  }
}

Rules and limits

Other PDF to JSON options

OptionOutputTrade-off
Adobe PDF Services (Extract)Layout JSON: elements, tables, positionsAccount and credentials; you map fields yourself
AWS Textract, Google Document AILayout plus prebuilt parsers for invoices and IDsCloud account and setup; strong on scans
Open-source (pdfplumber, PyMuPDF)Raw text and positionsFree; you write the field logic
Document to JSON API (iamai.markets)Only the fields you name$0.03 per file; text PDFs only; pays with x402

The product

Questions

Is there a free plan?

There are 5 free tries a day on the listing page for testing by hand. Calls from code are $0.03 each, with no monthly fee.

Does it ever guess a value?

It's told to copy values as written and return null when a field isn't there. Still check important numbers, as with any automatic extraction.

How big can the PDF be?

Up to 10 MB. Very long documents are read up to about 60,000 characters of text.

Related

Updated 2026-12-01