# YouTube 搜索联想词 API (youtube.search_suggest)

- Canonical page: [https://everyinfra.com/youtube-api/search_suggest](https://everyinfra.com/youtube-api/search_suggest?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "youtube", "action": "search_suggest", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list
- 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=youtube&action=search_suggest

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 在搜索框里输入的字，如 minecraft，最多 200 个字。 |
| country | not declared | no | not declared | 联想词的地区，两位国家代码，如 US、JP；不传是 US。 |
| language | not declared | no | not declared | 联想词的语言，语言代码，如 en、ja、zh-CN；不传是 en。 |
| limit | integer (1–) | no | not declared | 这次调用最多返回的条数，整数，至少为 1；不传按默认值，实际返回可能少于这个数。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| rank | 这一行在榜单或结果里的名次，从 1 开始；榜单口径（按什么排、统计多久）以能力说明为准。 |
| keyword | 一条联想词。 |
| 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": "youtube",
  "action": "search_suggest",
  "params": {
    "keyword": "minecraft"
  }
}'
```

```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": "youtube",
        "action": "search_suggest",
        "params": {
            "keyword": "minecraft",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-21T07:24:23Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 14. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "youtube",
  "action": "search_suggest",
  "results": [
    {
      "rank": 1,
      "keyword": "minecraft",
      "platform": "youtube"
    },
    {
      "rank": 2,
      "keyword": "minecraft music",
      "platform": "youtube"
    }
  ],
  "count": 14,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

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