Skip to main content

Query Image Results

GET api.mathpix.com/v3/ocr-results

Mathpix allows customers to search their results from posts to /v3/text, /v3/pdf, /v3/strokes, and /v3/latex with a GET request on /v3/ocr-results?search-parameters.

The search request must also be authenticated the same way OCR requests are, in order to return relevant search results. See Authorization

Requests with the metadata improve_mathpix field set to false will not appear in the search results.

note

This endpoint will only work with API keys created after July 5th, 2020.

Request Parameters

curl -X GET -H 'app_key: APP_KEY' \
'https://api.mathpix.com/v3/ocr-results?from_date=2021-07-02T18%3A48%3A25.769285%2B00%3A00&page=1&per_page=10&tags=test_tag2&tags=test_tag3&is_handwritten=True'
{
"ocr_results": [
{
"timestamp": "2021-07-02T18:48:46.080Z",
"duration": 0.132,
"endpoint": "/v3/text",
"request_args": {
"tags": ["test_tag2", "test_tag3"],
"formats": ["text"]
},
"result": {
"text": "\\( 12+5 x-8=12 x-10 \\)",
"confidence": 1,
"is_printed": false,
"request_id": "a4301400-f66b-9821-d35c-babea8a26992",
"is_handwritten": true,
"confidence_rate": 1,
"auto_rotate_degrees": 0,
"auto_rotate_confidence": 0.0027393347044402105,
"version": "SuperNet-109p4"
},
"detections": {
"contains_algorithm": false,
"contains_chemistry": false,
"contains_diagram": false,
"is_handwritten": true,
"is_printed": false,
"contains_table": false,
"contains_triangle": false
}
},
{
"timestamp": "2021-07-02T18:48:45.903Z",
"duration": 0.15,
"endpoint": "/v3/text",
"request_args": {
"tags": ["test_tag", "test_tag2", "test_tag3"],
"formats": ["text"]
},
"result": {
"text": "\\( 12+5 x-8=12 x-10 \\)",
"confidence": 1,
"is_printed": false,
"request_id": "7fe48fb1-cd61-f8a0-0ba4-e71381740efb",
"is_handwritten": true,
"confidence_rate": 1,
"auto_rotate_degrees": 0,
"auto_rotate_confidence": 0.0027393347044402105,
"version": "SuperNet-109p4"
},
"detections": {
"contains_algorithm": false,
"contains_chemistry": false,
"contains_diagram": false,
"is_handwritten": true,
"is_printed": false,
"contains_table": false,
"contains_triangle": false
}
}
]
}
page integer, default value is 1

First page of results to return (max page 10000)

per_page integer, default value is 100

Number of results to return

from_date string (optional)

starting (included) ISO datetime

to_date string (optional)

ending (excluded) ISO datetime

app_id string (optional)

results for the given app_id

text string (optional)

result.text contains the given string

text_display string (optional)

result.text_display contains the given string

latex_styled string (optional)

result.latex_styled contains the given string

tags [string] (optional)

an array of tag strings

is_printed boolean (optional)

All results that contain printed text/math are included

is_handwritten boolean (optional)

All results that contain handwritten text/math are included

contains_table boolean (optional)

All results that contain a table are included

contains_chemistry boolean (optional)

All results that contain chemistry diagrams are included

contains_diagram boolean (optional)

All results that contain diagrams are included

contains_triangle boolean (optional)

All results that contain triangles are included

contains_algorithm boolean (optional)

All results that contain algorithms are included

Result Object

timestamp string

ISO timestamp of recorded result information

endpoint string

API endpoint used for upload (eg /v3/text, /v3/strokes, ...)

duration number

Difference between timestamp and when request was received

request_args object

Request body arguments

result object

Result body for request

detections object

An object of detections for each request