Statistics
Methods of the “MAX: statistics” group. On the right — a request and response example for each.
Statistics by day
GET
/v1/max/stats/daily/1 unit“API.Max Test” — only the last 30 days
Daily channel statistics (days in Moscow time): subscribers at the end of the day, number of posts, views and reactions of that day’s posts, advertising posts. Up to 100 channels per request (comma-separated numbers in channels), a from–to period inclusive of up to 366 days (the last 30 by default), up to 10,000 “channels × days” rows. Rows are ordered by channel, then by day; channels that don’t exist or aren’t visible to you are listed in not_found. The “API.Max Test” plan gets only the last 30 days (earlier dates — 403 tariff_required).
Parameters
| Name | Where | Description |
|---|---|---|
channels requiredstring | query | Up to 100 comma-separated channel IDs |
fromdate | query | First day (YYYY-MM-DD); 30 days ago by default |
todate | query | Last day (YYYY-MM-DD); today by default |
Response fields
| Field | Type | Description |
|---|---|---|
results | list | “Channel × day” rows ordered by channel, then by day |
results[].channel | number | Channel ID in datool.ru |
results[].day | date | Day in Moscow time |
results[].subscribers | number or null | Subscribers at the end of the day; null — the channel was not polled that day |
results[].posts | number | Posts during the day |
results[].views | number | Views of this day’s posts |
results[].reactions | number | Reactions to this day’s posts |
results[].ad_posts | number | Ad posts during the day |
not_found | list | Requested IDs that do not exist or are not visible to the key |
Errors
| Code | code | When |
|---|---|---|
| 400 | field errors | An invalid parameter or body field: the error comes under the field name, for example {"channels": ["Comma-separated channel numbers."]}. |
| 401 | not_authenticated / authentication_failed | No key, the key is wrong or revoked, the member is suspended or the key’s organization is archived. |
| 403 | tariff_required | On “API.Max Test” — a date earlier than the last 30 days. |
| 429 | rate_limited / quota_exceeded / throttled | Too often (more requests per second than your plan allows) or the requests for the period have run out; how long to wait is in the Retry-After header. |
| 503 | timeout | The database query took longer than 5 seconds — retry later or narrow the selection. |
The error format, limit headers and what to do about each error are in the article “Errors”.