- Upload the file to get a
file_id— or skip the upload and pass a public file URL directly as thefileinput in step 2. - Launch a table-extraction job with
POST /v3/universal-ai/async, which returns apublic_id. - Poll
GET /v3/universal-ai/async/{public_id}until the job’sstatusissuccess, then read itsoutput.
Prerequisites
- API Token — get yours from the Eden AI dashboard.
- Credits — table extraction is billed per page (see pricing below). To try the flow for free first, use a sandbox token.
- For R: the
httrandjsonlitepackages (install.packages(c("httr", "jsonlite"))).
Model string
Table extraction uses the Universal AI model formatfeature/subfeature/provider:
amazon, google, or microsoft.
A single document, end to end
Start with one file to see the shape of the calls. This uploads a document and launches the job; the launch response contains thepublic_id you poll on.
Response shape
A completed job returns astatus and an output. Tables are nested pages -> tables -> rows -> cells, and each cell carries its position (row_index, col_index) so you can rebuild the grid:
Batch a whole folder into one CSV
Now loop the three steps over a list of files. Each document is uploaded, launched, and polled independently; every cell is flattened into a row tagged with its source file, page, and table, then written totables.csv.
The poll loop is bounded — it gives up after a fixed number of attempts rather than waiting forever — and a failed or slow document is skipped rather than aborting the whole batch.
Reading the CSV in R
Oncetables.csv is written, it loads like any other data frame:
R
Choosing a provider
All three providers return the same standardized shape, so you can switch by changing only the provider in the model string. They differ in price and in how they handle dense or low-quality scans — worth testing a few of your own pages against each.Expert OCR vs. an LLM
Table extraction (ocr/ocr_tables_async) is a specialized OCR model: it returns every cell with its row/column position and a confidence score, and it’s priced per page. That structure is what makes the CSV step above reliable.
An LLM can also read a document and return data, and it’s more flexible when you want to reshape or interpret the content in the same pass (for example “return each row as JSON with typed fields”). It’s usually the better fit when the layout varies a lot or you need reasoning over the values, but it does not give you per-cell coordinates or confidences, and cost scales with tokens rather than pages.
If you’re deciding between the two for a table-heavy workload, see:
LLMs vs. Expert Models
When to reach for a specialized model versus a general LLM.
Structured Output
Force an LLM to return typed JSON matching your schema.
Next Steps
Table Extraction Reference
Full input/output schema for
ocr_tables_async.File Upload
Upload once, reference a file across many requests.
Webhooks
Get async results pushed to you instead of polling.
OCR Features
Text detection, multipage OCR, and document parsers.