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>
Resource

<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.

Request headers

Host

The URL of the node providing the API.

X-Auth-Key

Authorization key.

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

statistic

Array with statistics by day.

The properties of the statistic array

counters

An object with names and values of counters per day.

date

Date.

If the request has failed, the response message contains information about errors:

HTTP error code

Error description

400 Bad Request

One of the request parameters has an invalid value or data format.

403 Forbidden

The user or app does not have rights to access the resource; the request is rejected.

404 Not Found

The requested resource is not found.

500 Internal Server Error

Internal service error. Try resending your request later.

503 Service Unavailable

The API service is temporarily unavailable.