Sign in

Posts

Methods of the “MAX: posts” group. On the right — a request and response example for each.

Channel posts

GET/v1/max/channels/{channel}/posts/
1 unitfrom “API.Max Start”: posts are closed on Test

Posts of a public channel, newest first, in pages of up to 100 (50 by default); the next page link is in the next field. Filters: from and to — a period in Moscow time, inclusive; is_ad — advertising only (true) or without advertising (false). Available from the “API.Max Start” plan; a private channel returns 403 closed_channel, a group chat — 404 (we don’t collect chat messages), a deleted channel or one unavailable in MAX — 404.

Parameters

NameWhereDescription
channel required
string
pathChannel ID in datool.ru or public handle (with or without @)
cursor
string
queryNext page cursor — use the ready link from the next field
from
date
queryFrom this day (Moscow time)
is_ad
yes / no
queryOnly ads (true) or no ads (false)
limit
number
queryRows per page: 1–100, 50 by default
to
date
queryUp to and including this day (Moscow time)

Response fields

FieldTypeDescription
resultslistPosts on this page, newest first
results[].idnumberdatool.ru post number — used in /v1/max/posts/{id}/
results[].channelnumberChannel ID in datool.ru
results[].external_idnumberPost number in the MAX channel
results[].urlstring or nullPost link in MAX or null
results[].published_atdate and timePublication time (ISO 8601, Moscow time, +03:00)
results[].edited_atdate and time or nullWhen a text edit was noticed (ISO 8601, Moscow time) or null
results[].textstringPost text without markup (may be empty for a post with attachments only)
results[].viewsnumber or nullViews as of the last read, or null
results[].reactions_countnumber or nullTotal reactions, or null (not read yet)
results[].reactionsobjectReactions by emoji: {"👍": 12}
results[].is_adyes / noAdvertising post: has an erid label, an “Advertising” mark or an external link with a call to buy or follow (detected automatically)
results[].forwarded_fromobject or nullRepost source or null
results[].medialistAttachments in post order
results[].page_urlstringPost page on max.datool.ru
nextstring or nullNext page URL or null

Errors

CodecodeWhen
400field errorsAn invalid parameter or body field: the error comes under the field name, for example {"channels": ["Comma-separated channel numbers."]}.
401not_authenticated / authentication_failedNo key, the key is wrong or revoked, the member is suspended or the key’s organization is archived.
403tariff_requiredPosts are closed on “API.Max Test” — “API.Max Start” is required.
403closed_channelA private channel: the API returns only its card.
404not_foundThere is no object with this number or name, or you can’t see it.
404not_foundA group chat: chat messages are not collected.
429rate_limited / quota_exceeded / throttledToo 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.
503timeoutThe database query took longer than 5 seconds — retry later or narrow the selection.

Post

GET/v1/max/posts/{id}/
1 unitfrom “API.Max Start”: posts are closed on Test

A single post of a public channel by datool.ru number: text, publication and edit time, views, reactions by emoji, the advertising flag, the repost source and attachments. A post of a private, deleted or unavailable channel or of a group chat returns 404, as if it didn’t exist. Available from the “API.Max Start” plan.

Parameters

NameWhereDescription
id required
number
pathPost ID in datool.ru

Response fields

FieldTypeDescription
idnumberdatool.ru post number — used in /v1/max/posts/{id}/
channelnumberChannel ID in datool.ru
external_idnumberPost number in the MAX channel
urlstring or nullPost link in MAX or null
published_atdate and timePublication time (ISO 8601, Moscow time, +03:00)
edited_atdate and time or nullWhen a text edit was noticed (ISO 8601, Moscow time) or null
textstringPost text without markup (may be empty for a post with attachments only)
viewsnumber or nullViews as of the last read, or null
reactions_countnumber or nullTotal reactions, or null (not read yet)
reactionsobjectReactions by emoji: {"👍": 12}
is_adyes / noAdvertising post: has an erid label, an “Advertising” mark or an external link with a call to buy or follow (detected automatically)
forwarded_fromobject or nullRepost source or null
forwarded_from.titlestringSource name as provided by MAX
forwarded_from.linkstringSource link or empty
forwarded_from.channelnumber or nullChannel ID in datool.ru or null
medialistAttachments in post order
media[].kindstringimage, video, audio, file, link, poll, sticker, location, contact
media[].positionnumberAttachment position in the post, from 0
media[].widthnumber or nullImage or video width in pixels or null
media[].heightnumber or nullImage or video height in pixels or null
media[].durationnumber or nullVideo or audio duration in seconds, or null
media[].previewstring or nullPreview — our copy via the media.datool.ru CDN, or null (no copy)
page_urlstringPost page on max.datool.ru

Errors

CodecodeWhen
401not_authenticated / authentication_failedNo key, the key is wrong or revoked, the member is suspended or the key’s organization is archived.
403tariff_requiredPosts are closed on “API.Max Test” — “API.Max Start” is required.
404not_foundThere is no object with this number or name, or you can’t see it.
429rate_limited / quota_exceeded / throttledToo 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.
503timeoutThe 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”.

Was this page helpful?

You are leaving datool.ru

The link leads to an external website. datool.ru is not responsible for its content — check the address before entering passwords or payment details.

Redirecting in 10 s

Continue