# Telegram 消息的评论 API (telegram.post_comments)

- Canonical page: [https://everyinfra.com/telegram-api/post_comments](https://everyinfra.com/telegram-api/post_comments?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "telegram", "action": "post_comments", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 50, max 100 per call (larger values are capped)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=telegram&action=post_comments

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 一条公开频道消息的链接，形如 https://t.me/<频道名>/<消息编号>（t.me/s/ 开头也认）；返回这条消息下面的评论（频道讨论群里对它的回复）。邀请链接（t.me/+…）不认。消息没开评论或评论不公开时返回 200 和空结果，empty_reason 为 comments_closed；频道或消息不存在返回空结果。都不扣费。 |
| page_token | not declared | no | not declared | 翻页令牌：把上一次响应里的 next_page_token 原样传回，拿下一页，其他参数和第一页一样；不传从第一页开始。每页算一次调用；没有 next_page_token 就是最后一页。能一直翻到最早的一条评论。 |
| limit | integer (1–100) | no | 50 | 正整数（≥1），本次最多返回的条数：不传则返回本次取到的全部结果，传了只把结果截短到这个条数以内，不会多取，也不会变多。扣费不受 `limit` 影响。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| post_id | 这条评论所在的频道消息的编号（post_comments），即 t.me/<频道名>/<编号> 里的编号。 |
| post_url | 这条评论所在的频道消息的链接（post_comments）。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_name | 作者昵称（显示名）。 |
| author_url | 作者在原平台的主页链接。 |
| author_avatar_url | 评论人的头像图片地址（post_comments）；没有头像时没有这个字段。 |
| text_html | 正文的 HTML 版本，保留链接和格式（post_comments、search_in_channel）。 |
| media_type | 媒体类型（照片/视频/文件/语音）；post_comments、search_in_channel 里多张图或视频的相册是 album，纯文字的没有这个字段。 |
| image_urls | 图片链接数组，按平台展示顺序；没有图片时不出现这个字段。 |
| video_url | 视频文件地址（post_comments、search_in_channel），带签名、会过期；没有视频时没有这个字段。 |
| media | 消息里的每个图片、视频（post_comments、search_in_channel）：[{type, url, id, width, height, thumbnail_url, duration_sec}]，各项有值才出现；地址会过期。 |
| reactions | 表情回应及各自数量；post_comments、search_in_channel 里每项是 {emoji, emoji_id, count, is_paid}，自定义表情没有 emoji、给 emoji_id。 |
| reaction_count | 表情回应的总数（post_comments、search_in_channel）。 |
| reaction_count_estimated | reaction_count 是不是约数：Telegram 页面上显示成 9.37K 这种写法时为 true（post_comments、search_in_channel）。 |
| links | 正文里的链接，按出现顺序（post_comments、search_in_channel）；没有时没有这个字段。 |
| reply_to_id | 被回复的那条消息或评论的编号（post_comments、search_in_channel）；Telegram 没给时没有这个字段。 |
| reply_to_name | 被回复的人的名字（post_comments、search_in_channel）。 |
| reply_to_text | 被回复的那条的正文，Telegram 页面上引用显示的那段（post_comments、search_in_channel）。 |
| post_comment_count | 这条频道消息的评论总数（post_comments），同一次响应里每行相同。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
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"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "telegram",
        "action": "post_comments",
        "params": {
            "url": "https://t.me/contest/198",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "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": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=telegram
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
