stat_comparison_drilldown
Compare two segments in Yandex Metrika and drill down into hierarchical report data to analyze differences between segment A and B.
Instructions
Yandex Metrika Reports API. Docs: https://yandex.ru/dev/metrika/ru/stat/ Segment comparison drill-down — GET /stat/v1/data/comparison/drilldown. Tree report comparing segments A and B.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes | Counter IDs, comma-separated (e.g. 44147844 or 44147844,2215573) | |
| lang | No | Response language | |
| sort | No | Sort by dimensions/metrics comma-separated. Prefix with - for descending | |
| date1 | No | Period start: YYYY-MM-DD, today, yesterday, or ndaysAgo (default: 6daysAgo) | |
| date2 | No | Period end: YYYY-MM-DD, today, yesterday, or ndaysAgo (default: today) | |
| limit | No | Page size, max 100000 (default: 100) | |
| format | No | Response format: json (default) or csv | |
| offset | No | First row index, starting from 1 (default: 1) | |
| preset | No | Report preset name. See https://yandex.ru/dev/metrika/ru/stat/presets.md | |
| date1_a | No | Segment A period start: YYYY-MM-DD, today, yesterday, ndaysAgo (default: 6daysAgo) | |
| date1_b | No | Segment B period start: YYYY-MM-DD, today, yesterday, ndaysAgo (default: 6daysAgo) | |
| date2_a | No | Segment A period end: YYYY-MM-DD, today, yesterday, ndaysAgo (default: today) | |
| date2_b | No | Segment B period end: YYYY-MM-DD, today, yesterday, ndaysAgo (default: today) | |
| filters | No | Segmentation filter expression. See https://yandex.ru/dev/metrika/ru/stat/segmentation.md | |
| metrics | Yes | Metrics comma-separated, max 20. Use ym:s: prefix for visits or ym:pv: for hits. See https://yandex.ru/dev/metrika/ru/stat/attrandmetr/dim_all.md | |
| accuracy | No | Sample size for report (sampling). See https://yandex.ru/dev/metrika/ru/stat/sampling.md | |
| timezone | No | Timezone as ±hh:mm, e.g. +03:00 (plus sign as %2B in URL) | |
| filters_a | No | Segmentation filter for segment A | |
| filters_b | No | Segmentation filter for segment B | |
| parent_id | No | Parent row path for drill-down (JSON list of keys). Omit for root level | |
| dimensions | No | Dimensions (groupings) comma-separated, max 10. See https://yandex.ru/dev/metrika/ru/stat/attrandmetr/dim_all.md | |
| include_undefined | No | Include rows with undefined dimension values (first dimension only) | |
| proposed_accuracy | No | Allow API to auto-increase accuracy for small samples | |
| direct_client_logins | No | Yandex Direct client logins comma-separated (Direct expenses reports) | |
| only_expandable_undefined | No | Remove non-expandable undefined values (requires include_undefined=true) |