Аналитика · Чтение
Аналитика · Запрос
analytics_query
Попробуйте три запроса
Получить данные
- Вы указываетеСтрока поиска
- ПомощникЧтение
- Вы получаетеПоля ответа
Запрос в чат
Для задачи «Аналитика / Запрос» выполни чтение по выбранной записи (строка поиска). Выведи кратко: результат.
- result
- Результат
Задать параметры
- Вы указываетеСтрока поиска
- ПомощникСверка выбора
- Вы получаетеТочный объект
Запрос в чат
Покажи, как получить «Аналитика / Запрос» на учебном примере с granularity = none. Объясни, какие ещё данные нужны и как будет выглядеть ответ.
- granularity
- none
Разобрать ответ
- Вы указываетеПолученный ответ
- ПомощникРазбор значений
- Вы получаетеКраткое пояснение
Запрос в чат
На основании уже полученного ответа «Аналитика / Запрос» объясни результат. Отметь отсутствующие значения.
- result
- Результат
Как работает действие
Это чтение. Выберите запись или задайте фильтры в доступной компании.
Описание разработчика
Calculate canonical analytics totals, period/year comparisons and real time series. Reuses metrics_get definitions, native scope, source coverage and currencies. No synthetic data.
Параметры запроса
- query
- Поисковое выражение для этой операции. обязательно по схеме · object
- granularity
- Optional native time buckets; at most 62 per request. обязательно по схеме · string · по умолчанию "none" · варианты none, day, week, month
Что вернёт команда
- result
- Authorized Analytics result. Unknown source data is explicit and never replaced with zero. обязательно по схеме
Поля и технические схемы

Вход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"query": {
"type": "object",
"properties": {
"metrics": {
"minItems": 1,
"maxItems": 20,
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"maxLength": 100,
"pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$"
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"maxLength": 100,
"pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$",
"description": "Canonical metric ID from the typed server registry."
},
"filters": {
"description": "Per-metric typed filters. Overrides the request-level filters for this selection.",
"type": "object",
"properties": {
"productIds": {
"$ref": "#/$defs/_mcp0"
},
"locationId": {
"$ref": "#/$defs/_mcp1"
},
"accountIds": {
"$ref": "#/$defs/_mcp2"
},
"campaignId": {
"$ref": "#/$defs/_mcp3"
},
"employeeId": {
"$ref": "#/$defs/_mcp4"
},
"pointOfSaleId": {
"description": "Exact native establishment filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"clientId": {
"description": "Exact native customer filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"pipelineId": {
"description": "Exact native lead pipeline filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"stageId": {
"description": "Exact native lead stage filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"status": {
"$ref": "#/$defs/_mcp5"
},
"channel": {
"$ref": "#/$defs/_mcp6"
},
"source": {
"description": "Exact native lead source filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"resourceId": {
"$ref": "#/$defs/_mcp7"
},
"productId": {
"description": "Exact native product ID filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"categoryId": {
"description": "Exact native category ID filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
}
},
"additionalProperties": false
},
"groupBy": {
"description": "Supported native dimension. No arbitrary field names or client-side aggregation.",
"type": "string",
"enum": [
"account",
"currency",
"product",
"employee",
"pointOfSale",
"status",
"channel",
"source",
"pipeline",
"stage",
"resource"
]
}
},
"required": [
"id"
],
"additionalProperties": false
}
]
},
"description": "Distinct canonical metric IDs, optionally with per-metric filters. Metrics sharing a native handler and filters run together."
},
"filters": {
"description": "Default filters for each selection without its own filters. Every supplied filter must be supported by that metric.",
"type": "object",
"properties": {
"productIds": {
"$ref": "#/$defs/_mcp0"
},
"locationId": {
"$ref": "#/$defs/_mcp1"
},
"accountIds": {
"$ref": "#/$defs/_mcp2"
},
"campaignId": {
"$ref": "#/$defs/_mcp3"
},
"employeeId": {
"$ref": "#/$defs/_mcp4"
},
"pointOfSaleId": {
"description": "Exact native establishment filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"clientId": {
"description": "Exact native customer filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"pipelineId": {
"description": "Exact native lead pipeline filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"stageId": {
"description": "Exact native lead stage filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"status": {
"$ref": "#/$defs/_mcp5"
},
"channel": {
"$ref": "#/$defs/_mcp6"
},
"source": {
"description": "Exact native lead source filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"resourceId": {
"$ref": "#/$defs/_mcp7"
},
"productId": {
"description": "Exact native product ID filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"categoryId": {
"description": "Exact native category ID filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
}
},
"additionalProperties": false
},
"period": {
"description": "Explicit reporting period; short calendar presets are supported. Custom from is inclusive and to exclusive.",
"anyOf": [
{
"type": "object",
"properties": {
"preset": {
"type": "string",
"enum": [
"today",
"yesterday",
"this_week",
"last_week",
"last_7_days",
"last_30_days",
"this_month",
"last_month",
"this_quarter",
"last_quarter",
"this_year",
"last_year",
"custom",
"all_time"
],
"description": "Explicit calendar period. Weeks start Monday; last_7_days/last_30_days include today. Current periods include the complete current calendar unit. all_time is never implicit and is available only for metrics that support it."
},
"from": {
"description": "For custom only: inclusive local calendar date YYYY-MM-DD in the server-resolved reporting timezone.",
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"to": {
"description": "For custom only: exclusive local calendar date YYYY-MM-DD in the server-resolved reporting timezone.",
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"start": {
"description": "Custom inclusive start date; alias of from. Supply start/end together, without from/to.",
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"end": {
"description": "Custom exclusive end date; alias of to. Supply start/end together, without from/to.",
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
}
},
"required": [
"preset"
],
"additionalProperties": false
},
{
"type": "string",
"enum": [
"today",
"yesterday",
"week",
"month",
"quarter",
"year",
"all_time"
]
}
]
},
"compare": {
"description": "Shortcut for previous_period comparison; cannot contradict comparison.",
"type": "boolean"
},
"comparison": {
"default": "none",
"description": "Server-resolved comparison for period metrics only. Snapshot values in a mixed query have no comparison.",
"type": "string",
"enum": [
"none",
"previous_period",
"previous_year"
]
},
"calendarLocationId": {
"description": "Optional authorized establishment whose configured timezone sets operational and attendance calendar boundaries. This selects the reporting clock, not a data filter. When omitted, company establishments must have one consistent valid timezone. Advertising retains its native UTC provider-day calendar.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"reportingTimezone": {
"description": "Explicit IANA calendar for operational and attendance period reporting. Changes the reporting clock, never company or location authorization. Omit to use the configured establishment calendar. Cannot be combined with calendarLocationId. Advertising retains its UTC provider-day calendar.",
"type": "string",
"maxLength": 100
},
"includeDefinitions": {
"default": false,
"description": "Include the precise business definitions and supported filters/periods/dimensions of the requested authorized metrics alongside their values. The complete registry is never returned implicitly.",
"type": "boolean"
}
},
"required": [
"metrics",
"comparison",
"includeDefinitions"
],
"additionalProperties": false,
"description": "Canonical metric query."
},
"granularity": {
"default": "none",
"description": "Optional native time buckets; at most 62 per request.",
"type": "string",
"enum": [
"none",
"day",
"week",
"month"
]
}
},
"required": [
"query",
"granularity"
],
"additionalProperties": false,
"$defs": {
"_mcp0": {
"description": "Existing product IDs for inventory quantities, in their native units.",
"minItems": 1,
"maxItems": 50,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
}
},
"_mcp1": {
"description": "Inventory establishment ID. This actually filters stock; it is not a timezone selector.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"_mcp2": {
"description": "Existing financial account IDs. Balances remain separate for every account and currency.",
"minItems": 1,
"maxItems": 50,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
}
},
"_mcp3": {
"description": "Existing advertising campaign ID, or omit for the native company advertising summary.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"_mcp4": {
"description": "Existing employee ID for attendance metrics.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"_mcp5": {
"description": "Exact current normalized native status filter.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"_mcp6": {
"description": "Exact source channel or integration ID.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
},
"_mcp7": {
"description": "Existing table/resource identifier where supported.",
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$"
}
}
}Выход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"result": {
"description": "Authorized Analytics result. Unknown source data is explicit and never replaced with zero."
}
},
"required": [
"result"
],
"additionalProperties": false
}