在成長的路上,我們都是同行者。這篇關于小紅書API接口的文章,希望能幫助到您。期待與您繼續(xù)分享更多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"
}