Inkspan › Guides › PDF to JSON API

PDF to JSON API

Convert tables inside PDFs into structured JSON rows. Detection falls back to coordinate-based reconstruction when a table has no ruling lines, and every response carries a confidence score.

Two detection paths means borderless tables still work, just with lower confidence — which the response tells you about rather than hiding.

Example

import requests

files = {'file': open('input.pdf', 'rb')}

r = requests.post(
    'https://api.inkspan.dev/v1/extract/tables',
    headers={'X-API-Key': 'ink_live_...'},
    files=files,
)
r.raise_for_status()
print(r.json())

Request parameters

NameTypeRequiredDescription
filefileyesThe PDF to extract tables from.

Response

Returns application/json:

{
  "table_count": 1,
  "tables": [
    {
      "page": 1,
      "rows": [
        [
          "Item",
          "Qty",
          "Price"
        ],
        [
          "Widget",
          "5",
          "$10"
        ]
      ]
    }
  ],
  "confidence": 0.95,
  "review_recommended": false
}

Things that catch people out

Errors

StatusMeaningFix
401Invalid or missing API keySend your key in the X-API-Key header.
402Monthly quota exceededThe response reports used/quota. Upgrade at inkspan.dev/#pricing.
422Missing or invalid parameterCheck required fields in the table above — the body names the offending field.

Failed requests do not count against your quota; only successful ones are metered.

Frequently asked questions

Is there a free tier?

Yes — 100 documents a month, no card required. Usage-based plans start at $19/month when you outgrow it.

How do I authenticate?

Send your key in the X-API-Key header on every request.

Do failed requests count against my quota?

No. Only successful requests are metered.

Get a free API key →

Full guides for /v1/extract/tables: cURL · Python · Node.js · all guides