---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com.tr/dev/metrika/en/stat/openapi/drilldown.md
  - https://yandex.com.tr/dev/metrika/ru/stat/openapi/drilldown.md
  - href: en/stat/openapi/drilldown.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/dev/metrika/en/llms.txt

<div class="openapi">

# Drill down

<!-- markdownlint-disable-file -->

Used to generate a multi-level (tree view) report. Each level corresponds to a single dimension.
A request to the `drilldown` method returns one sublevel for the specified parent level. The parent level is specified in the `parent_id` parameter. To get data for the top level, send a request without the `parent_id` parameter.
To get data for nested levels, you must specify the path from the root. The path is formed from values of the `id` field for the `dimension` parameter. If the `id` field is omitted, specify the `name` field.
See [an example](https://yandex.com.tr/dev/metrika/en/stat/examples.md#drilldown) with this request.

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-get);margin-bottom: 12px">

<div class="openapi__request">

GET {.openapi__method}
```text translate=no
https://api-metrika.yandex.net/stat/v1/data/drilldown
```

</div>

</div>

</div>

### Query parameters

#|
|| **Name** | **Description** ||
||

_ids_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer[]

Comma-separated list of tag IDs.

_Example:_{.json-schema-reset .json-schema-example} `44147844,2215573`
{.table-cell}
||
||

_metrics_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

List of metrics separated by comma.
Limit: 20 metrics per request.

_Example:_{.json-schema-reset .json-schema-example} `ym:s:pageviews`
{.table-cell}
||
||

