在成长的路上,我们都是同行者。这篇关于小红书API接口的文章,希望能帮助到您。期待与您继续分享更多API接口的知识,请记得关注Anzexi58哦!
item_get_video-
smallredbook.item_get_video
公共参数
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
key | String | 是 | 调用key(必须以GET方式拼接在URL中) |
secret | String | 是 | 调用密钥 |
api_name | String | 是 | API接口名称(包括在请求地址中)[item_search,item_get,item_search_shop等] |
cache | String | 否 | [yes,no]默认yes,将调用缓存的数据,速度比较快 |
result_type | String | 否 | [json,jsonu,xml,serialize,var_export]返回数据格式,默认为json,jsonu输出的内容中文可以直接阅读 |
lang | String | 否 | [cn,en,ru]翻译语言,默认cn简体中文 |
version | String | 否 | API版本 请求参数 |
请求参数:num_iid=670202b0000000002a032d2d&xsec_token=ABqixHfLobMJG4HpXyvXkCe-LXxeIR1B2uvdFd8FuikaM=
参数说明:num_iid:笔记ID,xsec_token:商品token
响应参数
Version: Date:
名称 | 类型 | 必须 | 示例值 | 描述 |
---|---|---|---|---|
item | item[] | 0 | 获取用户作品 请求示例 |
请求示例
# 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://api-gw.onebound.cn/smallredbook/item_get_video/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=670202b0000000002a032d2d&xsec_token=ABqixHfLobMJG4HpXyvXkCe-LXxeIR1B2uvdFd8FuikaM="
headers = {
"Accept-Encoding": "gzip",
"Connection": "close"
}
if __name__ == "__main__":
r = requests.get(url, headers=headers)
json_obj = r.json()
print(json_obj)
响应示例
{
"item": {
"num_iid": "649c46ab000000002702ad36",
"detail_url": "https://www.xiaohongshu.com/explore/649c46ab000000002702ad36",
"title": "变形金刚4",
"type": "video",
"video": "http://sns-video-qc.xhscdn.com/stream/110/258/01e49c46a63bcd390103770389027d1ad7_258.mp4?sign=180a24669a446bf75a3ec79f41926bcb&t=64a04c54",
"pic_url": "https://sns-img-hw.xhscdn.com/0ccd59b9-71ad-d2c0-ec5a-afac90d21355?imageView2/2/h/1920/format/webp|imageMogr2/strip",
"tag_list": [
{
"name": "变形金刚",
"type": "topic",
"id": "545c2716d6e4a924bf74ed49"
}
],
"desc": " 这就是柱子哥的魅力",
"city": "河北",
"nick": "变形金刚电影剪辑",
"uid": "64805fc1000000000f004891",
"interact_info": {
"liked_count": "41",
"collected_count": "16",
"comment_count": "0"
},
"time": "2023-06-28 22:41:47",
"_ddf": "mt"
},
"error": "",
"reason": "",
"error_code": "0000",
"cache": 0,
"api_info": "today:182 max:10100 all[5611=182+44+5385];expires:2030-12-31",
"execution_time": "1.957",
"server_time": "Beijing/2023-06-30 17:21:49",
"client_ip": "106.6.34.137",
"call_args": [],
"api_type": "smallredbook",
"translate_language": "zh-CN",
"translate_engine": "baidu",
"server_memory": "3.03MB",
"request_id": "1.649e9eab4b441",
"last_id": "1840805874"
}