<p class="crumbs"><a href="/zh/apis/">数据接口</a> / <a href="/zh/apis/xiaohongshu/">小红书</a></p>

# 蒲公英关键词关联词 API

用户搜这个词之前和之后还搜了什么：每个词的搜索指数，用来扩选题。

| 项目 | 值 |
| --- | --- |
| 地址 | `GET https://api.feedmcp.com/v1/xiaohongshu/pgy/keywords/related` |
| ID | `xiaohongshu.pgy.keywords.related` |
| 价格 | **$0.04** / 次 |
| 返回 | 一页 热榜条目对象列表 |
| 认证 | `Authorization: Bearer $FEEDMCP_API_KEY` |

> `label` 是「之前搜」或「之后搜」，`heat` 是搜索指数（0 或缺失时为 null）。

## 参数

| 参数 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `keyword` | string | 是 | 关键词 |

所有接口还支持 `view=full`：在返回里附上平台的原始数据（`raw`），价格不变。

## 返回字段

`data.items` 是一组「热榜条目」对象，所有平台字段相同：

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `rank` | number | 排名；0 表示置顶 |
| `platform` | string | 平台 |
| `keyword` | string | 热搜词 |
| `heat` | number \| null | 热度值（各平台口径不同） |
| `label` | string \| null | 标签，例如「置顶」「热」 |
| `url` | string \| null | 在平台上搜索这个词的链接 |

## 什么时候扣费

成功取到榜单一次 $0.04。榜单是空的（平台这次没答上来）、平台出错、超时都不收费，可以直接重试。

每次返回的 `meta.billing` 里写着这次扣了多少、还剩多少余额。

## 调用示例

### cURL

```bash
curl "https://api.feedmcp.com/v1/xiaohongshu/pgy/keywords/related?keyword=%E9%9C%B2%E8%90%A5" \
  -H "Authorization: Bearer $FEEDMCP_API_KEY"
```

### Python

```python
import os, requests

r = requests.get(
    "https://api.feedmcp.com/v1/xiaohongshu/pgy/keywords/related",
    params={"keyword": "露营"},
    headers={"Authorization": f"Bearer {os.environ['FEEDMCP_API_KEY']}"},
    timeout=30,
)
print(r.json())
```

### JavaScript

```js
const res = await fetch("https://api.feedmcp.com/v1/xiaohongshu/pgy/keywords/related?keyword=%E9%9C%B2%E8%90%A5", {
  headers: { Authorization: `Bearer ${process.env.FEEDMCP_API_KEY}` },
});
console.log(await res.json());
```

### MCP

在装好 FeedMCP 的 AI 里，调用 `call` 工具：

```json
{
  "endpoint": "xiaohongshu.pgy.keywords.related",
  "params": {
    "keyword": "露营"
  },
  "max_price": "0.04"
}
```

## 返回示例

示例数据是虚构的，格式和真实返回一致。

```json
{
  "code": "ok",
  "request_id": "req_7Qm2kXb9TzLp",
  "data": {
    "items": [
      {
        "rank": 1,
        "platform": "xiaohongshu",
        "keyword": "徒步",
        "heat": 792677,
        "label": "之前搜",
        "url": "https://www.xiaohongshu.com/search_result?keyword=%E5%BE%92%E6%AD%A5"
      },
      {
        "rank": 2,
        "platform": "xiaohongshu",
        "keyword": "露营装备",
        "heat": 243234,
        "label": "之后搜",
        "url": "https://www.xiaohongshu.com/search_result?keyword=%E9%9C%B2%E8%90%A5%E8%A3%85%E5%A4%87"
      }
    ]
  },
  "page": {
    "next_cursor": null,
    "has_more": false
  },
  "warnings": [],
  "meta": {
    "endpoint": "xiaohongshu.pgy.keywords.related",
    "platform": "xiaohongshu",
    "fetched_at": "2026-11-19T08:00:00.000Z",
    "source": "FeedMCP",
    "catalog_revision": "d09a736bd39e8b3f",
    "billing": {
      "charged": true,
      "amount": "0.04",
      "currency": "USD",
      "balance": "9.98"
    }
  }
}
```

出错时的格式见 [错误码](/zh/docs/errors/)：每个错误都写明扣没扣钱（`charged`）和能不能重试（`retry`）。

## 小红书的其他接口

- [小红书笔记详情](/zh/apis/xiaohongshu/notes/get/)：$0.02
- [小红书笔记评论](/zh/apis/xiaohongshu/notes/comments/list/)：$0.02
- [小红书博主资料](/zh/apis/xiaohongshu/users/get/)：$0.02
- [小红书博主的笔记](/zh/apis/xiaohongshu/users/notes/list/)：$0.02
- [小红书笔记搜索](/zh/apis/xiaohongshu/notes/search/)：$0.02
- [小红书评论的回复](/zh/apis/xiaohongshu/notes/comments/replies/list/)：$0.02
- [小红书账号搜索](/zh/apis/xiaohongshu/users/search/)：$0.02
- [蒲公英博主搜索](/zh/apis/xiaohongshu/pgy/creators/search/)：$0.04
- [蒲公英博主资料](/zh/apis/xiaohongshu/pgy/creators/get/)：$0.04
- [蒲公英博主数据概览](/zh/apis/xiaohongshu/pgy/creators/metrics/)：$0.04
- [蒲公英博主笔记表现](/zh/apis/xiaohongshu/pgy/creators/performance/)：$0.04
- [蒲公英博主每日数据](/zh/apis/xiaohongshu/pgy/creators/costs/history/)：$0.04
- [蒲公英博主粉丝画像](/zh/apis/xiaohongshu/pgy/creators/followers/get/)：$0.04
- [蒲公英博主粉丝质量](/zh/apis/xiaohongshu/pgy/creators/followers/metrics/)：$0.04
- [蒲公英博主粉丝趋势](/zh/apis/xiaohongshu/pgy/creators/followers/history/)：$0.04
- [蒲公英博主笔记案例](/zh/apis/xiaohongshu/pgy/creators/notes/list/)：$0.04
- [蒲公英相似博主](/zh/apis/xiaohongshu/pgy/creators/similar/list/)：$0.04
- [蒲公英笔记数据](/zh/apis/xiaohongshu/pgy/notes/get/)：$0.04
- [蒲公英内容广场热门笔记](/zh/apis/xiaohongshu/pgy/notes/trending/)：$0.04
- [蒲公英关键词概览](/zh/apis/xiaohongshu/pgy/keywords/metrics/)：$0.04
- [蒲公英关键词每日指数](/zh/apis/xiaohongshu/pgy/keywords/history/)：$0.04

## 常见问题

### 蒲公英关键词关联词接口多少钱？

成功取到榜单一次 $0.04。榜单是空的（平台这次没答上来）、平台出错、超时都不收费，可以直接重试。

### 需要平台账号吗？

不需要，只取公开数据。

### ID 或链接怎么找？

笔记 ID 是笔记链接 /explore/ 后面那一串；也可以直接传分享链接（xhslink.com）。

### 怎么取更多条？

返回里有 `page.next_cursor` 时，把它作为 `cursor` 参数传回来取下一页。每一页单独计费。

### 怎么在 AI 里用？

装好 [MCP](/zh/mcp/) 后直接说你要什么，AI 会调用 `xiaohongshu.pgy.keywords.related`。

---

网页版: https://feedmcp.com/zh/apis/xiaohongshu/pgy/keywords/related/
