1688開(kāi)放平臺(tái)(1688 Open Platform)的API測(cè)試流程,但針對(duì)1688的B2B業(yè)務(wù)場(chǎng)景有特定要求。以下是詳細(xì)步驟指南:
- 參數(shù)說(shuō)明
- 通用參數(shù)說(shuō)明
- version:API版本
- key:注冊(cè)調(diào)用key, 測(cè)試key:test_api_key
- api_name:API類(lèi)型[item_get,item_search]
- cache:[yes,no]默認(rèn)yes,將調(diào)用緩存的數(shù)據(jù),速度比較快
- result_type:[json,xml,serialize,var_export]返回?cái)?shù)據(jù)格式,默認(rèn)為json
- lang:[cn,en,ru] 翻譯語(yǔ)言,默認(rèn)cn簡(jiǎn)體中文
- API:item_get 參數(shù)說(shuō)明: num_iid:寶貝ID
請(qǐng)求參數(shù)
請(qǐng)求參數(shù):num_iid=610947572360
參數(shù)說(shuō)明:num_iid:1688商品ID
sales_data:&sales_data=1 獲取近30天成交數(shù)據(jù)
agent:&agent=1 獲取1688分銷(xiāo)代發(fā)價(jià)格數(shù)據(jù)
響應(yīng)參數(shù)
Version: Date:
名稱(chēng) | 類(lèi)型 | 必須 | 示例值 | 描述 |
---|---|---|---|---|
item | item[] | 0 | 寶貝詳情數(shù)據(jù) |
請(qǐng)求示例
# coding:utf-8
"""
Compatible for python2.x and python3.x
requirement: pip install requests
"""
from __future__ import print_function
import requests
# 假設(shè)API封裝接口地址 # API_URL = "o0b.cn/ibrad "
# 請(qǐng)求示例 url 默認(rèn)請(qǐng)求參數(shù)已經(jīng)做URL編碼
url = "1688/item_get/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=123456&user_id=12345&nick=浙江祥瓏科技&page=1"
headers = {
"Accept-Encoding": "gzip",
"Connection": "close"
}
if __name__ == "__main__":
r = requests.get(url, headers=headers)
json_obj = r.json()
print(json_obj)
響應(yīng)示例
{
"item":{
"num_iid":601824709263,
"title":"韓版仿兔毛圍巾秋冬毛毛圍巾學(xué)生毛毛絨圍脖冬季女套頭防寒戶(hù)外",
"desc_short":"",
"price":"2.2",
"total_price":0,
"suggestive_price":0,
"orginal_price":"2.2",
"nick":"_sopid@BBBEbRNm7OS0uGCXPJucMBy2w",
"num":3786174,
"min_num":2,
"detail_url":"https://detail.1688.com/offer/601824709263.html",
"pic_url":"https://cbu01.alicdn.com/img/ibank/11921650503_1818272533.jpg",
"brand":"",
"brandId":"",
"rootCatId":0,
"cid":325,
"crumbs":[
],
"created_time":"",
"modified_time":"",
"delist_time":"",
"desc":"<div id=\"offer-template-0\"></div><div > </div>\r\n<div ><span ><strong> <span >材質(zhì):雙面仿兔毛毛絨面料,</span></strong></span></div>\r\n<div ><span ><strong><span >不掉毛(不是薄薄的單面哦)</span></strong></span></div>\r\n<div ><span ><strong ><span >厚款3.39元</span></strong></span></div>\r\n<div ><span ><strong><span ><span >普通款2.38元</span></span></strong></span></div>\r\n<div ><span ><strong><span ><span >每條圍巾都是獨(dú)立OPP袋子包裝,放心選購(gòu)!</span></span></strong></span></div>\r\n<div ><span ><strong><span >現(xiàn)貨供應(yīng),廠家直銷(xiāo),沒(méi)有中間商賺差價(jià),有大量可以談價(jià),有量有價(jià)</span></strong></span></div>\r\n<div ><span ><strong><span >(抖音,快手,直播電商福利品,天貓,淘寶,PDD,跨境電商供應(yīng)商)</span></strong></span></div>\r\n<div ><strong><span ><span ><span >這款圍巾是不掉毛的,有些激光高溫裁剪殘留的浮毛,抖抖就好了哦。</span></span></span></strong></div>\r\n<div > </div>\r\n<div ><span ><img src=\"https://cbu01.alicdn.com/img/ibank/O1CN01emutXa27pyd6vYZzm_!!2206475177847-0-cib.jpg\" alt=\"undefined\"/><br/><strong>此圖拉拉袋包裝的為客戶(hù)定做款(大貨是OPP透明袋獨(dú)立包裝)</strong><br/><img src=\"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01kFnNOl1MP9H5642lo_!!2272041426.jpg\" align=\"absmiddle\"/></span></div>\r\n<div ><img src=\"https://img.alicdn.com/imgextra/i3/2272041426/TB2lZSUX7iHJuJjSZFjXXcGvXXa_!!2272041426.jpg\" align=\"absmiddle\"/><img src=\"https://img.alicdn.com/imgextra/i2/2272041426/TB2rvmVXYSGJuJjSZFqXXXo2pXa_!!2272041426.jpg\" align=\"absmiddle\"/></div>\r\n<div > </div>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01EKuyER1MP9LVqRODf_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01fH7zeu1MP9LXYMDb9_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01o03kWB1MP9LUPh2vD_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i4/2272041426/O1CN01zAl3p11MP9LTi5nZh_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01Zv9KBT1MP9LUIKRow_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01VlbKPj1MP9LU0NVFN_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i4/2272041426/O1CN01MjaoVZ1MP9LTiFjny_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i4/2272041426/O1CN01junsnm1MP9LX5bOdM_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i2/2272041426/O1CN014Dv2oq1MP9LU0KgIb_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i4/2272041426/O1CN01jNA7KZ1MP9LUHdDBF_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01JZW4Hn1MP9LUHd91D_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01nSbj2H1MP9LVqZ2mg_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p><img src=\"https://img.alicdn.com/imgextra/i4/2272041426/O1CN01HmPSpT1MP9LSDyrsr_!!2272041426.jpg\" align=\"absmiddle\"/></p>\r\n<p> </p>\r\n<p> </p>\r\n<div >..........</div><img src=\"https://www.o0b.cn/i.php?t.png&rid=gw-4.65990d0ea4c43&p=1778786759&k=92716&t=1704529167\" style=\"display:none\" />",
"desc_img":[
"https://cbu01.alicdn.com/img/ibank/O1CN01emutXa27pyd6vYZzm_!!2206475177847-0-cib.jpg",
"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01kFnNOl1MP9H5642lo_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i3/2272041426/TB2lZSUX7iHJuJjSZFjXXcGvXXa_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i2/2272041426/TB2rvmVXYSGJuJjSZFqXXXo2pXa_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01EKuyER1MP9LVqRODf_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01fH7zeu1MP9LXYMDb9_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01o03kWB1MP9LUPh2vD_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i4/2272041426/O1CN01zAl3p11MP9LTi5nZh_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01Zv9KBT1MP9LUIKRow_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01VlbKPj1MP9LU0NVFN_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i4/2272041426/O1CN01MjaoVZ1MP9LTiFjny_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i4/2272041426/O1CN01junsnm1MP9LX5bOdM_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i2/2272041426/O1CN014Dv2oq1MP9LU0KgIb_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i4/2272041426/O1CN01jNA7KZ1MP9LUHdDBF_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01JZW4Hn1MP9LUHd91D_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i3/2272041426/O1CN01nSbj2H1MP9LVqZ2mg_!!2272041426.jpg",
"https://img.alicdn.com/imgextra/i4/2272041426/O1CN01HmPSpT1MP9LSDyrsr_!!2272041426.jpg"
],
"item_imgs":[
{
"url":"https://cbu01.alicdn.com/img/ibank/11921650503_1818272533.jpg"
},
{
"url":"https://cbu01.alicdn.com/img/ibank/11921665153_1818272533.jpg"
},
{
"url":"https://cbu01.alicdn.com/img/ibank/11884953047_1818272533.jpg"
},
{
"url":"https://cbu01.alicdn.com/img/ibank/11954549050_1818272533.jpg"
},
{
"url":"https://cbu01.alicdn.com/img/ibank/12483429103_1818272533.jpg"
}
],
"item_weight":"",
"item_size":"",
"location":"浙江省 金華市",
"post_fee":"",
"express_fee":"",
"ems_fee":"",
"shipping_to":"",
"has_discount":"",
"video":"https://cloud.video.taobao.com/play/u/2206475177847/p/1/e/6/t/1/238604472723.mp4",
"is_virtual":"",
"sample_id":"",
"is_promotion":"",
"props_name":"0:0:顏色:紅色;0:1:顏色:黑色;0:2:顏色:白色;0:3:顏色:灰色;0:4:顏色:杏色;0:5:顏色:粉色;0:6:顏色:咖啡色;0:7:顏色:米色;0:8:顏色:卡其色",
"prop_imgs":{
"prop_img":[
{
"properties":"0:0",
"url":"https://cbu01.alicdn.com/img/ibank/11884977080_1818272533.jpg"
},
{
"properties":"0:1",
"url":"https://cbu01.alicdn.com/img/ibank/11954549680_1818272533.jpg"
},
{
"properties":"0:2",
"url":"https://cbu01.alicdn.com/img/ibank/11921650503_1818272533.jpg"
},
{
"properties":"0:3",
"url":"https://cbu01.alicdn.com/img/ibank/11921680795_1818272533.jpg"
},
{
"properties":"0:4",
"url":"https://cbu01.alicdn.com/img/ibank/11954549050_1818272533.jpg"
},
{
"properties":"0:5",
"url":"https://cbu01.alicdn.com/img/ibank/11921689268_1818272533.jpg"
},
{
"properties":"0:6",
"url":"https://cbu01.alicdn.com/img/ibank/11954552765_1818272533.jpg"
},
{
"properties":"0:7",
"url":"https://cbu01.alicdn.com/img/ibank/O1CN01PtW77W27pyekEhcAt_!!2206475177847-0-cib.jpg"
},
{
"properties":"0:8",
"url":"https://cbu01.alicdn.com/img/ibank/O1CN01t2Q1ci27pyjXB0fxo_!!2206475177847-0-cib.jpg"
}
]
},
"property_alias":"0:0:紅色;0:1:黑色;0:2:白色;0:3:灰色;0:4:杏色;0:5:粉色;0:6:咖啡色;0:7:米色;0:8:卡其色",
"props":[
{
"name":"品牌",
"value":"高著"
},
{
"name":"編織方法",
"value":"經(jīng)編"
},
{
"name":"功能",
"value":"保暖"
},
{
"name":"適合季節(jié)",
"value":"冬季"
},
{
"name":"貨號(hào)",
"value":"WJ618"
},
{
"name":"產(chǎn)地",
"value":"浙江義烏"
},
{
"name":"款式",
"value":"中長(zhǎng)"
},
{
"name":"顏色",
"value":"紅色"
},
{
"name":"顏色",
"value":"黑色"
},
{
"name":"顏色",
"value":"白色"
},
{
"name":"顏色",
"value":"灰色"
},
{
"name":"顏色",
"value":"杏色"
},
{
"name":"顏色",
"value":"粉色"
},
{
"name":"顏色",
"value":"咖啡色"
},
{
"name":"顏色",
"value":"米色"
},
{
"name":"顏色",
"value":"卡其色"
},
{
"name":"主要下游平臺(tái)",
"value":"淘寶"
},
{
"name":"主要下游平臺(tái)",
"value":"京東"
},
{
"name":"主要下游平臺(tái)",
"value":"ebay"
},
{
"name":"主要下游平臺(tái)",
"value":"亞馬遜"
},
{
"name":"主要下游平臺(tái)",
"value":"wish"
},
{
"name":"主要下游平臺(tái)",
"value":"快手"
},
{
"name":"主要下游平臺(tái)",
"value":"速賣(mài)通"
},
{
"name":"主要下游平臺(tái)",
"value":"天貓"
},
{
"name":"主要下游平臺(tái)",
"value":"獨(dú)立站"
},
{
"name":"主要下游平臺(tái)",
"value":"LAZADA"
},
{
"name":"主要下游平臺(tái)",
"value":"拼多多"
},
{
"name":"主要下游平臺(tái)",
"value":"抖音"
},
{
"name":"有可授權(quán)的自有品牌",
"value":"否"
},
{
"name":"是否跨境出口專(zhuān)供貨源",
"value":"是"
},
{
"name":"上市年份/季節(jié)",
"value":"2021年秋季"
},
{
"name":"寬度(CM)",
"value":"12cm"
},
{
"name":"風(fēng)格",
"value":"百搭"
},
{
"name":"風(fēng)格",
"value":"優(yōu)雅"
},
{
"name":"風(fēng)格",
"value":"極簡(jiǎn)"
},
{
"name":"風(fēng)格",
"value":"休閑風(fēng)"
},
{
"name":"風(fēng)格",
"value":"時(shí)尚OL"
},
{
"name":"風(fēng)格",
"value":"簡(jiǎn)約"
},
{
"name":"風(fēng)格",
"value":"歐美"
},
{
"name":"風(fēng)格",
"value":"輕奢風(fēng)"
},
{
"name":"風(fēng)格",
"value":"chic風(fēng)"
},
{
"name":"風(fēng)格",
"value":"高級(jí)感"
},
{
"name":"面料名稱(chēng)",
"value":"毛絨"
},
{
"name":"風(fēng)格分類(lèi)",
"value":"時(shí)尚通勤"
},
{
"name":"處理工藝",
"value":"經(jīng)編"
},
{
"name":"流行元素分類(lèi)",
"value":"無(wú)"
}
],
"total_sold":3786174,
"skus":{
"sku":[
{
"price":4.99,
"total_price":4.99,
"orginal price":4.99,
"properties":"0:0",
"properties_name":"0:0:顏色:紅色",
"quantity":0,
"sku_id":5330445855404,
"spec_id":"87b07b1e746bd546e97a0f5888726ae3"
},
{
"price":4.99,
"total_price":4.99,
"orginal price":4.99,
"properties":"0:1",
"properties_name":"0:1:顏色:黑色",
"quantity":0,
"sku_id":5330445855410,
"spec_id":"e664b2e7c4adae52d35767f51a9219f6"
},
{
"price":4.99,
"total_price":4.99,
"orginal price":4.99,
"properties":"0:2",
"properties_name":"0:2:顏色:白色",
"quantity":0,
"sku_id":5330445855398,
"spec_id":"18dc5ba8c7dc3df0eb8b731977df2372"
},
{
"price":4.99,
"total_price":4.99,
"orginal price":4.99,
"properties":"0:3",
"properties_name":"0:3:顏色:灰色",
"quantity":8020,
"sku_id":5330445855408,
"spec_id":"05808df6001a6ffa6fa13ae7df588b36"
},
{
"price":4.99,
"total_price":4.99,
"orginal price":4.99,
"properties":"0:4",
"properties_name":"0:4:顏色:杏色",
"quantity":0,
"sku_id":5330445855412,
"spec_id":"1ab2b4cd3cc2b51ed4055978ca4b8579"
},
{
"price":4.99,
"total_price":4.99,
"orginal price":4.99,
"properties":"0:5",
"properties_name":"0:5:顏色:粉色",
"quantity":0,
"sku_id":5330445855402,
"spec_id":"7a394d5d7d8560fae263cd2ffe9ee444"
},
{
"price":4.99,
"total_price":4.99,
"orginal price":4.99,
"properties":"0:6",
"properties_name":"0:6:顏色:咖啡色",
"quantity":0,
"sku_id":5330445855396,
"spec_id":"423651c0792f75de75484ae9bd5fe535"
},
{
"price":4.99,
"total_price":4.99,
"orginal price":4.99,
"properties":"0:7",
"properties_name":"0:7:顏色:米色",
"quantity":0,
"sku_id":5330445855400,
"spec_id":"45b9c574ac45662aba79f2cb72d20112"
},
{
"price":4.99,
"total_price":4.99,
"orginal price":4.99,
"properties":"0:8",
"properties_name":"0:8:顏色:卡其色",
"quantity":0,
"sku_id":5330445855406,
"spec_id":"f7931f4b9892a8c41b76205cb1d50627"
}
]
},
"seller_id":null,
"sales":0,
"shop_id":null,
"props_list":{
"0:0":"顏色:紅色",
"0:1":"顏色:黑色",
"0:2":"顏色:白色",
"0:3":"顏色:灰色",
"0:4":"顏色:杏色",
"0:5":"顏色:粉色",
"0:6":"顏色:咖啡色",
"0:7":"顏色:米色",
"0:8":"顏色:卡其色"
},
"seller_info":{
"nick":null,
"user_num_id":null,
"sid":null,
"title":null,
"zhuy":null,
"shop_name":null
},
"tmall":"false",
"error":"",
"warning":"",
"url_log":[
],
"unit":null,
"is_support_mix":null,
"mix_amount":null,
"mix_begin":null,
"mix_number":null,
"priceRange":[
[
2,
"2.2"
]
],
"priceRangeOriginal":[
],
"_ddf":"sop",
"props_img":{
"0:0":"https://cbu01.alicdn.com/img/ibank/11884977080_1818272533.jpg",
"0:1":"https://cbu01.alicdn.com/img/ibank/11954549680_1818272533.jpg",
"0:2":"https://cbu01.alicdn.com/img/ibank/11921650503_1818272533.jpg",
"0:3":"https://cbu01.alicdn.com/img/ibank/11921680795_1818272533.jpg",
"0:4":"https://cbu01.alicdn.com/img/ibank/11954549050_1818272533.jpg",
"0:5":"https://cbu01.alicdn.com/img/ibank/11921689268_1818272533.jpg",
"0:6":"https://cbu01.alicdn.com/img/ibank/11954552765_1818272533.jpg",
"0:7":"https://cbu01.alicdn.com/img/ibank/O1CN01PtW77W27pyekEhcAt_!!2206475177847-0-cib.jpg",
"0:8":"https://cbu01.alicdn.com/img/ibank/O1CN01t2Q1ci27pyjXB0fxo_!!2206475177847-0-cib.jpg"
},
"sales_info":{
"seller_num":"",
"repeat_rate_purchase":"",
"per_capita_purchases":"",
"comment_num":"",
"comment_url":""
},
"format_check":"ok",
"shop_item":[
],
"relate_items":[
]
},
"error":"",
"secache":"a1950f8cc13611671db129a5c7ae864a",
"secache_time":1704529167,
"secache_date":"2024-01-06 16:19:27",
"translate_status":"",
"translate_time":0,
"language":{
"default_lang":"cn",
"current_lang":"cn"
},
"reason":"",
"error_code":"0000",
"cache":0,
"api_info":"today:28 max:10000 all[28=28+0+0];expires:2024-05-30",
"execution_time":"0.342",
"server_time":"Beijing/2024-01-06 16:19:27",
"client_ip":"106.6.33.199",
"call_args":{
"num_iid":"601824709263"
},
"api_type":"1688",
"server_memory":"0.92MB",
"request_id":"gw-4.65990d0ea4c43",
"last_id":"2436414138"
}
此API目前支持以下基本接口:
- item_get 獲得1688商品詳情
- item_search 按關(guān)鍵字搜索商品
- item_search_img 按圖搜索1688商品(拍立淘)
- item_search_suggest 獲得搜索詞推薦
- item_fee 獲得商品快遞費(fèi)用
- seller_info 獲得店鋪詳情
- item_search_shop 獲得店鋪的所有商品
- item_password 獲得淘口令真實(shí)url
- upload_img 上傳圖片到1688
- item_search_seller 搜索店鋪列表
- img2text 圖片識(shí)別商品接口
- item_get_app 獲取1688app上原數(shù)據(jù)
- buyer_order_list 獲取購(gòu)買(mǎi)到的商品訂單列表
- cat_get 獲得1688商品分類(lèi)
通過(guò)以上步驟,可完成1688 API 從注冊(cè)到測(cè)試調(diào)用示例,需要后續(xù)開(kāi)發(fā)奠定基礎(chǔ)。