---
metadata:
  - name: generator
    content: Diplodoc Platform v5.64.0
alternate:
  - https://boost.yandex.com/doc/en/analytics/content/mobile-api/stat/ref/bytime.md
  - https://boost.yandex.com/doc/ru/analytics/content/mobile-api/stat/ref/bytime.md
  - https://boost.yandex.com/doc/zh/analytics/content/mobile-api/stat/ref/bytime.md
  - href: https://boost.yandex.com/doc/zh/analytics/content/mobile-api/stat/ref/bytime.md
    type: text/markdown
    title: Markdown version
  - href: https://boost.yandex.com/doc/zh/llms.txt?revision=r21738064
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://boost.yandex.com/doc/zh/llms.txt?revision=r21738064

<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}|
{% cut "**Type**: object" %}

#|
||

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

{% endcut %}

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

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

#|
||

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

{% endcut %}

_Example:_{.json-schema-reset .json-schema-example} ``
{.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"
  },
  "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}|
{% cut "**Type**: object[][]" %}

#|
||

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

Date.

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

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

Group:
- `A`: 组A。
- `B`: 组B。
- `C`: 组C。
- `D`: 组D。
- `E`: 组E。
- `假日`：公共假日。 当Yandex Metrica成功检测到标签的区域时显示。

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

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

Comment ID.
{.table-cell}
||
||

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

Description.

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

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

Time.

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

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

Title.

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

{% endcut %}

Comments.

{% 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.com/support/metrica/reports/report-general.html#privacy)。 这些数据包括由 Yandex 算法计算出的数据：人口统计数据（性别、年龄等）、登录页地址、搜索词语以及机器人信息。 如果值是`true`，当样本少于10个用户时，响应不会显示这些数据。
Possible values: `真`, `假`.
{.table-cell}
||
||

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

#|
||

_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 %}

该行的维度值数组。 每个维度值都是一个对象。 它必须有`名称`字段，该字段为文本值。 但它还可能有额外的字段，例如`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}

{% endcut %}

{% 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}|
{% cut "**Type**: object" %}

#|
||

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

{% endcut %}

Original request. 包含请求参数，包括模板中的详细参数和属性参数化的参数。

{% 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

Sampling flag. 表示是否应用了采样。 Possible values: `真`, `假`.
{.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>

</div>

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