# Instagram 按编号查账号 API (instagram.profile_by_id)

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| user_id | not declared | yes | not declared | Instagram 账号的数字编号，如 787132；profile 结果里的 user_id、帖子结果里的 author_id 都是它。账号改了用户名，编号不变。返回这个账号现在的用户名和主页资料，不含最近帖子和精选数。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| username | 用户名（@handle）。 |
| display_name | 显示名，可能与 username 不同。 |
| bio | 个人简介，账号自己填写的文本。可能含换行和 emoji。 |
| follower_count | 粉丝数。null 表示不公开，不等于 0。 |
| following_count | 关注数。null 表示不公开，不等于 0。 |
| post_count | 发布内容总数。null 表示不公开，不等于 0。 |
| is_private | 是否私密账号。 |
| is_verified | 是否为平台认证账号（蓝V等）。null 表示无法判定。 |
| is_business | 是否为商家账号。 |
| is_professional | 是否为专业账号（商家或创作者）。 |
| category | 分类名称，取值为原平台的分类体系，未做跨平台归一。 |
| external_url | 主页外链。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| user_id | 用户在原平台的唯一 ID。 |
| avatar_hd_url | 高清头像链接（avatar_url 是小图）。 |
| external_urls | 简介里的全部外链：url、title（external_url 只是第一个）。 |
| has_reels | 是否发过 Reels。 |
| url | 该记录在原平台上的可访问链接。 |
| reels_count | 这个账号发过的 Reels 条数（整数）。 |
| business_email | 商家账号在主页「联系」（Contact）按钮里公开的邮箱。没有时不出现。 |
| business_phone | 商家账号在主页「联系」（Contact）按钮里公开的电话。没有时不出现。 |
| threads_username | 主页上 Threads 徽章显示的名字，一般就是这个人的 Threads 用户名。 |
| fbid | Meta 给这个账号的另一个数字编号，和 user_id 不是同一个数。 |
| is_memorialized | 是纪念账号（本人去世后 Instagram 设成的纪念状态）。只在是纪念账号时出现，值为 true。 |
| is_joined_recently | 主页上标着「最近加入」（Joined recently）。只在有这个标记时出现，值为 true。 |
| account_type | 账号类型：personal 个人、business 商家、creator 创作者。 |
| emails | 联系邮箱列表（一条记录可能有多个），原文透传、去重。 |
| phones | 本人公开写在简介里的电话号码，数组。只收以 + 或 00 开头的号码，或者前面写明 WhatsApp、电话这类字样的号码。没有时不出现。 |
| pronouns | 主页上填写的人称代词，数组。 |
| bio_links_detail | 简介区的每个链接，一个链接一项：url（真实地址，已去掉 Instagram 包的那层跳转）、title（链接标题，有的才带）、type（Instagram 给的链接类型，如 external）。external_urls 是同一批链接的 url 和 title。 |
| messaging_ids | 简介里公开写的聊天账号，一个账号一项 {app, id}；app 如 wechat、line、telegram、kakao、skype、signal。 |
| business_address | 商家账号公开的地址，对象：street、city、zip、lat、lng，有的才带。 |
| 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": "instagram",
  "action": "profile_by_id",
  "params": {
    "user_id": "787132"
  }
}'
```

```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": "instagram",
        "action": "profile_by_id",
        "params": {
            "user_id": "787132",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-21T07:18:47Z. `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": "instagram",
  "action": "profile_by_id",
  "results": {
    "username": "n•••o",
    "display_name": "N•••c",
    "bio": "Step into wonder and find your inner explorer with National Geographic 🌎",
    "follower_count": 268002941,
    "following_count": 195,
    "post_count": 32196,
    "is_private": false,
    "is_verified": true,
    "is_business": true,
    "is_professional": true,
    "external_url": "http://visitstore.bio/natgeo",
    "avatar_url": "https://scontent-fra5-1.cdninstagram.com/•••",
    "user_id": "787132",
    "avatar_hd_url": "https://scontent-fra5-1.cdninstagram.com/•••",
    "external_urls": [
      {
        "url": "http://visitstore.bio/natgeo"
      },
      {
        "url": "https://ngmdomsubs.nationalgeographic.com/servlet/OrdersGateway?cds_mag_code=NGM&cds_page_id=283562&cds_response_key=I5FX10002",
        "title": "Subscribe Here!"
      }
    ],
    "has_reels": true,
    "url": "https://www.instagram.com/natgeo/",
    "reels_count": 1,
    "threads_username": "n•••o",
    "fbid": "•••",
    "account_type": "business",
    "bio_links_detail": [
      {
        "url": "http://visitstore.bio/natgeo",
        "type": "external"
      },
      {
        "url": "https://ngmdomsubs.nationalgeographic.com/servlet/OrdersGateway?cds_mag_code=NGM&cds_page_id=283562&cds_response_key=I5FX10002",
        "title": "Subscribe Here!",
        "type": "external"
      }
    ],
    "platform": "instagram"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

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