Run Metrica report
run_reportQuery Yandex Metrica analytics: retrieve metrics grouped by dimensions for a date range, with optional filters, sorting, and pagination to answer web traffic questions.
Instructions
Query a Yandex Metrica table report (/stat/v1/data): one or more metrics grouped by dimensions over a date range, with optional filter and sort. Read-only. Use get_metadata first to discover valid metric/dimension ids and the account counters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Sort fields; prefix a field with "-" for descending, e.g. ["-ym:s:visits"]. | |
| date1 | No | Start date as YYYY-MM-DD or relative (today, yesterday, NdaysAgo). | |
| date2 | No | End date as YYYY-MM-DD or relative (today, yesterday, NdaysAgo). | |
| limit | No | Rows per page (max 100000). Defaults to a small value to protect context. | |
| offset | No | 1-based index of the first row to return, for pagination. Default 1. | |
| preset | No | Named Metrica report preset (advanced); can substitute for metrics/dimensions. | |
| filters | No | Metrica filter expression in native syntax, e.g. ym:s:regionCityName=='Moscow' AND ym:pv:URL=@'help'. | |
| metrics | Yes | Metric ids, e.g. ["ym:s:visits","ym:s:users"]. Max 20. Discover valid ids with get_metadata. Do not mix ym:s: (visits) and ym:pv: (hits) namespaces in one call. | |
| accuracy | No | Sampling accuracy: low | medium | high | full, or a 0..1 share. Use "full" for exact data. | |
| timezone | No | Timezone offset for the report as ±hh:mm, e.g. "+03:00". Defaults to the counter timezone. | |
| counterId | No | Yandex Metrica counter id. Optional if YANDEX_METRIKA_COUNTER_ID is configured. | |
| dimensions | No | Dimension ids to group by, e.g. ["ym:s:lastsignTrafficSource"]. Max 10. Do not mix ym:s: and ym:pv: namespaces. | |
| fullResponse | No | If true, include all dimension sub-fields (id, icons, …). Default false: only the dimension name and metric values are returned, to save context. | |
| includeUndefined | No | Include rows where the first dimension value is undefined ("Not set"). Default false. |