小红书用户信息(商品详情页面数据接口)代码对接如下:
1.公共参数
名称类型必须描述
keyString√get请求方式拼接在url中,点击获取
api_nameString√api接口名称
cacheString默认否
result_typeString否json
langString默认cn 简体中文
versionString否api版本
2.请求参数
请求参数:user_id=648bee78000000002b008ec0
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.响应示例
{
msg: "成功",
data: {
interactions: [
{
type: "follows",
name: "关注",
count: "330"
},
{
type: "fans",
name: "粉丝",
count: "235"
},
{
type: "interaction",
name: "获赞与收藏",
count: "78"
}
],
tags: [
{
icon: "http://ci.xiaohongshu.com/icons/user/gender-male-v1.png",
tagType: "info"
},
{
name: "家居博主",
tagType: "profession"
}
],
user_account_status: {
toast: "此账号已注销",
type: 3
},
tab_public: {
collection: true
},
extra_info: {
fstatus: "none"
},
result: {
code: 0,
message: "success",
success: true
},
basic_info: {
ip_location: "",
desc: "",
imageb: "https://sns-avatar-qc.xhscdn.com/avatar/645b7f8f2a34639eb26eb1cd.jpg?imageView2/2/w/540/format/webp",
nickname: "用户已注销",
images: "https://sns-avatar-qc.xhscdn.com/avatar/645b7f8f2a34639eb26eb1cd.jpg?imageView2/2/w/360/format/webp",
red_id: "5510180575",
gender: 0
}
},
code: 0,
success: true