# Telegram 内容详情 API (telegram.post_detail)

- Canonical page: https://everyinfra.com/telegram-api/post_detail
- Endpoint: POST /api/v1/social with {"platform": "telegram", "action": "post_detail", "params": {...}}
- Price: $0.000806 per call ($0.81 per 1,000 requests); failed and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

Telegram 内容详情按 `url` 收一个公开的 t.me 链接，返回单个对象，带一条帖子的正文、浏览数、发布时间、所在频道的用户名、媒体类型和链接、发送者、被回复消息的链接和表情回应，`forwarded_from` 记着转发来源。它回答「给一个 t.me 链接，能读到一条什么样的帖子」，适合手里只有链接、还没整理出频道用户名的场合。

链接里带了消息编号也只取频道名，不会变成单条消息查询，示例 https://t.me/durov/520 里的 520 不起作用。读到的是不是链接里那一条，拿返回的 `url` 和传入的链接比一下就知道。要成批读一个频道的帖子，用频道帖子那一页，那里多一个频道名称字段，单次最多 200 条。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 公开 t.me 链接的兼容输入；若含消息编号，只取频道名，不会变成单条消息查询。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| channel_username | 频道用户名（@开头的公开标识）。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| view_count | 浏览/播放数。null 表示不公开，不等于 0。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| media_type | 媒体类型（照片/视频/文件/语音）。 |
| media_url | 媒体文件链接。 |
| author | 消息发送者。 |
| is_forwarded | 该消息是否为转发。 |
| forwarded_from | 转发来源。追溯信息传播链用。 |
| reply_to_url | 被回复消息的链接。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| link_preview_url | platform-native meaning |
| reactions | 表情回应及各自数量。 |

## 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_detail",
  "params": {
    "url": "https://t.me/durov/520"
  }
}'
```

```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_detail",
        "params": {
            "url": "https://t.me/durov/520",
        },
    },
    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_detail",
  "results": {
    "id": …,
    "url": …,
    "channel_username": …,
    "text": …,
    "view_count": …,
    "posted_at": …,
    "media_type": …,
    "media_url": …,
    "author": …,
    "is_forwarded": …,
    "forwarded_from": …,
    "reply_to_url": …,
    "platform": …,
    "link_preview_url": …,
    "reactions": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `url` 要怎么写？

填公开频道或群组的 t.me 链接，可以是 t.me/<用户名>，也可以是 t.me/<用户名>/<消息编号> 这种消息链接。后一种写法这里只取用户名，编号会被忽略，不会按编号读那一条消息。

### 怎么读到某一条指定的消息？

这一项做不到按编号读单条消息。可以用频道帖子读这个频道，在返回的帖子里按 `url` 找那一条，前提是它在这次返回的范围内；频道帖子单次最多 200 条。

### 私有频道里的消息能读吗？

不能保证。`url` 收的是公开 t.me 链接，私有频道不在保证范围内。为 null 的 `view_count` 表示不公开，不等于 0；`reactions` 能否读到，也以返回为准。

## 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
