笔记搜索
通过关键词搜索小红书(RedNote)笔记,支持分页以及排序、笔记类型和发布时间筛选。用于支持主题研究、内容发现和监控关键词相关帖子。
参数
| 参数 | 必填 | 类型 | 说明 | 示例 | 可选值 |
|---|---|---|---|---|---|
keyword |
必填 | string | 搜索关键词。 | 咖啡 |
— |
page |
可选 | integer | 用于分页的页码。 | 1 |
— |
sort |
可选 | string | 结果集的排序方式。 可选值: - `general`:综合排序 - `popularity_descending`:热度降序 - `time_descending`:时间降序 - `comment_descending`:评论数降序 - `collect_descending`:收藏数降序 | general |
generalpopularity_descendingtime_descendingcomment_descendingcollect_descending |
note_type |
可选 | string | 笔记类型过滤器。 可用值: - `_0`: 通用 - `_1`: 视频 - `_2`: 普通 | _0 |
_0_1_2 |
note_time |
可选 | string | 笔记发布时间筛选。结果可能包含超出所选时间范围的笔记。 可选值: - `ONE_DAY`:一天内 - `ONE_WEEK`:一周内 - `HALF_YEAR`:半年内 | ONE_DAY |
ONE_DAYONE_WEEKHALF_YEAR |
代码示例
curl -G "https://api.mofa-ai.com/v1/xiaohongshu/search_note_v2" \
-H "Authorization: Bearer $MOFA_API_KEY" \
--data-urlencode 'keyword=咖啡' \
--data-urlencode 'page=1' \
--data-urlencode 'sort=general' \
--data-urlencode 'note_type=_0' \
--data-urlencode 'note_time=ONE_DAY'
import os
import requests
resp = requests.get(
"https://api.mofa-ai.com/v1/xiaohongshu/search_note_v2",
headers={"Authorization": f"Bearer {os.environ['MOFA_API_KEY']}"},
params={
"keyword": "咖啡",
"page": "1",
"sort": "general",
"note_type": "_0",
"note_time": "ONE_DAY",
},
timeout=60,
)
body = resp.json()
if body["success"]:
print(body["cost_usd"], body["data"])
else:
print(body["error"], body["message"])
const url = new URL("https://api.mofa-ai.com/v1/xiaohongshu/search_note_v2");
url.search = new URLSearchParams({
keyword: "咖啡",
page: "1",
sort: "general",
note_type: "_0",
note_time: "ONE_DAY",
});
const resp = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MOFA_API_KEY}` },
});
const body = await resp.json();
if (body.success) console.log(body.cost_usd, body.data);
else console.error(body.error, body.message);
在线试用
登录后可以在这里直接调用此接口,按价格从余额扣费,失败不收费。新账户赠送 $0.50 试用额度。
响应示例
采集于 2026-11-07,耗时 8102 ms · 请求参数 {"page": "1", "sort": "general", "keyword": "咖啡", "note_time": "ONE_DAY", "note_type": "_0"}
JSON
{
"success": true,
"code": 0,
"message": "success",
"request_id": "req_5f1c2a9be04d7c3a81f6e2d0",
"endpoint": "xiaohongshu.search_note_v2",
"cost_usd": 0.03,
"data": {
"code": 0,
"data": {
"items": [
{
"note": {
"id": "6aefb903000000000e024d59",
"…": "+12",
"desc": "超高性价比咖啡液 Tims咖啡液,均价0.5 18克大容量,满足一整天的咖啡需求 追求性价比学生党必备 #咖啡液 #黑",
"liked": false,
"niced": false,
"geo_info": {
"distance": ""
},
"collected": false,
"has_music": false,
"nice_count": 0,
"click_score": 4.694562085205689e-05,
"images_list": [
{
"url": "https://sns-na-i6.xhscdn.com/1040g0083279phprfmq004bi1fb1k2b…",
"width": 1080,
"fileid": "1040g0083279phprfmq004bi1fb1k2b5eiucsl70",
"height": 1920,
"original": "",
"trace_id": "1040g0083279phprfmq004bi1fb1k2b5eiucsl70",
"url_size_large": "https://sns-na-i6.xhscdn.com/1040g0083279phprfmq004bi1fb1k2b…",
"need_load_original_image": false
}
],
"liked_count": 0,
"comments_count": 0,
"debug_info_str": "",
"collected_count": 0,
"corner_tag_info": [
{
"icon": "",
"text": "RAzCxtyHPNf2pkfNQR0933BL72Kksnj/uSSJtTQkgcKwsc/KZlIw5mq0gt4e…",
"type": "ubt_sig_token",
"style": 0,
"text_en": "",
"location": -1
},
"… +1"
],
"interaction_area": {
"text": "0",
"type": 1,
"status": false
},
"last_update_time": 0,
"cover_image_index": 0,
"extract_text_enabled": 0,
"advanced_widgets_groups": {
"groups": [
{
"mode": 1,
"fetch_types": [
"guos_test",
"… +38"
]
},
"… +1"
]
}
},
"model_type": "note",
"mix_track_id": "NOTE__6aefb903000000000e024d59__2h4muojrw6zll0cnbe7um__咖啡",
"new_help_style": false
},
"… +19"
],
"can_cut": false,
"taxonomy1": "5ab094be481d26b8ef9045f1",
"extra_info": {
"atmosphere_v3_enable": "0"
},
"query_type": 0,
"request_dqa": 0,
"query_intent": {
"goodsIntent": 3,
"low_supply_intent": false,
"search_ask_intent": true
},
"strategy_info": {
"query_can_guide_to_feed": true,
"query_average_impression_count": 19
},
"ai_mode_enable": false,
"cur_cut_number": 0,
"is_broad_query": true,
"service_status": "{\"filter\":\"not_required\",\"note\":\"success\",\"onebox\":\"not_requ…",
"show_single_col": false,
"query_debug_info": {
"is_forbidden": false
},
"search_request_id": "55b14e5ba89f014d",
"request_dqa_instant": false,
"video_intent_grade_v3": 1,
"search_dqa_new_page_exp": 1,
"search_pull_down_opt_exp": 1,
"dqa_authorized_user_by_shared": false
},
"message": null,
"requestId": "249dc6ce89604d8ab743acc2c67413ee",
"recordTime": "2026-11-08T07:57:42.056713723",
"requestParams": {
"body": null,
"query": {
"page": "1",
"sort": "general",
"keyword": "咖啡",
"noteTime": "ONE_DAY",
"noteType": "_0"
}
}
}
}