小红书用户信息(商品详情页面数据接口)代码对接如下:
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: