# Telegram 群组资料 API (telegram.group)

- Canonical page: [https://everyinfra.com/telegram-api/group](https://everyinfra.com/telegram-api/group?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "telegram", "action": "group", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

Telegram 群组资料按 `username` 读一个公开频道或群的资料：标题、简介、成员数 `member_count`、当前在线人数 `online_count`、创建时间，以及是否话题式论坛群、是否被限制、是否被标为诈骗或冒充。它回答「这个群有多大、活不活跃、可不可信」，适合加群或合作之前做筛查。

`username` 的写法和频道帖子一样，不支持私密邀请链接。要看群里有哪些成员，用成员列表那一页，群组资料只给群本身的信息。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | 公开频道或群的用户名，可为 name、@name、t.me/name 或 t.me/s/name。channel_posts/profile 用于公开频道，group 读取公开实体信息，members 读取可见群成员；不支持私密邀请链接，也不承诺完整成员名单。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| type | 记录类型，取值随能力而定（如 video / image / text）。 |
| username | 用户名（@handle）。 |
| url | 该记录在原平台上的可访问链接。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| description | 简介或描述，通常比 text 短。 |
| member_count | 成员数。 |
| online_count | 当前在线人数。群活跃度的直接指标。 |
| created_at | 创建时间，格式同 posted_at。 |
| is_verified | 账号是否已认证。 |
| is_scam | **Telegram 官方标记为诈骗账号**。为 true 时内容不可信。 |
| is_fake | **官方标记为冒充账号**（假冒知名主体）。 |
| is_forum | 是否为话题式论坛群。 |
| is_restricted | 账号是否被限制。 |
| admin_bots | 频道内的管理机器人。 |
| 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": "group",
  "params": {
    "username": "DatascienceChats"
  }
}'
```

```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": "group",
        "params": {
            "username": "DatascienceChats",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "telegram",
  "action": "group",
  "results": {
    "id": 1296260008,
    "type": "supergroup",
    "username": "DatascienceChats",
    "url": "https://t.me/DatascienceChats",
    "title": "Data Science,ML & AI Nugget Chats",
    "description": "Discussion community for DS, ML, IOT, AI, DEEP LEARNING and much more from Main Channel @••• and discuss @DatascienceChats",
    "member_count": 13450,
    "online_count": 292,
    "admin_bots": [
      {
        "username": "•••",
        "name": "Rose"
      },
      {
        "username": "•••",
        "name": "DeleteEvents Bot"
      },
      {
        "username": "•••",
        "name": "Group Butler"
      }
    ],
    "platform": "telegram"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 加群之前怎么判断它可不可信？

先读 `is_scam` 和 `is_fake`：`is_scam` 为 true 是 Telegram 官方标记的诈骗账号，内容不可信；`is_fake` 为 true 是官方标记的冒充账号。`is_verified` 为真表示账号已认证。三个字段都为否，也只说明没有被标，不是对群的担保。

### `online_count` 能反映群的活跃度吗？

可以当活跃度的直接指标。把 `online_count` 和 `member_count` 放在一起看，才知道在线的是总人数的多大一块。

### `is_forum`、`is_restricted` 和 `admin_bots` 分别是什么？

`is_forum` 标出是否话题式论坛群，`is_restricted` 标出账号是否被限制，`admin_bots` 是频道内的管理机器人。这三项是群组资料独有的，成员列表那一页没有。

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