# Instagram 主页或对象详情 API (instagram.profile)

- Canonical page: https://everyinfra.com/instagram-api/profile
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "instagram", "action": "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

Instagram 主页详情按 `username` 读回一个账号当下公开展示的原始资料，计数、标记和链接都照平台给的值返回，不附任何评语。它回答「这个账号现在是什么状况」，常用来给账号建档、隔一段时间记一次粉丝涨跌，或者在达人报价时拿对方报的数字和当场读数对照。账号名写不带 @ 的 handle，或整条主页地址。

简介区的第一个链接单独放在 `external_url`；`highlight_count` 数精选快拍有几个，`has_reels` 只说明发没发过 Reels。建档时先存下 `user_id`，它是账号在原平台的唯一 ID，和别的能力返回的记录对上靠它。认证标记读到空值是平台没法判定，档案里记成第三种状态，别归进未认证。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | Instagram 账号 handle，建议不带 @ 或完整主页 URL。profile/persona/user_posts/reels 查询账号数据；followers 只查粉丝数量，followers_list/following_list 才查粉丝/关注账号列表。 |

## 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。 |
| highlight_count | 精选快拍（Highlights）个数。 |
| recent_posts | platform-native meaning |

## 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",
  "params": {
    "username": "nasa"
  }
}'
```

```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",
        "params": {
            "username": "nasa",
        },
    },
    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": "instagram",
  "action": "profile",
  "results": {
    "username": "nasa",
    "display_name": "NASA",
    "bio": "Making the seemingly impossible, possible. ✨",
    "follower_count": 104336090,
    "following_count": 89,
    "post_count": 4934,
    "is_private": false,
    "is_verified": true,
    "is_business": false,
    "is_professional": false,
    "external_url": "https://www.nasa.gov",
    "avatar_url": "https://scontent-mad1-1.cdninstagram.com/•••",
    "recent_posts": [
      {
        "post_id": "DdHyaYAifb6",
        "url": "https://www.instagram.com/p/DdHyaYAifb6",
        "text": "Cementing their names in history.\n\nThe Artemis III crew is leaving their mark — literally. The astronauts recently signed their names on the hardware that will be inside their Orion spacecraft during their low Earth orbit mission, launching in 2027.\n\nImage descriptions:\n\n1. The A…",
        "media_type": "image",
        "like_count": 0,
        "comment_count": 0,
        "view_count": 0,
        "author_username": "nasa",
        "posted_at": "2026-09-10T00:00:00+00:00"
      },
      {
        "post_id": "DdWyDLcGiqo",
        "url": "https://www.instagram.com/p/DdWyDLcGiqo",
        "text": "Southern Hemisphere Milky Way galaxy view from the @••• cupola. This 3s exposure series captured two of my favorite cupola views, the particularly dense Milky Way galaxy as seen from the Southern Hemisphere, and the bright, colorful lights of squid fishing boats (here, the brig…",
        "media_type": "image",
        "like_count": 0,
        "comment_count": 0,
        "view_count": 0,
        "author_username": "•••",
        "posted_at": "2026-09-16T00:00:00+00:00"
      },
      {
        "post_id": "DdT_4GMka0z",
        "url": "https://www.instagram.com/p/DdT_4GMka0z",
        "text": "In a class of their own\n\nHidden within this star-forming nebula (captured by our Webb telescope in one of its largest images to date) are strange objects called brown dwarfs. Generally less massive than stars and more massive than planets, they are neither. They form the same way…",
        "media_type": "image",
        "like_count": 0,
        "comment_count": 0,
        "view_count": 0,
        "author_username": "•••",
        "posted_at": "2026-09-15T00:00:00+00:00"
      }
    ]
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 只做存档和涨粉记录，需要换成账号画像吗？

不需要。两边回来的主页字段一模一样，画像只是外加模型写的行业归属、细分方向、真实性评语和概述。存档要的是平台原样给出的数，主页详情足够。核对报价也是这个道理：对方报的粉丝量和这里读到的数差得远，直接拿读数说话，截图日期和读取时刻一并记下。专业账号标记为真、商家标记为假的就是创作者号，分账号类型靠这两项即可；`category` 用的是 Instagram 自己的分类体系，没做跨平台归一，和别家平台的档案合并时单独放一列。

### 按期记录粉丝涨跌，快照里该存哪些值？

每次用同一个账号名读一遍，把粉丝、关注、发帖三项计数和读取时刻写成一行快照，两行相减就是这段时间的增减；发帖数的差值还能折算出这期间的更新频率。计数读到空值说明对方没公开，那一格留空，别记成零，否则下一期会算出一次凭空暴涨。精选快拍个数和 Reels 标记也值得每期记一笔，后者从假变真的那一期，就圈出了这个号开始发 Reels 的时间段；显示名 `display_name` 也记进快照，对方改名那一期就能看出来。隔多久读一次，按你关心的变化粒度定。

### 账号改了简介或外链，怎么从前后两期快照里看出来？

把 `bio` 和 `external_urls` 也放进快照，逐期比对。简介是账号自己写的，可能夹着换行和表情符号，先统一换行再比，免得误报。Instagram 简介里可以放多个链接，外链列表把每一个连同标题都列出来，`external_url` 只取第一个；看达人把粉丝引去哪里、哪天换了落地页，以完整列表为准。小头像链接可能过期，要留底就当场下载高清版 `avatar_hd_url`。最近的帖子在 `recent_posts` 里，入档前先拿一条真实返回看清结构。

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