Logs API use scenarios

  1. 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 the data, send the request GET https://api-metrika.yandex.net/management/v1/counter/{counterId}/logrequests/evaluate to see if it's possible.

    Restriction

    You can request data for a period of no more than 1 year per request. For more information, see Restrictions.

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

  3. Logs with a processed status are ready for export. Export the logs using the request GET https://api-metrika.yandex.net/management/v1/counter/{counterId}/logrequest/{requestId}/part/{partNumber}/download.

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

Server load may vary throughout the day. If you're unable to export your data, please 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 has a created status, wait for it to complete.