Telegram comments API
The comments under a channel post, from its discussion group, 50 a page, with each commenter’s name and username, the text and the comment it replies to.
GET /v1/telegram/posts/comments1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/telegram/posts/comments?url=https://t.me/binance_announcements/9155",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "post": { "chat_username": "binance_announcements", "message_id": 9155, "url": "https://t.me/binance_announcements/9155" }, "comment_count": 69, "comments": [ { "message_id": 20310488, "chat": { "id": null, "type": "channel", "username": null, "title": null }, "date": 1795187036, "date_iso": "2026-11-20T15:03:56.000Z", "is_edited": false, "author_signature": null, "from": { "name": null, "username": null, "photo_url": null }, "text": "#support", "text_html": "#support", "links": [], "hashtags": [], "views": null, "reactions": [], "forward_origin": null, "reply_to_message": { "message_id": 20310464, "chat_username": null, "author": null, "text": "Withdrawal problem", "url": null }, "media": [], "poll": null, "link_preview": null, "is_service": false, "url": "https://t.me/binance_announcements/9155?comment=20310488" }, { "message_id": 20310624, "chat": { "id": null, "type": "channel", "username": null, "title": null }, "date": 1795191823, "date_iso": "2026-11-20T16:23:43.000Z", "is_edited": false, "author_signature": null, "from": { "name": null, "username": null, "photo_url": null }, "text": "Hi", "text_html": "Hi", "links": [], "hashtags": [], "views": null, "reactions": [], "forward_origin": null, "reply_to_message": null, "media": [], "poll": null, "link_preview": null, "is_service": false, "url": "https://t.me/binance_announcements/9155?comment=20310624" }, "… 48 more" ], "pagination": { "next_cursor": "eyJwIjoiYmluYW5jZV9hbm5vdW5jZW1lbnRzLzkxNTUiLCJiIjoyMDMxMDQ4OH0", "has_more": true }}Parameters
| Name | Type | Description |
|---|---|---|
urlquery · required | string | A public post link, https://t.me/<channel>/<id> (or <channel>/<id>). Example: https://t.me/durov/552. |
sincequery | string | Only comments on or after this date. |
untilquery | string | Only comments on or before this date. |
afterquery | string | Cursor: the previous page’s pagination.next_cursor. |
Response fields
200 with a TelegramCommentsResponse, in the shape of the Telegram Bot API’s Chat and Message objects.
| Field | Type | Description |
|---|---|---|
post | object | |
comment_count | integer | null | All comments on the post. |
comments | TelegramMessage[] | Oldest first within the page; pages go back in time. |
pagination | TelegramPaginationolderComments |
Status codes
| Status | Meaning |
|---|---|
200 | A page of comments. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | No public Telegram chat or post by that name. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Telegram is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
What if the channel has no comments?
A post without a discussion group answers an empty list.
Telegram is a trademark of Telegram FZ-LLC. We are not affiliated with or endorsed by Telegram.