# Instagram 话题搜索 API (instagram.hashtag_search)

- Canonical page: [https://everyinfra.com/instagram-api/hashtag_search](https://everyinfra.com/instagram-api/hashtag_search?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "instagram", "action": "hashtag_search", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, one page of 15 per target, no next_page_token (to read further, page one target at a time with the single-target action; limit is ignored)
- 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=hashtag_search

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 要搜的词，如 coffee，一次一个词，带不带 # 都行。返回 Instagram 搜索框对这个词给出的话题和各自的帖子数，一次几个到 15 个左右，没有下一页。要某个话题下的帖子用 hashtag。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| rank | 名次，从 1 开始，是这一行在这次结果里的顺序。user_search：先是 Instagram 搜索框给的账号（matched_by 为 search_box），按搜索框的顺序；后面是用这个关键词搜到的帖子的作者，用来补足条数（matched_by 为 post_author）；没有 matched_by 的结果是 Instagram 给这个关键词排的账号位置。similar_profiles：相似账号的名次，按粉丝数从多到少。likers：点赞名单里的顺序。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| post_count | 发布内容总数。null 表示不公开，不等于 0。 |
| post_count_label | Instagram 页面上写的帖子数，原样给出，如 2.2K posts、1.2M posts。 |
| url | 该记录在原平台上的可访问链接。 |
| 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": "hashtag_search",
  "params": {
    "keyword": "coffee"
  }
}'
```

```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": "hashtag_search",
        "params": {
            "keyword": "coffee",
        },
    },
    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; the list keeps the first 2 of 5. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "instagram",
  "action": "hashtag_search",
  "results": [
    {
      "rank": 1,
      "name": "coffeecoffeecoffee",
      "id": "•••",
      "post_count": 1277620,
      "post_count_label": "1.2M posts",
      "url": "https://www.instagram.com/explore/tags/coffeecoffeecoffee/",
      "platform": "instagram"
    },
    {
      "rank": 2,
      "name": "coffeephotography",
      "id": "•••",
      "post_count": 1211660,
      "post_count_label": "1.2M posts",
      "url": "https://www.instagram.com/explore/tags/coffeephotography/",
      "platform": "instagram"
    }
  ],
  "count": 5,
  "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
