小红书 API - 笔记详情 (V1)
获取小红书笔记的详细数据,包括完整的笔记描述、互动指标(点赞、评论、收藏、分享)以及媒体信息。
响应中包含图片和视频的媒体下载链接。
典型使用场景:
- 使用完整笔记文本进行内容分析与审核
- 为创作者、营销活动和竞争对手进行互动追踪
- 收集媒体资源(图片/视频)用于下游处理或归档
- 构建用于分析、报告和自动化的数据集
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
token | query | string | 是 | 此 API 服务的访问令牌。 |
noteId | query | string | 是 | 小红书笔记唯一标识符。 |
代码示例
💡 环境说明
默认示例使用 https://api.justoneapi.com (prod-global)。中国大陆地区建议替换为 http://47.117.133.51:30015 (prod-cn) 以获得更好的访问体验。详见 环境选择。
bash
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
curl -X GET "https://api.justoneapi.com/api/xiaohongshu/get-note-detail/v1?token=YOUR_API_KEY¬eId=VALUE"text
我想使用 Just One API 提供的“笔记详情 (V1)”接口。
接口地址: https://api.justoneapi.com/api/xiaohongshu/get-note-detail/v1
HTTP 方法: GET
身份验证: 在 URL 后添加查询参数“?token=您的API密钥”。
OpenAPI 定义: https://docs.justoneapi.com/openapi/xiaohongshu-apis/note-details-v1-zh.json
请求参数说明:
- token (query): 此 API 服务的访问令牌。 (必填)
- noteId (query): 小红书笔记唯一标识符。 (必填)
返回格式: JSON
响应处理与错误码:
1. 需通过返回体中的 "code" 字段判断业务结果(code 为 0 表示成功)。
2. 超时建议:建议将请求超时时间设置为至少 60 秒。
3. 业务码说明:
- 0: 成功
- 100: Token 无效或已失效
- 301: 采集失败,请重试
- 302: 超出速率限制
- 303: 超出每日配额
- 400: 参数错误
- 500: 内部服务器错误
- 600: 权限不足
- 601: 余额不足
请帮我用我擅长的编程语言写一个脚本来调用这个接口,并处理返回结果。python
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
import requests
url = "https://api.justoneapi.com/api/xiaohongshu/get-note-detail/v1?token=YOUR_API_KEY¬eId=VALUE"
response = requests.get(url)
print(response.json())js
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
const response = await fetch("https://api.justoneapi.com/api/xiaohongshu/get-note-detail/v1?token=YOUR_API_KEY¬eId=VALUE", {
method: "GET"
});
const data = await response.json();
console.log(data);java
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.justoneapi.com/api/xiaohongshu/get-note-detail/v1?token=YOUR_API_KEY¬eId=VALUE"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}go
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
client := &http.Client{}
url := "https://api.justoneapi.com/api/xiaohongshu/get-note-detail/v1?token=YOUR_API_KEY¬eId=VALUE"
req, _ := http.NewRequest("GET", url, nil)
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}php
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.justoneapi.com/api/xiaohongshu/get-note-detail/v1?token=YOUR_API_KEY¬eId=VALUE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
echo $response;响应结果
json
{
"code": 0,
"data": [
{
"user": {
"name": "风草",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31fipps8cg66g5n684dak6j4mlhbrfio?imageView2/2/w/120/format/jpg",
"followed": false,
"nickname": "风草",
"red_official_verify_type": 0,
"show_red_official_verify_icon": false,
"red_official_verified": false,
"id": "5cc823550000000010034c96",
"fstatus": "none",
"level": {
"image": ""
},
"userid": "5cc823550000000010034c96",
"track_duration": 0,
"red_id": "518955047"
},
"note_list": [
{
"ip_location": "浙江",
"hash_tag": [
{
"record_count": 0,
"record_unit": "",
"name": "我是春节主理人",
"link": "xhsdiscover://rn/sns-discover/topic/immersive?id=696a7c8301b4000000000001&page_source=note_feed.click_new_big",
"record_emoji": "",
"current_score": 0,
"bizId": "",
"tag_hint": "",
"id": "696a7c83000000001b01014c",
"type": "topic"
},
{
"id": "696f9b5e000000001c0013e2",
"name": "咔嚓一张新年照",
"type": "topic",
"record_emoji": "",
"link": "xhsdiscover://rn/sns-discover/topic/immersive?id=696f9b5e01c0000000000005&page_source=note_feed.click_new_big",
"record_count": 0,
"record_unit": "",
"current_score": 0,
"bizId": "",
"tag_hint": ""
},
{
"id": "5c2372ac000000000a03c2b9",
"record_emoji": "",
"tag_hint": "",
"record_count": 0,
"record_unit": "",
"current_score": 0,
"bizId": "",
"name": "新年写真",
"type": "topic",
"link": "xhsdiscover://rn/sns-discover/topic/normal?id=5c2372ac7a9eab0001d89a13&page_source=note_feed.click_new_big"
},
{
"current_score": 0,
"bizId": "",
"id": "5bf8bd51e9a6d80001ba932c",
"type": "topic",
"link": "xhsdiscover://rn/sns-discover/topic/normal?id=5bf8bd519baeea0001ac42d8&page_source=note_feed.click_new_big",
"record_emoji": "",
"record_unit": "",
"name": "国风",
"record_count": 0,
"tag_hint": ""
},
{
"name": "拍照姿势不重样",
"type": "topic",
"link": "xhsdiscover://rn/sns-discover/topic/normal?id=5ad5d3e0ec9d136f795dc910&page_source=note_feed.click_new_big",
"record_count": 0,
"record_unit": "",
"current_score": 0,
"tag_hint": "",
"id": "5ad5d27781f6d13b516564e9",
"bizId": "",
"record_emoji": ""
}
],
"user": {
"followed": false,
"red_id": "518955047",
"nickname": "风草",
"red_official_verify_type": 0,
"show_red_official_verify_icon": false,
"userid": "5cc823550000000010034c96",
"level": {
"image": ""
},
"id": "5cc823550000000010034c96",
"image": "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31fipps8cg66g5n684dak6j4mlhbrfio?imageView2/2/w/120/format/jpg",
"red_official_verified": false,
"track_duration": 0,
"fstatus": "none",
"name": "风草"
},
"comments_count": 84,
"head_tags": [],
"liked_users": [],
"foot_tags": [],
"media_save_config": {
"disable_watermark": false,
"disable_weibo_cover": false,
"disable_save": false
},
"biz_map": {},
"images_list": [
{
"original": "https://sns-i10.rednotecdn.com/1040g00831sd37bs2lk405n684dak6j4m6ekoci0?imageView2/2/w/5000/h/5000/format/heif/q/56&redImage/frame/0&ap=1&sc=V_ORG&sign=f84261bfe2427b601718db89f70ebb59&t=69aede95&src=A",
"longitude": 0,
"latitude": 0,
"scale_to_large": 4,
"url": "https://sns-i10.rednotecdn.com/1040g00831sd37bs2lk405n684dak6j4m6ekoci0?imageView2/2/w/576/format/heif/q/58|imageMogr2/strip&redImage/frame/0/enhance/4&ap=1&sc=V_PRV&sign=f84261bfe2427b601718db89f70ebb59&t=69aede95&src=A",
"width": 1080,
"index": 0,
"trace_id": "1040g00831sd37bs2lk405n684dak6j4m6ekoci0",
"text_intention": 0,
"fileid": "1040g00831sd37bs2lk405n684dak6j4m6ekoci0",
"url_multi_level": {
"low": "https://sns-i10.rednotecdn.com/1040g00831sd37bs2lk405n684dak6j4m6ekoci0?imageView2/2/w/576/format/heif/q/75|imageMogr2/strip&redImage/frame/0/enhance/4&ap=1&sc=V_PRV&sign=f84261bfe2427b601718db89f70ebb59&t=69aede95&src=A",
"medium": "https://sns-i10.rednotecdn.com/1040g00831sd37bs2lk405n684dak6j4m6ekoci0?imageView2/2/w/576/format/heif/q/75|imageMogr2/strip&redImage/frame/0/enhance/4&ap=1&sc=V_PRV&sign=f84261bfe2427b601718db89f70ebb59&t=69aede95&src=A",
"high": "https://sns-i10.rednotecdn.com/1040g00831sd37bs2lk405n684dak6j4m6ekoci0?imageView2/2/w/576/format/heif/q/75|imageMogr2/strip&redImage/frame/0/enhance/4&ap=1&sc=V_PRV&sign=f84261bfe2427b601718db89f70ebb59&t=69aede95&src=A"
},
"need_load_original_image": true,
"origin_img": {
"height": 1920,
"size": 0,
"width": 1080
},
"height": 1920
}
],
"time": 1770696804,
"mini_program_info": {
"user_name": "gh_52be748ce5b7",
"path": "pages/main/home/index?redirect_path=%2Fpages%2Fmain%2Fnote%2Findex%3Fxsec_source%3Dapp_share%26id%3D698ab064000000001503876d%26type%3Dvideo%26xsec_token%3DCBTVMpyskaCdfD88YIySqnm4XGnFXFQGsDjD_OI1aB3GE%3D",
"title": "@风草 发了一篇笔记,快点来看吧!",
"desc": "和@小羊崽吃了吗 在杭州街拍新年写真,也是第一次尝试这种国潮拍法,拍得特别开心!拍照动作可参考哦!#我是春节主理人",
"webpage_url": "https://www.xiaohongshu.com/discovery/item/698ab064000000001503876d?xsec_source=app_share",
"thumb": "http://sns-img-hw.xhscdn.com/1040g00831sd37bs2lk405n684dak6j4m6ekoci0?imageView2/2/w/540/format/jpg/q/75",
"share_title": "@风草 发了一篇笔记,快点来看吧!"
},
"enable_brand_lottery": false,
"topics": [
{
"business_type": 0,
"id": "696a7c83000000001b01014c",
"name": "我是春节主理人",
"image": "http://ci.xiaohongshu.com/fd75707a-37f8-45ad-b7a7-0feaf36e9cad@r_120w_120h.jpg",
"link": "xhsdiscover://topic/v2/696a7c8301b4000000000001?page_source=note_feed.click_new_big",
"activity_online": false,
"style": 0,
"discuss_num": 0
}
],
"collected_count": 247,
"shared_count": 149,
"enable_fls_related_cards": false,
"privacy": {
"type": 0,
"show_tips": false,
"nick_names": ""
},
"use_water_color": false,
"widgets_groups": [
[
"guos_test",
"note_next_step",
"second_jump_bar",
"cooperate_binds",
"note_collection",
"rec_next_infos",
"image_stickers",
"image_filters",
"product_review",
"related_search",
"cooperate_comment_component",
"image_goods_cards",
"ads_goods_cards",
"ads_comment_component",
"goods_card_v2",
"image_template",
"buyable_goods_card_v2",
"ads_engage_bar",
"challenge_card",
"cooperate_engage_bar",
"guide_post",
"pgy_comment_component",
"pgy_engage_bar",
"bar_below_image",
"aigc_collection",
"co_produce",
"widgets_ndb",
"next_note_guide",
"pgy_bbc_exp",
"async_group",
"super_activity",
"widgets_enhance",
"music_player",
"soundtrack_player"
],
[
"guos_test",
"vote_stickers",
"bullet_comment_lead",
"note_search_box",
"interact_pk",
"interact_vote",
"guide_heuristic",
"share_to_msg",
"follow_guide",
"note_share_prompt_v1",
"sync_group",
"group_share",
"share_guide_bubble",
"widgets_share",
"guide_navigator"
]
],
"note_text_press_options": [
{
"key": "copy",
"extra": ""
}
],
"liked": false,
"long_press_share_info": {
"content": "",
"title": "",
"is_star": false,
"block_private_msg": false,
"show_wechat_tag": false,
"function_entries": [
{
"type": "image_download"
}
],
"guide_audited": false
},
"goods_info": {},
"content_trans_info": {
"strategy": 10
},
"qq_mini_program_info": {
"desc": "和@小羊崽吃了吗 在杭州街拍新年写真,也是第一次尝试这种国潮拍法,拍得特别开心!拍照动作可参考哦!#我是春节主理人",
"webpage_url": "https://www.xiaohongshu.com/discovery/item/698ab064000000001503876d?xsec_source=app_share",
"thumb": "http://sns-img-hw.xhscdn.com/1040g00831sd37bs2lk405n684dak6j4m6ekoci0?imageView2/2/w/540/format/jpg/q/75",
"share_title": "@风草 发了一篇超赞的笔记,快点来看!",
"user_name": "gh_66c53d495417",
"path": "pages/main/note/index?xsec_source=app_share&id=698ab064000000001503876d&type=video",
"title": "@风草 发了一篇超赞的笔记,快点来看!"
},
"feedback_info": {
"dislike_status": 0
},
"sticky": false,
"red_envelope_note": false,
"enable_co_produce": false,
"last_update_time": 0,
"share_info": {
"link": "https://www.xiaohongshu.com/discovery/item/698ab064000000001503876d?share_from_user_hidden=true&xsec_source=app_share&type=video&author_share=1",
"title": "国潮才是永恒审美!新年写真我太想进步了",
"is_star": false,
"block_private_msg": false,
"function_entries": [
{
"type": "generate_image"
},
{
"type": "copy_link"
},
{
"type": "heat_for_author"
},
{
"type": "video_speed"
},
{
"type": "dislike"
},
{
"type": "report"
},
{
"type": "video_feedback"
}
],
"wechat_share_desc": "@风草 的笔记\n149人分享",
"content": "和@小羊崽吃了吗 在杭州街拍新年写真,也是第一次尝试这种国潮拍法,拍得特别开心!拍照动作可参考哦!#我是春节主理人",
"image": "http://sns-img-hw.xhscdn.com/1040g00831sd37bs2lk405n684dak6j4m6ekoci0?imageView2/2/w/360/format/jpg/q/75",
"show_wechat_tag": false,
"guide_audited": true
},
"need_product_review": false,
"has_co_produce": false,
"function_switch": [
{
"type": "video_download",
"enable": false,
"reason": "作者已关闭下载权限,无法保存"
}
],
"liked_count": 689,
"desc": "和@小羊崽吃了吗 在杭州街拍新年写真,也是第一次尝试这种国潮拍法,拍得特别开心!拍照动作可参考哦!#我是春节主理人[话题]# #咔嚓一张新年照[话题]# #新年写真[话题]# #国风[话题]# #拍照姿势不重样[话题]#",
"view_count": 0,
"need_next_step": false,
"type": "video",
"seeded": false,
"widgets_context": "{\"video\":true,\"origin_video_key\":\"\",\"flags\":{\"sound_track\":true},\"author_id\":\"5cc823550000000010034c96\",\"author_name\":\"风草\",\"note_sound_info\":{\"sound_id\":\"1146600070351388223\",\"name\":\"风草的原声\",\"desc\":\"@风草创作的原声\",\"duration\":46250,\"url\":\"http://sns-v10.rednotecdn.com/audio/1/02e98ab06689295a010370039c45c11f80_0.wav\",\"use_count\":1,\"subtitle\":\"风草的原声\",\"sound_bg_music_type\":3,\"cover\":\"https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTLfIDOibG8vpB5NLWeXWBJj9SfDCw19v4SGQGNOEA2s3A6vnYicl9jvpa4pmGb8uwoicIALSk5yiaLHDA/132\",\"creator\":\"5cc823550000000010034c96\"},\"q_task_id\":\"\",\"video_rec_bar_info\":\"\"}",
"api_upgrade": -1,
"native_voice_info": {
"name": "风草的原声",
"desc": "@风草创作的原声",
"duration": 46250,
"url": "http://sns-v10.rednotecdn.com/audio/1/02e98ab06689295a010370039c45c11f80_0.wav",
"subtitle": "风草的原声",
"sound_bg_music_type": 3,
"sound_id": "1146600070351388223",
"md5sum": "1f045bc1a69f1c19ed373ec5452d3da5",
"use_count": 1,
"cover": "https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTLfIDOibG8vpB5NLWeXWBJj9SfDCw19v4SGQGNOEA2s3A6vnYicl9jvpa4pmGb8uwoicIALSk5yiaLHDA/132",
"optimize_exp_in_use_count": 0
},
"id": "698ab064000000001503876d",
"ats": [
{
"name": "小羊崽吃了吗",
"nickname": "小羊崽吃了吗",
"show_red_official_verify_icon": false,
"red_official_verified": false,
"level": {
"image": ""
},
"id": "5b100874f7e8b932e02cfc6d",
"followed": false,
"red_official_verify_type": 0,
"track_duration": 0
}
],
"in_censor": false,
"has_related_goods": false,
"cooperate_binds": [],
"title": "国潮才是永恒审美!新年写真我太想进步了",
"collected": false,
"seeded_count": 0,
"share_code_flag": 0,
"countdown": 0,
"model_type": "note",
"comment_prompt_config": {
"placeholder_short": "说点什么...",
"placeholder_long": "爱评论的人运气都不差",
"forbidden_cmt_type": 0
},
"enable_fls_bridge_cards": false,
"may_have_red_packet": false,
"has_music": false,
"text_language_code": "zh"
}
],
"comment_list": [],
"track_id": "",
"model_type": "note"
}
]
}💡 提示:为简化展示,列表类数据样例仅保留 1-2 条记录,实际返回条数以接口响应为准。
