淘寶/天貓按分類搜直播介面 API 返回值說明

API測試Cris發表於2023-04-13

前言


       自從2016年直播行業的爆發以來,直播平臺、觀眾數量都呈井噴式發展,我國網路直播行業呈現井噴式發展。網路直播利用網際網路實現了資訊的實時共享,開啟了全新的社交網路互動方式,被稱之為擁有千億市場的新興產業。同時在國家文化的政策支援下,網路基礎設施和移動寬頻的加速普及、影片技術的日趨成熟、資本的助推等利好因素推動下,網路直播行業呈高速發展。  今天小編就向大家展示下直播介面API的具體操作及說明:


item_videolist-按分類搜尋淘寶直播介面


公共引數


名稱 型別 必須 描述

key String 呼叫key(必須以GET方式拼接在URL中)

secret String 呼叫金鑰(介面v-;18870288846)

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版本


請求引數


請求引數:channelId=0&page=1


引數說明:channelId:影片分類ID

page頁數



響應引數


Version: Date:


名稱 型別 必須 示例值 描述

title


String 0 年貨盛宴 心意之選 商品標題

num_iid


Bigint 0 294846800380 寶貝ID

view_count


Int 0 890 觀看人數

pic_url


String 0 !!0-dgshop.jpg 寶貝圖片

detail_url


String 0 //h5.m.taobao.com/taolive/video.html?id=294846800380 寶貝連結

seller_info


Mix 0 {"user_num_id": 2064892827, "head_img": "//img.alicdn.com/imgextra/i4/2064892827/O1CN01FQoRJd1WkoJuNhJOw_!!2064892827-0-beehive-scenes.jpg", "seller_nick": "雅詩蘭黛旗艦店"} 賣家資訊

請求示例


#include<iostream>

#include<string>

#include<curl/curl.h>

 

using namespace std;

 

static size_t Data(void *ptr, size_t size, size_t nmemb, string *stream)

{

    std::size_t realSize = size *nmemb;

    auto *realPtr = reinterpret_cast<char *>(ptr);

 

    for (std::size_t i=0;i<realSize;++i) {

        *(stream) += *(realPtr + i);

    }

 

    return realSize;

}

 

int main(){

 

     CURL *curl;

     CURLcode result;

     string readBuffer;

     curl = curl_easy_init();

 

     if(curl) {

 

         curl_easy_setopt(curl, CURLOPT_URL, ";18870288846/key=<您自己的apiKey>&secret=<您自己的apiSecret>&channelId=0&page=1");

         curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

         curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, Data);

         curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);

 

         result = curl_easy_perform(curl);

 

         if(result == CURLE_OK) {

             cout<<readBuffer<<endl;

         }else{

             cerr<<"curl_easy error:"<<curl_easy_strerror(result)<<endl;

         }

 

         curl_easy_cleanup(curl);

     }

     return 0;

}


響應示例


