---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://appmetrica.yandex.com/docs/en/mobile-api/stat/ref/bytime.md
  - https://appmetrica.yandex.com/docs/ru/mobile-api/stat/ref/bytime.md
---
> **Documentation Index:** Fetch the complete configuration index at https://appmetrica.yandex.com/docs/ru/llms.txt

<div class="openapi">

# Получение данных по времени

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

Позволяет получить данные с разбивкой по времени (например, по дням, неделям, месяцам). Используйте данный тип запроса для построения графиков и отслеживания динамики.


## 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.appmetrica.yandex.net/stat/v1/data/bytime
```

</div>

</div>

</div>

### Query parameters

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

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

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

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

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

<div class="openapi-entity">

### BytimeParams {#entity-BytimeParams}

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

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

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

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

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

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

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

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

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

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

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

_Default:_{.json-schema-reset .json-schema-value} `0.95`
{.table-cell}
||
||

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

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

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

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

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

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

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

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

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

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

```json translate=no
[
  0
]
```

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

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

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

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

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

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

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

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

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

Группировка данных по времени:
- `all` — временной интервал не разбивается;
- `auto` — интервал устанавливается с учетом выбранного отчетного периода и количества данных, достаточного для этого периода;
- `minutes` — временной интервал разбивается на интервалы из некоторого количества минут. Возможные интервалы minutes: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60, 120, 180, 240, 360, 480, 720, 1440. Расчеты оптимизированы так, чтобы между точками на графике не было больше одного интервала, с лимитом в 1600 точек для минут;
- `dekaminute` — временной интервал разбивается на 10-минутные интервалы;
- `minute` — временной интервал разбивается на минутные интервалы;
- `hour` — временной интервал разбивается на часовые интервалы;
- `hours` — временной интервал разбивается на интервалы из нескольких часов. Возможные интервалы hours: 1, 2, 3, 4, 6, 8, 12, 24. Расчеты оптимизированы так, чтобы между точками на графике не было больше одного интервала, с лимитом в 30 точек для часов;
- `day` — временной интервал разбивается по дням;
- `week` — временной интервал разбивается по неделям;
- `month` — временной интервал разбивается по месяцам;
- `quarter` — временной интервал разбивается по кварталам;
- `year` — временной интервал разбивается по годам.


_Default:_{.json-schema-reset .json-schema-value} `week`
{.table-cell}
||
||

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

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

```json translate=no
[
  0
]
```

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

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

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

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

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

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

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

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

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

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

_Default:_{.json-schema-reset .json-schema-value} `0.1`
{.table-cell}
||
||

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_row_ids_{.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

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

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

_Default:_{.json-schema-reset .json-schema-value} `7`
{.table-cell}
||
||

_with_confidence_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean
{.table-cell}
||
|#{.json-schema-properties}

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

```json translate=no
{
  "ids": [
    0
  ],
  "direct_client_ids": [
    0
  ],
  "direct_client_logins": [
    "example"
  ],
  "date1": "6daysAgo",
  "date2": "today",
  "timezone": "example",
  "preset": "example",
  "metrics": "example",
  "dimensions": "example",
  "reference_row_id": [
    "example"
  ],
  "filters": "example",
  "accuracy": "example",
  "proposed_accuracy": true,
  "include_undefined": true,
  "include_meta": true,
  "with_confidence": true,
  "exclude_insignificant": true,
  "confidence_level": "0.95",
  "max_deviation": "0.1",
  "pretty": "false",
  "lang": "example",
  "request_domain": "example",
  "require_metric_values": "false",
  "access_filter_id": 0,
  "group": "week",
  "callback": "example",
  "date_dimension": "example",
  "row_ids": [
    [
      "example"
    ]
  ],
  "top_keys": "7",
  "keys_sort": "example",
  "include_annotations": "false",
  "annotation_groups": [
    "example"
  ]
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### StatGroupParams {#entity-StatGroupParams}

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

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

_Min value:_{.json-schema-reset .json-schema-assertion} `1`
{.table-cell}
||
||

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

_Min value:_{.json-schema-reset .json-schema-assertion} `1`
{.table-cell}
||
|#{.json-schema-properties}

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

```json translate=no
{
  "org_id": 1,
  "label_id": 1
}
```

{% endcut %}

</div>

## 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"
  },
  "data": [
    {
      "dimensions": [
        {}
      ],
      "metrics": [
        [
          0.5
        ]
      ]
    }
  ],
  "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
    ]
  ],
  "annotations": [
    [
      {
        "id": 0,
        "date": "2025-01-01",
        "time": "12:00:00",
        "title": "example",
        "message": "example",
        "group": "example"
      }
    ]
  ]
}
```

{% endcut %}

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

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

Примечания.

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

```json translate=no
[
  [
    {
      "id": 0,
      "date": "2025-01-01",
      "time": "12:00:00",
      "title": "example",
      "message": "example",
      "group": "example"
    }
  ]
]
```

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

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

Признак возможного отсутствия [конфиденциальных данных](https://yandex.ru/support/metrica/reports/report-general.html#privacy) в ответе. К ним относятся данные, которые рассчитываются алгоритмами Яндекса, например, социально-демографические (пол, возраст и др.), адреса страниц входа, поисковые фразы, информация о роботах. При значении `true` в ответе не отобразятся такие данные, если выборка составляет меньше 10 посетителей.
Возможные значения: `true`, `false`.
{.table-cell}
||
||

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

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

```json translate=no
[
  {
    "dimensions": [
      {}
    ],
    "metrics": [
      [
        0.5
      ]
    ]
  }
]
```

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

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

Задержка в обновлении данных, в секундах.
{.table-cell}
||
||

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

Исходный запрос. Содержит параметры запроса, включая развернутые параметры из шаблона и параметры для схемы параметризации атрибутов.

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

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

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

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

Доля данных, по которым осуществлялся расчет. Доступно значение в пределах от 0 до 1.
{.table-cell}
||
||

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

Количество строк в выборке данных.
{.table-cell}
||
||

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

Количество строк данных.
{.table-cell}
||
||

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

Признак семплирования. Показывает, был ли применен семплинг. Возможные значения: `true`, `false`.
{.table-cell}
||
||

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

Общее количество строк в ответе по всему множеству данных (с учетом фильтра).
{.table-cell}
||
||

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

Признак того, что общее количество строк было округлено.
{.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">

### DynamicQueryExternal {#entity-DynamicQueryExternal}

Исходный запрос. Содержит параметры запроса, включая развернутые параметры из шаблона и параметры для схемы параметризации атрибутов.

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

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

Дата начала периода выборки в формате YYYY-MM-DD.

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

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

Дата окончания периода выборки в формате YYYY-MM-DD.

_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

Фильтр сегментации.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.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}
||
||

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

Пресет отчета.

_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

Часовой пояс периода выборки в формате ±hh:mm.

_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"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### DynamicRow {#entity-DynamicRow}

Строки ответа. Представляет собой массив, каждый элемент которого — одна строка результата.

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

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

#|
||

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

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

{% endcut %}

Массив значений группировок для данной строки. Каждое из значений группировки представляет собой объект. В нем обязательно присутствует поле `name` — текстовое значение, но могут присутствовать дополнительные поля, например идентификатор — `id`.

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

```json translate=no
[
  {}
]
```

{% endcut %}
{.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
{
  "dimensions": [
    {}
  ],
  "metrics": [
    [
      0.5
    ]
  ]
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### ConstructorReportChartAnnotation {#entity-ConstructorReportChartAnnotation}

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

_date_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date&gt;

Дата.

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

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

Группа:
- `A` — группа A.
- `B` — группа B.
- `C` — группа C.
- `D` — группа D.
- `E` — группа E.
- `HOLIDAY` — государственные праздники. Отображаются, если Яндекс Метрике удалось определить регион счетчика.

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

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

Идентификатор примечания.
{.table-cell}
||
||

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

Описание.

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

_time_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;time&gt;

Время.

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

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

Заголовок.

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

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

```json translate=no
{
  "id": 0,
  "date": "2025-01-01",
  "time": "12:00:00",
  "title": "example",
  "message": "example",
  "group": "example"
}
```

{% endcut %}

</div>

</div>

</div>

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