The API for the service allows you to:
To access the Yandex.Metrica API, you must get authorization using Yandex.OAuth. The access token must be transmitted in every API request.
To demonstrate API features, the reference guide includes examples of accessing the service. In the examples, methods return sample data that can be viewed by all users.
The API has the following sections:
All parts of the Yandex.Metrica API support versioning. Each version has a specific identifier (v1, v2, and so on). When a new version of the API is released, the previous version continues functioning to support backward compatibility.
If you are beginning to work with the API, use the latest version. If you are already using a previous version of the API, we recommend gradually migrating to the latest version, since older versions are supported for a limited time.
When making API requests, always specify the version you want to work with.
The Yandex.Metrica API is built on REST principles.
Everything that can be managed via the API is represented by resources: statistics, the list of counters, the counter itself, counter goals and each specific goal, counter access, and so on.
So a resource is an integral part of the system that you can work with:
Each resource has its own unique URL. All actions are executed by the corresponding HTTP methods at the resource URLs.
For example, to get information about a counter, you send a GET request to the counter URL. And to create a new counter, you send a POST request with the counter body to the URL of the “counter list” resource.