Gets a branch from the pivot table

Used to get data broken down by time period (for example, by day, week, or month). Use this request type to create charts and track statistics over time.

See an example with this request.

  1. Request syntax
  2. Response format

Request syntax

https://api-metrika.yandex.net/stat/v1/data/pivot/drilldown
 ? ids=<int,int,...>
 & metrics=<string>
 & [accuracy=<string>]
 & [callback=<string>]
 & [date1=<string>]
 & [date2=<string>]
 & [dimensions=<string>]
 & [direct_client_logins=<string,_string,...>]
 & [filters=<string>]
 & [id=<integer>]
 & [include_undefined=<boolean>]
 & [lang=<string>]
 & [limit=<int>]
 & [offset=<int>]
 & [parent_id=<list>]
 & [pivot_dimensions=<string>]
 & [pivot_limit=<integer>]
 & [pivot_offset=<integer>]
 & [pivot_parent_id=<list>]
 & [pivot_row_ids=<string>]
 & [pivot_sort=<string>]
 & [preset=<string>]
 & [pretty=<boolean>]
 & [proposed_accuracy=<boolean>]
 & [row_ids=<string>]
 & [sort=<string>]
 & [timezone=<string>]
ids *Comma-separated list of counter IDs. Used instead of the id parameter.
metrics *

Comma-separated list of metrics.

Limit: 20 metrics per request.

accuracySample size for the report. Use it to control the sampling rate (the number of sessions used for calculating results).

Default value: medium

callbackCallback function that processes the API response.
date1

Start date of the sample period in YYYY-MM-DD format. You can also use the values: today, yesterday, ndaysAgo.

Default value: 6daysAgo

date2

End date of the sample period in YYYY-MM-DD format. You can also use the values: today, yesterday, ndaysAgo.

Default value: today

dimensions

Comma-separated list of dimensions.

Limit: 10 dimensions per request.

direct_client_loginsComma-separated usernames of Yandex Direct clients. They can be used for generating the Yandex Direct — costs report.
filters

Segmentation filter.

Limits: up to 10 unique dimensions and metrics; up to 20 separate filters; up to 10,000 characters per filter row; and up to 100 values per filtering condition.

idTag ID. Obsolete. Use ids.
include_undefinedOutputs rows that don't have defined dimension values. This only affects the first dimension. Disabled by default.
langLanguage.
limit

Number of items on the results page.

Limit: 100,000.

Default value: 100

offsetIndex of the first row of requested data, starting from 1.

Default value: 1

parent_idRow for expanding further. Consists of a JSON list of keys.

Default value: []

pivot_dimensions

Comma-separated list of dimensions.

Limit: 10 dimensions per request.

pivot_limit

Number of columns on the results page.

Limit: 100.

Default value: 5

pivot_offsetIndex of the first row of requested data, starting from 1.

Default value: 1

pivot_parent_idColumn selection for further expansion. Consists of a JSON list of keys.

Default value: []

pivot_row_idsColumn selection for creating a table. Contains listing of key lists.
pivot_sortno description
presetReport presets.
prettySpecifies the formatting for results. To use formatting, set the value to true.

Default value: false

proposed_accuracyIf the parameter is set to true, the API has the right to automatically increase the "accuracy" parameter to the recommended value. This can help you obtain meaningful results when a request is sent to a small table with very small sampling.
row_idsString selection for creating a table. Contains listing of key lists.
sortComma-separated list of dimensions and metrics to use for sorting. By default, data is sorted in descending order (indicated by the “-” symbol in front of the dimension or metric). To sort data in ascending order, remove the “-” symbol.
timezone

Time zone in ±hh:mm format within the range of [-23:59; +23:59] (the plus sign should be denoted as %2B). This time zone is used when calculating the selection period, and is also used for date- and time-specific dimensions. By default, the tag's time zone is used.

ids *Comma-separated list of counter IDs. Used instead of the id parameter.
metrics *

Comma-separated list of metrics.

Limit: 20 metrics per request.

accuracySample size for the report. Use it to control the sampling rate (the number of sessions used for calculating results).

Default value: medium

callbackCallback function that processes the API response.
date1

Start date of the sample period in YYYY-MM-DD format. You can also use the values: today, yesterday, ndaysAgo.

Default value: 6daysAgo

date2

End date of the sample period in YYYY-MM-DD format. You can also use the values: today, yesterday, ndaysAgo.

Default value: today

dimensions

Comma-separated list of dimensions.

Limit: 10 dimensions per request.

direct_client_loginsComma-separated usernames of Yandex Direct clients. They can be used for generating the Yandex Direct — costs report.
filters

Segmentation filter.

Limits: up to 10 unique dimensions and metrics; up to 20 separate filters; up to 10,000 characters per filter row; and up to 100 values per filtering condition.

idTag ID. Obsolete. Use ids.
include_undefinedOutputs rows that don't have defined dimension values. This only affects the first dimension. Disabled by default.
langLanguage.
limit

Number of items on the results page.

Limit: 100,000.

Default value: 100

offsetIndex of the first row of requested data, starting from 1.

Default value: 1

parent_idRow for expanding further. Consists of a JSON list of keys.

Default value: []

pivot_dimensions

Comma-separated list of dimensions.

Limit: 10 dimensions per request.

pivot_limit

