Drill down
Позволяет сформировать многоуровневый (древовидный) отчет. При этом каждому уровню соответствует одна группировка.
Запрос к методу drilldown возвращает один подуровень для указанного родительского уровня. Родительский уровень указывается в параметре parent_id. Чтобы получить данные для первого уровня, отправьте запрос без параметра parent_id.
Чтобы получить данные для вложенных уровней, необходимо указать путь от корня. Путь формируется из значений поля id параметра dimension. Если поле id отсутствует, укажите поле name.
Посмотрите как используется данный запрос в примере.
Request
GET
https://api.appmetrica.yandex.net/stat/v1/data/drilldown
Query parameters
|
Name |
Description |
|
params |
Type: DrillDownParams Example: `` |
|
statGroupParams |
Type: StatGroupParams Example: `` |
DrillDownParams
|
Name |
Description |
|
access_filter_id |
Type: integer |
|
accuracy |
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: |
|
ids |
Type: integer[] Example
|
|
include_meta |
Type: boolean |
|
include_undefined |
Type: boolean |
|
lang |
Type: string Example: |
|
limit |
Type: string Default: |
|
max_deviation |
Type: string Default: |
|
metrics |
Type: string Example: |
|
offset |
Type: string Default: |
|
only_expandable_undefined |
Type: boolean |
|
parent_id |
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: |
|
sort |
Type: string Example: |
|
timezone |
Type: string Example: |
|
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,
"callback": "example",
"date_dimension": "example",
"sort": "example",
"limit": "100",
"offset": "1",
"parent_id": [
"example"
],
"only_expandable_undefined": true
}
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",
"limit": 0,
"offset": 0
},
"data": [
{
"dimension": {},
"metrics": [
0.5
],
"expand": true
}
],
"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
],
"min": [
0.5
],
"max": [
0.5
]
}
|
Name |
Description |
|
contains_sensitive_data |
Type: boolean Признак возможного отсутствия конфиденциальных данных в ответе. К ним относятся данные, которые рассчитываются алгоритмами Яндекса, например, социально-демографические (пол, возраст и др.), адреса страниц входа, поисковые фразы, информация о роботах. При значении |
|
data |
Type: DrillDownRow[] Example
|
|
data_lag |
Type: integer Задержка в обновлении данных, в секундах. |
|
max |
Type: number[] Example
|
|
min |
Type: number[] Example
|
|
query |
Type: QueryExternal Исходный запрос. Содержит параметры запроса, включая развернутые параметры из шаблона и параметры для схемы параметризации атрибутов. Example
|
|
sample_share |
Type: number Доля данных, по которым осуществлялся расчет. Доступно значение в пределах от 0 до 1. |
|
sample_size |
Type: integer Количество строк в выборке данных. |
|
sample_space |
Type: integer Количество строк данных. |
|
sampled |
Type: boolean Признак семплирования. Показывает, был ли применен семплинг. Возможные значения: |
|
total_rows |
Type: integer Общее количество строк в ответе по всему множеству данных (с учетом фильтра). |
|
total_rows_rounded |
Type: boolean Признак того, что общее количество строк было округлено. |
|
totals |
Type: number[] Example
|
QueryExternal
Исходный запрос. Содержит параметры запроса, включая развернутые параметры из шаблона и параметры для схемы параметризации атрибутов.
|
Name |
Description |
|
date1 |
Type: string Дата начала периода выборки в формате YYYY-MM-DD. Example: |
|
date2 |
Type: string Дата окончания периода выборки в формате YYYY-MM-DD. Example: |
|
dimensions |
Type: string[] Example
|
|
filters |
Type: string Фильтр сегментации. Example: |
|
limit |
Type: integer Количество элементов на странице выдачи. |
|
metrics |
Type: string[] Example
|
|
offset |
Type: integer Индекс первой строки выборки, начиная с 1. |
|
preset |
Type: string Пресет отчета. Example: |
|
sort |
Type: string[] Example
|
|
timezone |
Type: string Часовой пояс периода выборки в формате ±hh:mm. Example: |
Example
{
"timezone": "example",
"preset": "example",
"dimensions": [
"example"
],
"metrics": [
"example"
],
"sort": [
"example"
],
"date1": "example",
"date2": "example",
"filters": "example",
"limit": 0,
"offset": 0
}
DrillDownRow
Строки ответа. Представляет собой массив, каждый элемент которого — одна строка результата.
|
Name |
Description |
||
|
dimension |
Type: object
Значение группировки для заданного уровня дерева. Например, задан второй уровень дерева (длина переданного массива Example
|
||
|
expand |
Type: boolean Указывает можно ли раскрыть эту строку на следующий уровень дерева. |
||
|
metrics |
Type: number[] Example
|
Example
{
"dimension": {},
"metrics": [
0.5
],
"expand": true
}