Skip to main content
POST
/
api
/
v1
/
table_rec
Table Recognition
curl --request POST \
  --url https://www.datalab.to/api/v1/table_rec \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-API-Key: <api-key>' \
  --form max_pages=123 \
  --form 'page_range=<string>' \
  --form skip_table_detection=false \
  --form 'output_format=<string>' \
  --form skip_cache=false \
  --form use_llm=false \
  --form paginate=false \
  --form file=@example-file
{
  "success": true,
  "error": "<string>",
  "request_id": "<string>",
  "request_check_url": "<string>",
  "versions": {}
}

Authorizations

X-API-Key
string
header
required

Cookies

access_token
string

Body

multipart/form-data
max_pages
integer | null

The maximum number of pages in the PDF to convert.

page_range
string | null

The page range to parse, comma separated like 0,5-10,20. This will override max_pages if provided. Example: '0,2-4' will process pages 0, 2, 3, and 4.

skip_table_detection
boolean
default:false

Tables are already cropped, so don't re-detect tables.

output_format
string | null

The output format for the table. Can be 'json', 'html', or 'markdown'. Defaults to 'markdown'.

skip_cache
boolean
default:false

Skip the cache and re-run the inference. Defaults to False. If set to True, the cache will be skipped and the inference will be re-run.

use_llm
boolean
default:false

Significantly improves accuracy by using an LLM to enhance tables, forms, inline math, and layout detection. Will increase latency. Defaults to False.

paginate
boolean
default:false

Whether to paginate the output. Defaults to False. If set to True, each page of the output will be separated by a horizontal rule that contains the page number (2 newlines, {PAGE_NUMBER}, 48 - characters, 2 newlines).

file
file | null

Input PDF, word document, powerpoint, or image file, uploaded as multipart form data. Images must be png, jpg, or webp format.

Response

Successful Response

request_id
string
required

The ID of the request. This ID can be used to check the status of the request.

request_check_url
string
required

The URL to check the status of the request and get results.

success
boolean
default:true

Whether the request was successful.

error
string | null

If the request was not successful, this will contain an error message.

versions

A dictionary of the versions of the libraries used in the request.