_accuracy_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Sample size for the report. Use it to control the [sampling rate](https://yandex.com.tr/dev/metrika/en/stat/sampling.md) (the number of sessions used for calculating results).

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_callback_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Callback function that processes the API response.

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_date1_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

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

_Default:_{.json-schema-reset .json-schema-value} `6daysAgo`

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_date2_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

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

_Default:_{.json-schema-reset .json-schema-value} `today`

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_dimensions_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Comma-separated list of dimensions.
Limit: 10 dimensions per request.

_Example:_{.json-schema-reset .json-schema-example} `ym:s:trafficSource`
{.table-cell}
||
||

_direct_client_logins_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

Comma-separated usernames of Yandex Direct clients. Can be used for generating the [Yandex Direct — costs](https://yandex.com.tr/dev/metrika/en/stat/direct-clicks.md) report.

_Example:_{.json-schema-reset .json-schema-example} `login1,login2`
{.table-cell}
||
||

_filters_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

[Segmentation](https://yandex.com.tr/dev/metrika/en/stat/segmentation.md) 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 criteria.

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_include_undefined_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean

The response will include rows that don't have defined dimension values. This only affects the first dimension. Disabled by default.
{.table-cell}
||
||

_lang_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Language.

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_limit_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Number of items on the results page.
Limit: 100,000.

_Default:_{.json-schema-reset .json-schema-value} `100`

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_offset_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

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

_Default:_{.json-schema-reset .json-schema-value} `1`

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_only_expandable_undefined_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean

Deletes unexpanded, undefined values from results. Use only when "include_undefined=true".
{.table-cell}
||
||

_parent_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

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

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_preset_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

[Report presets](https://yandex.com.tr/dev/metrika/en/stat/presets.md).

_Example:_{.json-schema-reset .json-schema-example} `sources_summary`
{.table-cell}
||
||

_pretty_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Specifies the formatting for results. To use formatting, set the value to `true`.

_Default:_{.json-schema-reset .json-schema-value} `false`

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_proposed_accuracy_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean

If the parameter is set to `true`, the API may automatically increase the accuracy to the recommended level. This can help you get meaningful results when querying small tables containing a very small sample of data.
{.table-cell}
||
||

_sort_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

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

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_timezone_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

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 to calculate the request sample period as well as the date- and time-specific dimensions.
By default, the tag's time zone is used.

_Example:_{.json-schema-reset .json-schema-example} `+03:00`
{.table-cell}
||
|#{.json-schema-properties}

## Responses

<div class="openapi__response__code__200">

## 200 OK

OK

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "query": {
    "timezone": "example",
    "preset": "example",
    "dimensions": [
      "example"
    ],
    "metrics": [
      "example"
    ],
    "sort": [
      "example"
    ],
    "date1": "example",
    "date2": "example",
    "filters": "example",
    "limit": 0,
    "offset": 0
  },
  "data": [
    {
      "dimension": {},
      "metrics": [
        0.5
      ],
      "expand": true
    }
  ],
  "total_rows": 0,
  "total_rows_rounded": true,
  "sampled": true,
  "contains_sensitive_data": true,
  "sample_share": 0.5,
  "sample_size": 0,
  "sample_space": 0,
  "data_lag": 0,
  "totals": [
    0.5
  ],
  "min": [
    0.5
  ],
  "max": [
    0.5
  ]
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_contains_sensitive_data_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean

Indicates whether [sensitive data](https://yandex.com/support/metrica/reports/report-general.html#privacy) can be omitted from the response. Such data 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`.
{.table-cell}
||
||

_data_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [DrillDownRow](#entity-DrillDownRow)[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "dimension": {},
    "metrics": [
      0.5
    ],
    "expand": true
  }
]
```

{% endcut %}
{.table-cell}
||
||

_data_lag_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Delay in updating data, in seconds.
{.table-cell}
||
||

_max_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: number[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  0.5
]
```

{% endcut %}
{.table-cell}
||
||

_min_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: number[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  0.5
]
```

{% endcut %}
{.table-cell}
||
||

_query_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [QueryExternal](#entity-QueryExternal)

Original request. Contains the request parameters, including detailed parameters from the template and parameters for attribute parametrization.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "timezone": "example",
  "preset": "example",
  "dimensions": [
    "example"
  ],
  "metrics": [
    "example"
  ],
  "sort": [
    "example"
  ],
  "date1": "example",
  "date2": "example",
  "filters": "example",
  "limit": 0,
  "offset": 0
}
```

{% endcut %}
{.table-cell}
||
||

_sample_share_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: number

Share of data used for the calculation. Available value ranges from 0 to 1.
{.table-cell}
||
||

_sample_size_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Number of rows in the data sample.
{.table-cell}
||
||

_sample_space_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Number of data rows.
{.table-cell}
||
||

_sampled_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean

Sampling flag. Indicates whether sampling was applied. Possible values: `true`, `false`.
{.table-cell}
||
||

_total_rows_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

The total number of rows in the response for the entire dataset (after filtering).
{.table-cell}
||
||

_total_rows_rounded_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean

Indicates that the total number of rows was rounded.
{.table-cell}
||
||

_totals_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: number[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  0.5
]
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### QueryExternal {#entity-QueryExternal}

Original request. Contains the request parameters, including detailed parameters from the template and parameters for attribute parametrization.

#|
|| **Name** | **Description** ||
||

_date1_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Start date of the sample period in YYYY-MM-DD format.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_date2_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

End date of the sample period in YYYY-MM-DD format.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_dimensions_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
||

_filters_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Segmentation filter.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_limit_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Number of items on the results page.
{.table-cell}
||
||

_metrics_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
||

_offset_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Index of the first row of requested data, starting from 1.
{.table-cell}
||
||

_preset_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Report preset.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_sort_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
||

_timezone_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Time zone of the sample period in ±hh:mm format.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "timezone": "example",
  "preset": "example",
  "dimensions": [
    "example"
  ],
  "metrics": [
    "example"
  ],
  "sort": [
    "example"
  ],
  "date1": "example",
  "date2": "example",
  "filters": "example",
  "limit": 0,
  "offset": 0
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### DrillDownRow {#entity-DrillDownRow}

Response rows. An array in which each item is a single row of the result.

#|
|| **Name** | **Description** ||
||

_dimension_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**Type**: object" %}

#|
||

_[additional]_{.json-schema-reset .json-schema-additional-property}
{.table-cell}|
**Type**: string

Dimension value for the specified level of the tree. For example, the second tree level is set (the `parent_id` array is one ID long). In this case, the field contains the value of the second dimension in the request.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% endcut %}

Dimension value for the specified level of the tree. For example, the second tree level is set (the `parent_id` array is one ID long). In this case, the field contains the value of the second dimension in the request.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{}
```

{% endcut %}
{.table-cell}
||
||

_expand_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean

Indicates whether to expand this row to the next level of the tree.
{.table-cell}
||
||

_metrics_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: number[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  0.5
]
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "dimension": {},
  "metrics": [
    0.5
  ],
  "expand": true
}
```

{% endcut %}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.