Telegram Post comments API
API health
- 24h health
- Normal
- Healthy / normal
- Available
Last 24 hours
Last 30 days
Read the comments under one public Telegram channel message from its url, such as https://t.me/contest/198, newest first. Each comment has text, text_html, posted_at, the commenter's author_name, author_username and avatar, media, reactions, links and the comment it replied to; post_comment_count is the message's total. Up to 100 per page with next_page_token. Comments turned off returns comments_closed, not charged.
Send POST https://api.everyinfra.com/api/v1/social with platform set to telegram and action set to post_comments. Price $0.56 per 1,000 requests ($0.000556 per call). Failed calls and empty results are not charged. Synchronous. For slow jobs add "mode": "async" to the body, take the job_id and poll.
AI prompt
#Please help me write a data collection script with the EveryInfra Telegram Post comments endpoint (telegram/post_comments).
How the endpoint works:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to telegram and action to post_comments, and put the parameters inside params.
- Required parameters:
- url: Link to one public channel message, https://t.me/<channel>/<message ID> (t.me/s/ links work too); the call returns the comments under it.
- Optional parameters:
- page_token: Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged.
- limit: The most rows to return in this call, an integer from 1 to 100. The default applies when you leave it out, and a call can return fewer rows. Larger values are accepted and capped at the maximum. (default: 50)
- Returns a list of records. Main fields of each record: id, post_id (Number of the channel message the comme…), post_url (Link to the channel message the comment…), url, text, posted_at, author_username, author_name, author_url, author_avatar_url (Link to the commenter's avatar image (p…), text_html (The text as HTML, keeping its links and…), media_type (Media type (photo / video / file / voic…); 23 fields in total, full list at https://api.everyinfra.com/api/v1/social/catalog?platform=telegram.
- Example request body:
{
"platform": "telegram",
"action": "post_comments",
"params": {
"url": "https://t.me/contest/198"
}
}
- Price: $0.56 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.
Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.Request parameters
#| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
Authorization | header | string | Yes | - | Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository. |
platform | body | string | Yes | telegram | Platform identifier, fixed value. |
action | body | string | Yes | post_comments | Capability identifier, fixed value. |
url | body.params | string | Yes | - | Link to one public channel message, https://t.me/<channel>/<message ID> (t.me/s/ links work too); the call returns the comments under it. Invite links (t.me/+…) are not accepted, and a value in the wrong form is rejected (422) before you are charged. A message whose comments are turned off or not public returns 200 with an empty result and empty_reason set to comments_closed; a channel or message that does not exist returns an empty result. Neither is charged. |
page_token | body.params | string | No | - | Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged. Each page holds up to 100 comments (limit, default 50) and counts as one call; paging reaches all the way back to the first comment, and only a page without next_page_token is the last one. |
limit | body.params | integer (1–100) | No | 50 | The most rows to return in this call, an integer from 1 to 100. The default applies when you leave it out, and a call can return fewer rows. Larger values are accepted and capped at the maximum. |
Code samples
#curl -X POST 'https://api.everyinfra.com/api/v1/social' \
-H "Authorization: Bearer $EVERYINFRA_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"platform": "telegram",
"action": "post_comments",
"params": {
"url": "https://t.me/contest/198"
}
}'OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.
Response example
#{ "id": "req_…", "platform": "telegram", "action": "post_comments", "results": [ { "id": …, "post_id": …, "post_url": …, "url": …, "text": …, "posted_at": …, "author_username": …, "author_name": …, "author_url": …, "author_avatar_url": …, "text_html": …, "media_type": …, "image_urls": …, "video_url": …, "media": …, "reactions": …, "reaction_count": …, "reaction_count_estimated": …, "links": …, "reply_to_id": …, "reply_to_name": …, "reply_to_text": …, "post_comment_count": …, "platform": … } ], "next_page_token": …, "pagination": { … }, "count": …, "billing": { "charged": …, "charged_usd": …, "balance_after_usd": …, … }, "quota": { … }}
Response fields
#Business data is in results. The table lists the fields a record can contain. Values the platform does not show are never made up.
| Field | Meaning |
|---|---|
id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
post_id | Number of the channel message the comment is under (post_comments), the number in t.me/<channel>/<number>. |
post_url | Link to the channel message the comment is under (post_comments). |
url | Link to the record on the platform. |
text | Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so). |
posted_at | Publish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00). Non-standard strings from the platform are passed through as is, so parse defensively. null means the platform does not disclose it. |
author_username | Author's username (@handle), usually usable in URLs. |
author_name | Author's display name. |
author_url | Link to the author's profile on the platform. |
author_avatar_url | Link to the commenter's avatar image (post_comments); absent when there is none. |
text_html | The text as HTML, keeping its links and formatting (post_comments, search_in_channel). |
media_type | Media type (photo / video / file / voice); in post_comments and search_in_channel an album of several photos or videos is album, and text-only messages have no media_type. |
image_urls | Array of image links in the platform's display order; absent when there are no images. |
video_url | Link to the video file (post_comments, search_in_channel); signed and expires, absent when there is no video. |
media | Each photo or video in the message (post_comments, search_in_channel): [{type, url, id, width, height, thumbnail_url, duration_sec}], each only when it has a value; links expire. |
reactions | Emoji reactions with their counts; in post_comments and search_in_channel each is {emoji, emoji_id, count, is_paid}, and a custom emoji has emoji_id instead of emoji. |
reaction_count | Total number of emoji reactions (post_comments, search_in_channel). |
reaction_count_estimated | Whether reaction_count is a rounded figure: true when Telegram's page shows it in a form like 9.37K (post_comments, search_in_channel). |
links | Links in the text, in order of appearance (post_comments, search_in_channel); absent when there are none. |
reply_to_id | Number of the message or comment being replied to (post_comments, search_in_channel); absent when Telegram does not give it. |
reply_to_name | Name of the person being replied to (post_comments, search_in_channel). |
reply_to_text | Text of the message being replied to, as Telegram's page quotes it (post_comments, search_in_channel). |
post_comment_count | Total number of comments on the channel message (post_comments); the same on every row of a response. |
platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
Errors and billing
#- 401
- Missing or invalid key.
- 402
- Insufficient balance. Top up first.
- 422
- Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
- 429
- Per-minute request limit reached. Wait for Retry-After, then try again.
- 503
- Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
- 200 empty
- No data. No charge.