Get data by time
Enables you to get data broken down by time period (such as by day, week, or month). Use this type of request to build charts and track statistics over time.
Request
GET
https://api.appmetrica.yandex.net/stat/v1/data/bytime
Query parameters
|
Name |
Description |
|
params |
Type: BytimeParams Example: `` |
|
statGroupParams |
Type: StatGroupParams Example: `` |
BytimeParams
|
Name |
Description |
|
access_filter_id |
Type: integer |
|
accuracy |
Type: string Example: |
|
annotation_groups |
Type: string[] Example
|
|
callback |
Type: string Example: |
|
confidence_level |
Type: string Default: |
|
date_dimension |
Type: string Example: |
|
date1 |
Type: string Default: |
|
date2 |
Type: string Default: |
|
dimensions |
Type: string Example: |
|
direct_client_ids |
Type: integer[] Example
|
|
direct_client_logins |
Type: string[] Example
|
|
exclude_insignificant |
Type: boolean |
|
filters |
Type: string Example: |
|
group |
Type: string Группировка данных по времени:
Default: |
|
ids |
Type: integer[] Example
|
|
include_annotations |
Type: string Default: |
|
include_meta |
Type: boolean |
|
include_undefined |
Type: boolean |
|
keys_sort |
Type: string Example: |
|
lang |
Type: string Example: |
|
max_deviation |
Type: string Default: |
|
metrics |
Type: string Example: |
|
preset |
Type: string Example: |
|
pretty |
Type: string Default: |
|
proposed_accuracy |
Type: boolean |
|
reference_row_id |
Type: string[] Example
|
|
request_domain |
Type: string Example: |
|
require_metric_values |
Type: string Default: |
|
row_ids |
Type: string[][] Example
|
|
timezone |
Type: string Example: |
|
top_keys |
Type: string Default: |
|
with_confidence |
Type: boolean |
Example
{
"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"
]
}
StatGroupParams
|
Name |
Description |
|
label_id |
Type: integer Min value: |
|
org_id |
Type: integer Min value: |
Example
{
"org_id": 1,
"label_id": 1
}
Responses
200 OK
OK
Body
application/json
{
"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"
}
]
]
}
|
Name |
Description |
|
annotations |
Type: ConstructorReportChartAnnotation[][] Comments. Example
|
|
contains_sensitive_data |
Type: boolean Indicates whether sensitive data 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 |
|
data |
Type: DynamicRow[] Example
|
|
data_lag |
Type: integer Delay in updating data, in seconds. |
|
query |
Type: DynamicQueryExternal Original request. Contains the request parameters, including detailed parameters from the template and parameters for attribute parametrization. Example
|
|
sample_share |
Type: number Percentage of data used for the calculation. Available values range from 0 to 1. |
|
sample_size |
Type: integer Number of rows in the requested data. |
|
sample_space |
Type: integer Number of data rows. |
|
sampled |
Type: boolean Sampling flag. Indicates whether sampling was applied. Possible values: |
|
total_rows |
Type: integer The total number of rows in the response for the entire dataset (after filtering). |
|
total_rows_rounded |
Type: boolean Indicates that the total number of rows was rounded. |
|
totals |
Type: number[][] Total results for metrics across the entire dataset (with filtration). Example
|
DynamicQueryExternal
Original request. Contains the request parameters, including detailed parameters from the template and parameters for attribute parametrization.
|
Name |
Description |
|
date1 |
Type: string Start date of the report period in the format YYYY-MM-DD. Example: |
|
date2 |
Type: string End date of the report period in the format YYYY-MM-DD. Example: |
|
dimensions |
Type: string[] Example
|
|
filters |
Type: string Segmentation filter. Example: |
|
metrics |
Type: string[] Example
|
|
preset |
Type: string Report preset. Example: |
|
sort |
Type: string[] Example
|
|
timezone |
Type: string The time zone of the selection period in the format ±hh:mm. Example: |
Example
{
"timezone": "example",
"preset": "example",
"dimensions": [
"example"
],
"metrics": [
"example"
],
"sort": [
"example"
],
"date1": "example",
"date2": "example",
"filters": "example"
}
DynamicRow
Response rows. An array in which each item is a single row of the result.
|
Name |
Description |
||
|
dimensions |
Type: object[]
Array of dimension values for this row. Each dimension value is an object. It must have the Example
|
||
|
metrics |
Type: number[][] Array of arrays of metric values for this row. The outer array lists metrics, whereas the inner arrays list values of a specific metric for each time group. Example
|
Example
{
"dimensions": [
{}
],
"metrics": [
[
0.5
]
]
}
ConstructorReportChartAnnotation
|
Name |
Description |
|
date |
Type: string<date> Date. Example: |
|
group |
Type: string Group:
Example: |
|
id |
Type: integer Comment ID. |
|
message |
Type: string Description. Example: |
|
time |
Type: string<time> Time. Example: |
|
title |
Type: string Title. Example: |
Example
{
"id": 0,
"date": "2025-01-01",
"time": "12:00:00",
"title": "example",
"message": "example",
"group": "example"
}