小红书评论接口API

   小红书用户信息(商品详情页面数据接口)代码对接如下:

1.公共参数

名称 类型 必须 描述
key String get请求方式拼接在url中,点击获取
api_name String api接口名称
cache String 默认否
result_type String json
lang String 默认cn 简体中文
version String api版本



2.请求参数

请求参数:note_id=63d365a7000000001f013acf

3.响应参数

4.请求示例(CURL、PHP 、PHPsdk 、Java 、C# 、Python…)

# coding:utf-8
"""
Compatible for python2.x and python3.x
requirement: pip install requests
"""
from __future__ import print_function
import requests
# 请求示例 url 默认请求参数已经做URL编码
url = "https://qq2671517833/smallredbook/item_get/?key=<您自己的apiKey>&secret=<您自己的apiSecret>¬e_id=5eb1097ba091410953951d17"
headers = {
    "Accept-Encoding": "gzip",
    "Connection": "close"
}
if __name__ == "__main__":
    r = requests.get(url, headers=headers)
    json_obj = r.json()
    print(json_obj)

 5.响应示例

{
code: 0,
success: true,
msg: "成功",
data: {
user_id: "6477dc720000000025037474",
comments: [
{
show_tags: [ ],
content: "求电子版本",
like_count: "2",
create_time: 1686717761000,
sub_comment_cursor: "648960a7000000001700a97f",
id: "648945410000000029012151",
note_id: "63d365a7000000001f013acf",
liked: false,
user_info: {
nickname: "Crystal",
image: "https://sns-avatar-qc.xhscdn.com/avatar/5cbf1e331e22d600015a21d9.jpg?imageView2/2/w/120/format/jpg",
user_id: "5be0e1531e84f90001e07676"
},
sub_comment_has_more: true,
status: 0,
at_users: [ ],
sub_comment_count: "4",
sub_comments: [
{
content: "冠驻斯[飞吻R]",
at_users: [ ],
liked: false,
show_tags: [
"is_author"
],
create_time: 1686724775000,
target_comment: {
id: "648945410000000029012151",
user_info: {
user_id: "5be0e1531e84f90001e07676",
nickname: "Crystal",
image: "https://sns-avatar-qc.xhscdn.com/avatar/5cbf1e331e22d600015a21d9.jpg?imageView2/2/w/120/format/jpg"
}
},
id: "648960a7000000001700a97f",
note_id: "63d365a7000000001f013acf",
status: 0,
like_count: "1",
user_info: {
user_id: "63afb0350000000026012fb4",
nickname: "柚子小学资料分享",
image: "https://sns-avatar-qc.xhscdn.com/avatar/63afb0350000000026012fb4.jpg?imageView2/2/w/120/format/jpg"
}
}
]
},
{
content: "求电子版",
sub_comment_count: "3",
liked: false,
create_time: 1679477749000,
sub_comments: [
{
status: 0,
at_users: [ ],
show_tags: [
"is_author"
],
create_time: 1679480432000,
like_count: "1",
user_info: {
image: "https://sns-avatar-qc.xhscdn.com/avatar/63afb0350000000026012fb4.jpg?imageView2/2/w/120/format/jpg",
user_id: "63afb0350000000026012fb4",
nickname: "柚子小学资料分享"
},
target_comment: {
id: "641acbf5000000001700ab8e",
user_info: {
user_id: "5e0cb2920000000001004fc4",
nickname: "Islands",
image: "https://sns-avatar-qc.xhscdn.com/avatar/62f0778a66adf6668e97f923.jpg?imageView2/2/w/120/format/jpg"
}
},
id: "641ad670000000000a009b58",
note_id: "63d365a7000000001f013acf",
content: "嗯嗯观撕",
liked: false
}
],
sub_comment_cursor: "641ad670000000000a009b58",
status: 0,
like_count: "3",
user_info: {
user_id: "5e0cb2920000000001004fc4",
nickname: "Islands",
image: "https://sns-avatar-qc.xhscdn.com/avatar/62f0778a66adf6668e97f923.jpg?imageView2/2/w/120/format/jpg"
},
show_tags: [ ],
id: "641acbf5000000001700ab8e",
note_id: "63d365a7000000001f013acf",
at_users: [ ],
sub_comment_has_more: true
},
{
show_tags: [ ],
create_time: 1685935439000,
sub_comment_cursor: "647d8174000000002c03f7ba",
sub_comment_has_more: false,
status: 0,
content: "已关注,求分享",
like_count: "2",
id: "647d554f000000001f0318ec",
user_info: {
image: "https://sns-avatar-qc.xhscdn.com/avatar/587ee03282ec397c31da58ea.jpg?imageView2/2/w/120/format/jpg",
user_id: "587ee03282ec397c31da58ea",
nickname: "一个小橙子"
},
sub_comment_count: "1",
sub_comments: [
{
create_time: 1685946740000,
target_comment: {
id: "647d554f000000001f0318ec",
user_info: {
user_id: "587ee03282ec397c31da58ea",
nickname: "一个小橙子",
image: "https://sns-avatar-qc.xhscdn.com/avatar/587ee03282ec397c31da58ea.jpg?imageView2/2/w/120/format/jpg"
}
},
id: "647d8174000000002c03f7ba",
note_id: "63d365a7000000001f013acf",
content: "撕[飞吻R]",
at_users: [ ],
liked: false,
show_tags: [
"is_author"
],
status: 0,
like_count: "1",
user_info: {
nickname: "柚子小学资料分享",
image: "https://sns-avatar-qc.xhscdn.com/avatar/63afb0350000000026012fb4.jpg?imageView2/2/w/120/format/jpg",
user_id: "63afb0350000000026012fb4"
}
}
],
note_id: "63d365a7000000001f013acf",
at_users: [ ],
liked: false
},
{
liked: false,
like_count: "1",
show_tags: [ ],
sub_comment_count: "1",
sub_comment_has_more: false,
status: 0,
at_users: [ ],
user_info: {
user_id: "5f26911d000000000101ea8d",
nickname: "乐~",
image: "https://sns-avatar-qc.xhscdn.com/avatar/5f26911d000000000101ea8d.jpg?imageView2/2/w/120/format/jpg"
},
id: "64908cd5000000001900fb23",
note_id: "63d365a7000000001f013acf",
content: "求电子版[飞吻R]",
sub_comment_cursor: "64914cc8000000001801cbee",
create_time: 1687194837000,
sub_comments: [
{
liked: false,
like_count: "0",
user_info: {
user_id: "63afb0350000000026012fb4",
nickname: "柚子小学资料分享",
image: "https://sns-avatar-qc.xhscdn.com/avatar/63afb0350000000026012fb4.jpg?imageView2/2/w/120/format/jpg"
},
create_time: 1687243976000,
target_comment: {
id: "64908cd5000000001900fb23",
user_info: {
user_id: "5f26911d000000000101ea8d",
nickname: "乐~",
image: "https://sns-avatar-qc.xhscdn.com/avatar/5f26911d000000000101ea8d.jpg?imageView2/2/w/120/format/jpg"
}
},
note_id: "63d365a7000000001f013acf",
at_users: [ ],
content: "思[飞吻R]",
show_tags: [
"is_author"
],
id: "64914cc8000000001801cbee",
status: 0
}
]
},
{
show_tags: [ ],
create_time: 1688977173000,
sub_comments: [
{
status: 0,
at_users: [ ],
liked: false,
user_info: {
user_id: "63afb0350000000026012fb4",
nickname: "柚子小学资料分享",
image: "https://sns-avatar-qc.xhscdn.com/avatar/63afb0350000000026012fb4.jpg?imageView2/2/w/120/format/jpg"
},
create_time: 1688979587000,
id: "64abc883000000001802bb06",
note_id: "63d365a7000000001f013acf",
show_tags: [
"is_author"
],
target_comment: {
id: "64abbf15000000001803a1a8",
user_info: {
user_id: "5e4558860000000001000fef",
nickname: "rita",
image: "https://sns-avatar-qc.xhscdn.com/avatar/5e4558860000000001000fef.jpg?imageView2/2/w/120/format/jpg"
}
},
content: "撕[飞吻R]",
like_count: "0"
}
],
sub_comment_cursor: "64abc883000000001802bb06",
at_users: [ ],
sub_comment_count: "1",
note_id: "63d365a7000000001f013acf",
like_count: "0",
sub_comment_has_more: false,
id: "64abbf15000000001803a1a8",
content: "求电子版",
liked: false,
user_info: {
user_id: "5e4558860000000001000fef",
nickname: "rita",
image: "https://sns-avatar-qc.xhscdn.com/avatar/5e4558860000000001000fef.jpg?imageView2/2/w/120/format/jpg"
},
status: 0
},
{
like_count: "0",
note_id: "63d365a7000000001f013acf",
status: 0,
user_info: {
user_id: "5d67a77b0000000001007199",
nickname: "唔西迪西",
image: "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo30rvg66vr2g005nb7kttg8scpu1n4a48?imageView2/2/w/120/format/jpg"
},
show_tags: [ ],
sub_comments: [
{
content: "斯[飞吻R]",
at_users: [ ],
like_count: "0",
user_info: {
nickname: "柚子小学资料分享",
image: "https://sns-avatar-qc.xhscdn.com/avatar/63afb0350000000026012fb4.jpg?imageView2/2/w/120/format/jpg",
user_id: "63afb0350000000026012fb4"
},
show_tags: [
"is_author"
],
status: 0,
note_id: "63d365a7000000001f013acf",
liked: false,
create_time: 1688908024000,
target_comment: {
id: "64aa6ae5000000001903250d",
user_info: {
image: "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo30rvg66vr2g005nb7kttg8scpu1n4a48?imageView2/2/w/120/format/jpg",
user_id: "5d67a77b0000000001007199",
nickname: "唔西迪西"
}
},
id: "64aab0f800000000180053ef"
}
],
id: "64aa6ae5000000001903250d",
content: "求分享 已关注[飞吻R]",
liked: false,
sub_comment_cursor: "64aab0f800000000180053ef",
sub_comment_count: "1",
sub_comment_has_more: false,
at_users: [ ],
create_time: 1688890085000
},
{
show_tags: [ ],
sub_comment_has_more: false,
user_info: {
user_id: "5c56d429000000001a018c60",
nickname: "张銘id",
image: "https://sns-avatar-qc.xhscdn.com/avatar/5c56d5b5e0d75d000134c3ca.jpg?imageView2/2/w/120/format/jpg"
},
create_time: 1688798229000,
content: "求分享",
at_users: [ ],
liked: false,
note_id: "63d365a7000000001f013acf",
status: 0,
sub_comments: [
{
note_id: "63d365a7000000001f013acf",
like_count: "0",
user_info: {
user_id: "63afb0350000000026012fb4",
nickname: "柚子小学资料分享",
image: "https://sns-avatar-qc.xhscdn.com/avatar/63afb0350000000026012fb4.jpg?imageView2/2/w/120/format/jpg"
},
target_comment: {
id: "64a90415000000001603edf5",
user_info: {
user_id: "5c56d429000000001a018c60",
nickname: "张銘id",
image: "https://sns-avatar-qc.xhscdn.com/avatar/5c56d5b5e0d75d000134c3ca.jpg?imageView2/2/w/120/format/jpg"
}
},
create_time: 1688822694000,
id: "64a963a6000000001900f4ac",
status: 0,
content: "撕[飞吻R]",
at_users: [ ],
liked: false,
show_tags: [
"is_author"
]
}
],
sub_comment_cursor: "64a963a6000000001900f4ac",
id: "64a90415000000001603edf5",
like_count: "0",
sub_comment_count: "1"
},
{
liked: false,
user_info: {
user_id: "5d3820920000000010037037",
nickname: "L~",
image: "https://sns-avatar-qc.xhscdn.com/avatar/61e4ee3678b1c36e94ecf2c2.jpg?imageView2/2/w/120/format/jpg"
},
sub_comment_cursor: "64a8d162000000001603f870",
like_count: "0",
show_tags: [ ],
sub_comment_count: "1",
sub_comments: [
{
note_id: "63d365a7000000001f013acf",
status: 0,
content: "冠注撕",
liked: false,
show_tags: [
"is_author"
],
id: "64a8d162000000001603f870",
at_users: [ ],
like_count: "0",
user_info: {
image: "https://sns-avatar-qc.xhscdn.com/avatar/63afb0350000000026012fb4.jpg?imageView2/2/w/120/format/jpg",
user_id: "63afb0350000000026012fb4",
nickname: "柚子小学资料分享"
},
create_time: 1688785250000,
target_comment: {
id: "64a79c8a000000002c038f6a",
user_info: {
user_id: "5d3820920000000010037037",
nickname: "L~",
image: "https://sns-avatar-qc.xhscdn.com/avatar/61e4ee3678b1c36e94ecf2c2.jpg?imageView2/2/w/120/format/jpg"
}
}
}
],
status: 0,
content: "求电子版",
at_users: [ ],
id: "64a79c8a000000002c038f6a",
note_id: "63d365a7000000001f013acf",
create_time: 1688706186000,
sub_comment_has_more: false
},
{
sub_comments: [
{
id: "64a63b13000000001900d96f",
note_id: "63d365a7000000001f013acf",
content: "司[飞吻R]",
user_info: {
user_id: "63afb0350000000026012fb4",
nickname: "柚子小学资料分享",
image: "https://sns-avatar-qc.xhscdn.com/avatar/63afb0350000000026012fb4.jpg?imageView2/2/w/120/format/jpg"
},
target_comment: {
id: "64a62fd8000000001c0163bf",
user_info: {
user_id: "5da9b0580000000001001853",
nickname: "姚沙沙",
image: "https://sns-avatar-qc.xhscdn.com/avatar/610f7e4526424f8a4fa2521e.jpg?imageView2/2/w/120/format/jpg"
}
},
status: 0,
at_users: [ ],
liked: false,
like_count: "0",
show_tags: [
"is_author"
],
create_time: 1688615699000
}
],
sub_comment_cursor: "64a63b13000000001900d96f",
note_id: "63d365a7000000001f013acf",
status: 0,
liked: false,
sub_comment_has_more: false,
user_info: {
user_id: "5da9b0580000000001001853",
nickname: "姚沙沙",
image: "https://sns-avatar-qc.xhscdn.com/avatar/610f7e4526424f8a4fa2521e.jpg?imageView2/2/w/120/format/jpg"
},
sub_comment_count: "1",
content: "求电子版",
at_users: [ ],
like_count: "0",
id: "64a62fd8000000001c0163bf",
show_tags: [ ],
create_time: 1688612824000
},
{
sub_comments: [
{
note_id: "63d365a7000000001f013acf",
content: "惯主丝[飞吻R]",
liked: false,
like_count: "0",
show_tags: [
"is_author"
],
create_time: 1688607432000,
target_comment: {
id: "64a59167000000001a0375f7",
user_info: {
nickname: "十五的月亮十六元",
image: "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo30sj6s6uojc004bpcllknptcjqi16q98?imageView2/2/w/120/format/jpg",
user_id: "5be5a97cd7af4c000198f593"
}
},
id: "64a61ac8000000001900ffe5",
status: 0,
at_users: [ ],
user_info: {
user_id: "63afb0350000000026012fb4",
nickname: "柚子小学资料分享",
image: "https://sns-avatar-qc.xhscdn.com/avatar/63afb0350000000026012fb4.jpg?imageView2/2/w/120/format/jpg"
}
}
],
content: "求电子版",
show_tags: [ ],
sub_comment_count: "1",
sub_comment_cursor: "64a61ac8000000001900ffe5",
sub_comment_has_more: false,
note_id: "63d365a7000000001f013acf",
status: 0,
user_info: {
user_id: "5be5a97cd7af4c000198f593",
nickname: "十五的月亮十六元",
image: "https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo30sj6s6uojc004bpcllknptcjqi16q98?imageView2/2/w/120/format/jpg"
},
create_time: 1688572263000,
id: "64a59167000000001a0375f7",
liked: false,
at_users: [ ],
like_count: "0"
}
],
cursor: "64a59167000000001a0375f7",
has_more: true,
time: 1706509086792
}
}

你可能感兴趣的:(python,开发语言)