Creation of logs request

Attention.

Access tokens will not be accepted in URL parameters starting February 13, 2019. To continue working with the Yandex.Metrica API, set up authorization by passing the token in the HTTP header.

The outdated authorization method will be temporarily disabled on January 23, January 30, and February 6 for maintenance. Authorization using URL parameters will be unavailable on these dates.

Creates logs request.

  1. Request syntax
  2. Response format

Request syntax

counterId — counter id.

https://api-metrica.yandex.net/management/v1/counter/{counterId}/logrequests
 ? [date1=<string>]
 & [date2=<string>]
 & [fields=<string>]
 & [source=<log_request_source>]
Query parameters
date1First day.
date2Last day (can't be the current day).
fieldsList of fields separated by commas.
sourceLogs source.

Allowed values:

  • hits — pageviews.
  • visits — sessions.

Request example

POST https://api-metrica.yandex.net/management/v1/counter/{counterId}/logrequests?date1=2016-01-01date2=2016-01-31fields=ym:pv:dateTime,ym:pv:referersource=hits

Response format


{
    "log_request" :  < log_request > 
}
ParametersDescription
log_requestLogs request.