PDF to JSON API

Most PDF libraries give you raw text or a positional soup of characters — useful for search, useless for structured data. The AIDataParser PDF to JSON API goes the last mile: you describe the JSON you want and it returns exactly that, whether the source is a form, a report, a table-heavy spec sheet, or a contract. Text-first PDFs are read with a pure-JS parser; image-only pages are handled as vision input, so mixed documents don't break the flow.

The power is in the schema. Ask for a flat set of fields and you get a clean object; ask for a nested array and you get structured tables with typed columns. Because the output is validated against your JSON Schema, you never write another line of positional-text wrangling or guess which text run is the value you needed. This is what turns a static PDF into an API response your application can act on.

It fits anywhere a PDF is the input and JSON is the requirement: document-ingestion pipelines, data-migration jobs, and LLM agents that need a document turned into facts. One POST, one credit per document, and a confidence signal so you know when a scan was too poor to trust. No file is retained after the request completes.

Fields you can extract from a PDF

titlestring

Document title/heading.

fieldsobject

Any key-value fields you define.

tablesarray

Rows of typed columns from tables.

textstring

Full or summarized body text.

Example request

POST the PDF by URL, upload, or base64, with a JSON Schema describing the output you want.

curl -X POST https://aidataparser.com/v1/parse/document \
  -H "Authorization: Bearer adp_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/document.pdf",
    "schema": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "tables": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }'

Example response

The data field is guaranteed to match your schema.

{
  "object": "parse.document",
  "data": {
    "title": "Q2 Performance Report",
    "summary": "Revenue grew 18% quarter over quarter driven by API usage.",
    "tables": [
      {
        "label": "Revenue",
        "value": "$412,000"
      },
      {
        "label": "Active accounts",
        "value": "1,204"
      }
    ]
  },
  "confidence": "high",
  "review_needed": false,
  "credits_charged": 1,
  "credits_remaining": 49
}

FAQ

Does it work on both text PDFs and scanned PDFs?

Text-based PDFs are read directly; image-only pages are handled as vision input. A scanned PDF with no embedded text returns a 422 so you can send the page as an image instead.

Can it extract tables from a PDF?

Yes. Model your tables as an array of row objects in your schema and each row is returned with typed columns, so you get real structured data rather than concatenated text.

How is this different from a PDF text extractor?

Text extractors give you unstructured strings. This returns JSON that conforms to your schema — named, typed fields and tables — so your code can consume it without post-processing.

More document types