Zyte API stats API#
Tip
For the reference documentation of the HTTP API of Zyte API itself, see Zyte API reference documentation.
The Zyte dashboard has a Stats page that lets you monitor different aspects of your Zyte API requests, including cost, response time, or features used.
Zyte API also offers an HTTP API to query your Zyte API requests.
Authentication#
All requests require basic authentication, with your Zyte dashboard API
key (not your Zyte API key) as username, and no password. For example, if
your API key is foo
, you base64-encode foo:
as Zm9vOg==
and send
the Authorization
header with value Basic Zm9vOg==
.
Authorization: Basic Zm9vOg==
Basic usage#
The most basic request only requires an organization ID.
To find your organization ID, open the Zyte dashboard and
copy your organization ID from the browser address bar.
For example, if the URL is https://app.zyte.com/o/000000
,
000000
is your organization ID.
curl \
--user YOUR_API_KEY: \
--compressed \
https://zyte-api-stats.zyte.com/api/stats?organization_id=000000
{
"page": 1,
"page_size": 500,
"results": [
{
"cost_microusd_avg": "1335.10",
"cost_microusd_p80": "2040.00",
"cost_microusd_total": "584773.00",
"organization_id": 000000,
"request_count": 438,
"response_time_sec_avg": "5.49",
"response_time_sec_p80": "6.40",
"status_codes": [
{
"code": null,
"count": 3
},
{
"code": 200,
"count": 432
},
{
"code": 404,
"count": 3
}
]
}
],
"total_result_count": 1
}
Rate limiting#
The stats API has a rate limit of 20 requests per minute. Anything above that will trigger a 429 response.
Reference#
APIFlask (0.1.0)
Download OpenAPI specification:Download
Stats
Authorizations:
query Parameters
organization_id required | integer |
page | integer >= 1 Default: 1 |
page_size | integer [ 1 .. 500 ] Default: 500 |
start_time | string <date-time> The start date and time in
ISO 8601-1 format (e.g. It defaults to 7 days in the past. |
end_time | string <date-time> The end date and time in
ISO 8601-1 format (e.g. It defaults to the current date and time. |
domains | string [ 0 .. 64 ] characters |
apikey_labels | string [ 0 .. 64 ] characters |
response_codes | string [ 0 .. 64 ] characters |
requested_features | any Enum: "actions" "browserHtml" "fileDownload" "httpResponseBody" "networkCapture" "screenshot" "sessionContext" "extendedGeolocation" |
extraction_type | any Enum: "article" "articleList" "articleNavigation" "forumThread" "jobPosting" "jobPostingNavigation" "product" "productList" "productNavigation" |
extraction_from | any Enum: "httpResponseBody" "browserHtml" |
tags | string [ 0 .. 64 ] characters |
groupby_time | string or null Default: null Enum: "hour" "day" "month" "year" null |
groupby_domain | boolean Default: false |
Responses
Response Schema: application/json
page required | integer >= 1 | ||||||||||||||||||||||||||||||
page_size required | integer [ 1 .. 500 ] | ||||||||||||||||||||||||||||||
Array of objects (StatsResult) [ items ] | |||||||||||||||||||||||||||||||
Array
| |||||||||||||||||||||||||||||||
total_result_count required | integer >= 1 |
Response samples
- 200
- 401
- 422
{- "page": 1,
- "page_size": 1,
- "results": [
- {
- "cost_microusd_avg": "0.00",
- "cost_microusd_p80": "0.00",
- "cost_microusd_total": "0.00",
- "day": "2019-08-24T14:15:22Z",
- "domain": "string",
- "hour": "2019-08-24T14:15:22Z",
- "month": "2019-08-24T14:15:22Z",
- "organization_id": 0,
- "request_count": 1,
- "response_time_sec_avg": "0.00",
- "response_time_sec_p80": "0.00",
- "status_codes": [
- {
- "property1": 0,
- "property2": 0
}
], - "year": "2019-08-24T14:15:22Z"
}
], - "total_result_count": 1
}