{

"items": {

"channel_id": 0,

"page": "5",

"page_size": 10,

"real_total_results": 1000,

"total_results": 1000,

"page_count": 100,

"data_from": "app",

"item": [

{

"title": "有溫度的小石頭",

"num_iid": "295999018811",

"view_count": "215",

"pic_url": "!!6000000006651-0-tblive.jpg",

"detail_url": "//h5.m.taobao.com/taolive/video.html?id=295999018811",

"seller_info": {

"user_num_id": "59632",

"head_img": "//img.alicdn.com/imgextra/i3/6000000006633/O1CN01Qb05DO1yrxklqRO7j_!!6000000006633-0-tblive.jpg",

"seller_nick": "善石柏緣"

}

},

{

"title": "小玩通的直播間",

"num_iid": "295408948484",

"view_count": "10",

"pic_url": "!!0-tbCommonAudio.jpg",

"detail_url": "//h5.m.taobao.com/taolive/video.html?id=295408948484",

"seller_info": {

"user_num_id": "254632",

"head_img": "//gdp.alicdn.com/shop-logo//11/68/TB1cQ9JLrrpK1RjSZTESuwWAVXa.jpg",

"seller_nick": "小哈香水嚴選"

}

},

{

"title": "新年囤好貨新店大酬賓",

"num_iid": "295773049663",

"view_count": "12",

"pic_url": "!!0-dgshop.jpg",

"detail_url": "//h5.m.taobao.com/taolive/video.html?id=295773049663",

"seller_info": {

"user_num_id": "403369",

"head_img": "//gdp.alicdn.com/shop-logo//45/42/TB15C2n3uL2gK0jSZFmwu37iXXa.png",

"seller_nick": "家鄉好優選"

}

},

{

"title": "年貨福利來啦",

"num_iid": "296049354114",

"view_count": "500",

"pic_url": "!!0-tbCommonAudio.jpg",

"detail_url": "//h5.m.taobao.com/taolive/video.html?id=296049354114",

"seller_info": {

"user_num_id": "1148032",

"head_img": "//img.alicdn.com/imgextra/i4/1148032/TB2_2Tzzv5TBuNjSspmXXaDRVXa_!!1148032-0-beehive-scenes.jpg",

"seller_nick": "港仔先生"

}

},

{

"title": "大碼女靴斷碼清倉處理",

"num_iid": "296024138273",

"view_count": "291",

"pic_url": "!!0-dgshop.jpg",

"detail_url": "//h5.m.taobao.com/taolive/video.html?id=296024138273",

"seller_info": {

"user_num_id": "1264569",

"head_img": "//gdp.alicdn.com/shop-logo//dc/5b/TB1Y1L7SpXXXXXHXXXXSutbFXXX.jpg",

"seller_nick": "王小妖大碼女鞋"

}

},

{

"title": "各店的300-130",

"num_iid": "296254443199",

"view_count": "4228",

"pic_url": "!!0-dgshop.jpg",

"detail_url": "//h5.m.taobao.com/taolive/video.html?id=296254443199",

"seller_info": {

"user_num_id": "10820132",

"head_img": "//img.alicdn.com/imgextra/i2/6000000006283/O1CN01QYWUUQ1wHf5qtd07i_!!6000000006283-0-tblive.jpg",

"seller_nick": "果爸書書"

}

},

{

"title": "庫茵新品上新",

"num_iid": "295757777888",

"view_count": "9307",

"pic_url": "!!6000000005960-0-tblive.jpg",

"detail_url": "//h5.m.taobao.com/taolive/video.html?id=295757777888",

"seller_info": {

"user_num_id": "27763132",

"head_img": "//gw2.alicdn.com/tfscom/tuitui/TB1n0d2LXXXXXXFapXXXXXXXXXX",

"seller_nick": "叭噠女王"

}

},

{

"title": "zhyt828的直播間",

"num_iid": "295755881697",

"view_count": "430",

"pic_url": "!!6000000003073-0-tblive.jpg",

"detail_url": "//h5.m.taobao.com/taolive/video.html?id=295755881697",

"seller_info": {

"user_num_id": "30586132",

"head_img": "//gdp.alicdn.com/shop-logo//b1/2a/TB10A9RiAyWBuNjy0FpSuussXXa.jpg",

"seller_nick": "金華佛手"

}

},

{

"title": "年終大促~T特價場",

"num_iid": "295440344582",

"view_count": "560",

"pic_url": "!!0-tbCommonAudio.jpg",

"detail_url": "//h5.m.taobao.com/taolive/video.html?id=295440344582",

"seller_info": {

"user_num_id": "36239832",

"head_img": "//img.alicdn.com/imgextra/i3/36239832/O1CN01syc4oh2MV6iY6dGSv_!!36239832-0-beehive-scenes.jpg",

"seller_nick": "COSHMIR"

}

},

{

"title": "新年背新包特惠搶不停",

"num_iid": "296239047108",

"view_count": "48",

"pic_url": "!!0-dgshop.jpg",

"detail_url": "//h5.m.taobao.com/taolive/video.html?id=296239047108",

"seller_info": {

"user_num_id": "36453069",

"head_img": "//gdp.alicdn.com/shop-logo/!!6000000005925-0-shopmanager.jpg",

"seller_nick": "寧遠包包"

}

}

]

},

"error": "",

"reason": "",

"error_code": "0000",

"cache": 0,

"api_info": "today:27 max:10000",

"execution_time": 0.637,

"server_time": "Beijing/2021-01-20 16:32:35",

"client_ip": "115.151.186.91",

"call_args": [],

"api_type": "taobao",

"translate_language": "zh-CN",

"translate_engine": "google_cn",

"server_memory": "5.34MB",

"request_id": "4.6007eaa2e0364"

}

文章內容有限,歡迎私信溝通交流。


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70028219/viewspace-2945583/,如需轉載,請註明出處,否則將追究法律責任。

相關文章