Logs API use scenarios
-
To create logs, use the request POST https://api-metrika.yandex.net/management/v1/counter/{counterId}/logrequests.
If you're not sure you'll be able to export data, send the request GET https://api-metrika.yandex.net/management/v1/counter/{counterId}/logrequests/evaluate to gage this possibility.
Limitation
You can request data for a period of no more than 1 year per request. For more information, see Restrictions.
-
Once your request to generate logs is successful, save your
request_id
and wait for the log preparation to finish. You can check the log processing status with the request GET https://api-metrika.yandex.net/management/v1/counter/{counterId}/logrequest/{requestId}. -
A log with the
processed
status is ready for export. Export the log using the request GET https://api-metrika.yandex.net/management/v1/counter/{counterId}/logrequest/{requestId}/part/{partNumber}/download. -
After exporting, clear the logs prepared for download to free up space for subsequent requests. To do this, send the request POST https://api-metrika.yandex.net/management/v1/counter/{counterId}/logrequest/{requestId}/clean.
The service load can vary at different times. If you're unable to download the data, try again later or at a different time of day. All requests are processed in the order they're received, with each new request going to the end of the queue. If your request is in the created
status, wait for it to complete.