# Telegram 个人号、机器人资料 API (telegram.user_profile)

- Canonical page: [https://everyinfra.com/telegram-api/user_profile](https://everyinfra.com/telegram-api/user_profile?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "telegram", "action": "user_profile", "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

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | 个人号或机器人的用户名（如 BotFather，可带 @），或 t.me/<用户名> 链接。用户名不存在返回 200 和空结果，empty_reason 为 account_not_found；给的是频道或群，empty_reason 为 not_a_user（频道用 profile，群用 group）。都不扣费。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| username | 用户名（@handle）。 |
| url | 该记录在原平台上的可访问链接。 |
| type | 记录类型，取值随能力而定（如 video / image / text）。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| bio | 个人简介，账号自己填写的文本。可能含换行和 emoji。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| is_verified | 账号是否已认证。 |
| bio_links | 简介里的链接（channels_batch、user_profile）。 |
| is_scam | **Telegram 官方标记为诈骗账号**。为 true 时内容不可信。 |
| is_fake | **官方标记为冒充账号**（假冒知名主体）。 |
| monthly_user_count | 机器人的月用户数，Telegram 页面上显示的数（user_profile）；个人号没有这个字段。 |
| 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": "user_profile",
  "params": {
    "username": "BotFather"
  }
}'
```

```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": "user_profile",
        "params": {
            "username": "BotFather",
        },
    },
    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": "user_profile",
  "results": {
    "username": …,
    "url": …,
    "type": …,
    "name": …,
    "bio": …,
    "avatar_url": …,
    "is_verified": …,
    "bio_links": …,
    "is_scam": …,
    "is_fake": …,
    "monthly_user_count": …,
    "platform": …
  },
  "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