Number of columns on the results page.

Limit: 100.

Default value: 5

pivot_offsetIndex of the first row of requested data, starting from 1.

Default value: 1

pivot_parent_idColumn selection for further expansion. Consists of a JSON list of keys.

Default value: []

pivot_row_idsColumn selection for creating a table. Contains listing of key lists.
pivot_sortno description
presetReport presets.
prettySpecifies the formatting for results. To use formatting, set the value to true.

Default value: false

proposed_accuracyIf the parameter is set to true, the API has the right to automatically increase the "accuracy" parameter to the recommended value. This can help you obtain meaningful results when a request is sent to a small table with very small sampling.
row_idsString selection for creating a table. Contains listing of key lists.
sortComma-separated list of dimensions and metrics to use for sorting. By default, data is sorted in descending order (indicated by the “-” symbol in front of the dimension or metric). To sort data in ascending order, remove the “-” symbol.
timezone

Time zone in ±hh:mm format within the range of [-23:59; +23:59] (the plus sign should be denoted as %2B). This time zone is used when calculating the selection period, and is also used for date- and time-specific dimensions. By default, the tag's time zone is used.

* Required

Response format


{
    "total_rows" :  < long > ,
    "total_rows_rounded" :  < boolean > ,
    "sampled" :  < boolean > ,
    "contains_sensitive_data" :  < boolean > ,
    "sample_share" :  < double > ,
    "sample_size" :  < long > ,
    "sample_space" :  < long > ,
    "data_lag" :  < int > ,
    "query" : {
        "ids" : [  < int > , ... ],
        "timezone" :  < string > ,
        "preset" :  < string > ,
        "dimensions" : [  < string > , ... ],
        "metrics" : [  < string > , ... ],
        "sort" : [  < string > , ... ],
        "date1" :  < string > ,
        "date2" :  < string > ,
        "filters" :  < string > ,
        "pivot_dimensions" : [  < string > , ... ]
    },
    "data" : [ {
        "dimensions" : [ {
            "key_1" :  < string > ,
            "key_2" : ...
        }, ... ],
        "metrics" : [ [  < double > , ... ], ... ]
    }, ... ],
    "totals" : [  < double > , ... ]
}
Parameters Description
total_rows The total number of rows in the response for the entire dataset (after filtering).
total_rows_rounded Indicates that the total number of rows was rounded.
sampled Sampling flag. Indicates whether sampling was applied. Possible values: true, false.
contains_sensitive_data

Indicates whether sensitive data can be omitted from the response. This includes data calculated by Yandex algorithms: demographic data (gender, age, and other), login page addresses, search phrases, and robot information. If the value is true, the response will not display such data if the sample is less than 10 users.

Possible values: true, false.

sample_share Percentage of data used for the calculation. Available values range from 0 to 1.
sample_size Number of rows in the requested data.
sample_space Number of data rows.
data_lag Delay in updating data, in seconds.
query Original request. Contains the request parameters, including detailed parameters from the template and parameters for attribute parametrization.
data Response rows. An array in which each item is a single row of the result.
totals Total results for metrics across the entire dataset (with filtration).
query
ids Counter IDs.
timezone Time zone of the sample period in ±hh:mm format.
preset Report preset.
dimensions Array of dimensions.
metrics Array of metrics.
sort Array of sortings.
date1 Start date of the sample period in YYYY-MM-DD format.
date2 End date of the sample period in YYYY-MM-DD format.
filters Segmentation filter.
pivot_dimensions Array of dimensions.
data
dimensions Array of dimension values for this row. Each dimension value is an object. It must have the name field, which is a text value. But it can also have additional fields, such as id.
metrics Array of arrays of metric values for this row. The outer array lists metrics, and the inner arrays list values of a specific metric for each time group.
Parameters Description
total_rows The total number of rows in the response for the entire dataset (after filtering).
total_rows_rounded Indicates that the total number of rows was rounded.
sampled Sampling flag. Indicates whether sampling was applied. Possible values: true, false.
contains_sensitive_data

Indicates whether sensitive data can be omitted from the response. This includes data calculated by Yandex algorithms: demographic data (gender, age, and other), login page addresses, search phrases, and robot information. If the value is true, the response will not display such data if the sample is less than 10 users.

Possible values: true, false.

sample_share Percentage of data used for the calculation. Available values range from 0 to 1.
sample_size Number of rows in the requested data.
sample_space Number of data rows.
data_lag Delay in updating data, in seconds.
query Original request. Contains the request parameters, including detailed parameters from the template and parameters for attribute parametrization.
data Response rows. An array in which each item is a single row of the result.
totals Total results for metrics across the entire dataset (with filtration).
query
ids Counter IDs.
timezone Time zone of the sample period in ±hh:mm format.
preset Report preset.
dimensions Array of dimensions.
metrics Array of metrics.
sort Array of sortings.
date1 Start date of the sample period in YYYY-MM-DD format.
date2 End date of the sample period in YYYY-MM-DD format.
filters Segmentation filter.
pivot_dimensions Array of dimensions.
data
dimensions Array of dimension values for this row. Each dimension value is an object. It must have the name field, which is a text value. But it can also have additional fields, such as id.
metrics Array of arrays of metric values for this row. The outer array lists metrics, and the inner arrays list values of a specific metric for each time group.