Key statistics
The request lets you get statistics about requests to the API over a period for a given key.
The maximum period per request: 35 days.
Usage frequency limit: 1 request in 10 seconds.
Request format
To get statistics on API requests, use an HTTP request with the GET
method:
GET /projects/<project_id>/services/<service_id>/keys/<key_id>/statistic?start=<YYYY-MM-DD>&end=<YYYY-MM-DD>
Host: api-developer.tech.yandex.net
X-Auth-Key: <your API key>
<project_id>
Project ID.
<service_id>
Service ID.
<key_id>
Key ID.
start
The start date of the period.
end
The end date of the period.
Response format
If the request has been completed successfully, the API returns a response with the code 200. The response body contains an object in JSON format:
{
"statistic": [
{
"counters": {
"cells": 50,
"orders": 10,
"requests": 2,
"requests_router": 8,
"total": 10
},
"date": "2021-10-01"
},
{
"counters": {
"cells": 54,
"orders": 10,
"requests": 4,
"requests_router": 8,
"total": 12
},
"date": "2021-10-02"
},
...
]
}
Response properties
Key |
Value |
|
Array with statistics by day. |
The properties of the |
|
|
An object with names and values of counters per day. |
|
Date. |
If the request has failed, the response message contains information about errors:
HTTP error code |
Error description |
|
One of the request parameters has an invalid value or data format. |
|
The user or app does not have rights to access the resource; the request is rejected. |
|
The requested resource is not found. |
|
Internal service error. Try resending your request later. |
|
The API service is temporarily unavailable. |
The URL of the node providing the API.
Authorization key.
Project ID.
Service ID.
The start date of the period.
The end date of the period.
Key ID.