Skip to main content

Query OCR Usage

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

To track ocr usage, a user may get information from v3/ocr-usage, adding to the request period of time, and can group responses in different ways.

Request Parameters

curl -X 'GET' \
'https://api.mathpix.com/v3/ocr-usage?from_date=2021-01-01T00%3A00%3A00.000Z&to_date=2021-01-02T00%3A00%3A00.000Z&group_by=usage_type&timespan=month' \
-H 'app_id: APP_ID' \
-H 'app_key: APP_KEY'
from_date string (optional)

starting (included) ISO datetime

to_date string (optional)

ending (excluded) ISO datetime

group_by string

return values aggregated by this parameter. One of usage_type, request_args_hash, app_id

timespan string

return aggregated by specified timespan

Response Body

{
"ocr_usage": [
{
"from_date": "2022-01-01T00:00:00.000Z",
"app_id": ["mathpix"],
"usage_type": "image",
"request_args_hash": ["1f241a3777a5646b98eb4e07c1e39f27770c14d8"],
"count": 21
},
{
"from_date": "2022-01-01T00:00:00.000Z",
"app_id": ["mathpix"],
"usage_type": "image-async",
"request_args_hash": [
"05d8e589e40f0e071908e93facd5b3f4a3ec87c0",
"1402ecaace7d72c61a900f1f1e0d4c729db636e7"
],
"count": 7
}
]
}
from_date string

starting (included) ISO datetime

usage_type string

type of service

request_args_hash string

hash of request_args

count number

number of requests according to the selected group_by request parameter