Inkspan › Guides › 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.
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())
| Name | Type | Required | Description |
|---|---|---|---|
file | file | yes | The PDF to extract tables from. |
Returns application/json:
{
"table_count": 1,
"tables": [
{
"page": 1,
"rows": [
[
"Item",
"Qty",
"Price"
],
[
"Widget",
"5",
"$10"
]
]
}
],
"confidence": 0.95,
"review_recommended": false
}
review_recommended. Ignoring it is how false-certain data reaches production.| Status | Meaning | Fix |
|---|---|---|
401 | Invalid or missing API key | Send your key in the X-API-Key header. |
402 | Monthly quota exceeded | The response reports used/quota. Upgrade at inkspan.dev/#pricing. |
422 | Missing or invalid parameter | Check 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.
Yes — 100 documents a month, no card required. Usage-based plans start at $19/month when you outgrow it.
Send your key in the X-API-Key header on every request.
No. Only successful requests are metered.
Get a free API key →Full guides for /v1/extract/tables: cURL · Python · Node.js · all guides