Skip to main content

POST v3/batch

POST api.mathpix.com/v3/batch

Process multiple equation images in a single request. The request body may contain any v3/latex parameters except src, plus a urls parameter and optional callback.

warning

Only use the batch API when your workload is not latency sensitive! For immediate responses use single image endpoints.

See the batch processing guide for step-by-step examples.

Request parameters

urls object

key-value for each image in the batch where the value may be a string url or an object containing a url and image-specific options such as region and formats.

ocr_behavior string (optional), default value is latex

"text" for processing like v3/text or "latex" for processing like v3/latex. Only these two values are accepted.

callback object (optional)

Description of where to send the batch results. See Callback object.

When using ocr_behavior: "text", all v3/text params can be set at the top level or individually per URL.

Response body

batch_id number

Unique batch tracking ID

GET v3/batch/{batch_id}

GET api.mathpix.com/v3/batch/{batch_id}

Retrieve batch results. Wait approximately one second per five images before polling. The GET request must contain the same app_id and app_key headers as the POST.

keys string[]

all the url keys present in the originating batch request

results object

an OCR result for each key that has been processed

Before completion, the results field may be empty or contain only some results.

Callback object

post string

URL to post results to. Must be a string

reply object (optional)

Object merged into the callback response body. Must be an object, cannot contain batch_id

body object (optional)

Additional data included when posting results

headers object (optional)

HTTP headers to include when posting results

Invalid callback configuration returns error opts_bad_callback.