淘寶庫存接口如何獲取
2023-01-06| 10:35|發(fā)布在分類/淘寶知識|閱讀:74
2023-01-06| 10:35|發(fā)布在分類/淘寶知識|閱讀:74
本文主題淘寶,淘寶郵商,淘寶問答。
對于店鋪的寶貝來說,設(shè)置淘寶庫存數(shù)量也很重不要,可以在一定程度上影響到店鋪的銷量。比如說看到庫存的數(shù)量比較的少了,很多的客戶就會急著下單購買,怎么獲取淘寶庫存接口呢?
1)打開你的給的商品后發(fā)現(xiàn)庫存都是個位數(shù),立刻就去隨便搜索了一個庫存數(shù)稍微大一些的商品。(https://item.taobao.com/item.htm?id=531414649886)
2)打開Fiddler發(fā)送請求。然后在Ctrl+F搜索了某個SKU的庫存"689"符合條件的只有個位數(shù)請求。一眼望過去,有一個域名是:"detailskip.taobao.com"點開發(fā)現(xiàn)包含所有庫存信息。
獲取到請求地址https://detailskip.taobao.com/service/getData/1/p2/item/detail/sib.htm?itemId=528392541802&modules=qrcode,viewer,price,contract,duty,xmpPromotion,dynStock
,delivery,upp,sellerDetail,activity,fqg,zjys,coupon&callback=onSibRequestSuccess
3)將請求中的itemId的值換成需要獲取的商品ID,直接瀏覽器請求,返回403,確認服務(wù)器有驗證,觀察Fiddler中的請求,除了"Referer"并無其他信息。
4)請求時增加個"Referer"正常工作.到這里就全部完成了.。
額外提醒。這里并沒有驗證更多信息,比如說請求次數(shù)限制等問題,如果碰到可以嘗試抓一下各個平臺的接口測試。
需要如下代碼:
header={
"referer":"https://item.taobao.com/item.htm?id=524122865207"
}
{
"code":{
"code":0,
"message":"SUCCESS"
},
"data":{
"viewer":{
"admin":false,
"bs":"",
"buyDomain":"buy.taobao.com",
"buyerId":"",
"cartDomain":"cart.taobao.com",
"cc":false,
"ctUser":false,
"lgin":false,
"serviceTab":"ITEM",
"tkn":"eb11b76383e61"
},
"deliveryFee":{
"data":{
"areaId":440300,
"areaName":"廣東深圳",
"sendCity":"江蘇南京",
"serviceInfo":{
"list":[
{
"id":"100_-4",
"info":"快遞免運費",
"isDefault":true,
"markInfo":"20小時內(nèi)發(fā)貨"
},
{
"id":"100_-7",
"info":"EMS¥12.00",
"markInfo":"20小時內(nèi)發(fā)貨"
}
]
}
},
"dataUrl":"//detailskip.taobao.com/json/deliveryFee.htm",
"message":"ok",
"success":true
},
"activity":{},
"originalPrice":{
";1627207:1580782459;":{
"price":"13.80"
},
";1627207:1580782454;":{
"price":"13.80"
},
"def":{
"price":"13.80"
},
";1627207:1580782456;":{
"price":"13.80"
},
";1627207:1580782452;":{
"price":"13.80"
},
";1627207:1580782453;":{
"price":"13.80"
},
";1627207:1580782460;":{
"price":"13.80"
}
},
"price":"13.80",
"tradeContract":{
"pay":[
{
"icons":[
"//img.alicdn.com/tfs/TB1KTHfQFXXXXbnXFXXXXXXXXXX-16-16.png",
"//img.alicdn.com/tfs/TB1XeDvQFXXXXc5XXXXXXXXXXXX-32-32.png"
],
"title":"螞蟻花唄",
"url":"//payservice.alipay.com/intro/index.htm?c=hb"
},
{
"icons":[
"//img.alicdn.com/tfs/TB1dvGWQFXXXXcFaXXXXXXXXXXX-16-16.png",
"//img.alicdn.com/tfs/TB1FdDlQFXXXXa5XpXXXXXXXXXX-32-32.png"
],
"title":"集分寶",
"url":"//jf.alipay.com"
}
],
"service":[
{
"desc":"8天退貨,退貨郵費買家承擔(dān)",
"icons":[
"//img.alicdn.com/tps/i2/TB1XY_zGpXXXXbeXXXXAz6UFXXX-16-16.png",
null
],
"linkType":1,
"title":"8天退貨"
},
{
"desc":"購買該商品,每筆成交都會有相應(yīng)金額捐贈給公益。感謝您的支持,愿公益的快樂伴隨您每一天。",
"icons":[
"//img.alicdn.com/tfs/TB1wj5PQFXXXXX8apXXXXXXXXXX-16-16.png",
"//img.alicdn.com/tfs/TB13FrcQFXXXXaKXVXXXXXXXXXX-32-32.png"
],
"linkType":2,
"title":"公益寶貝",
"url":"//service.taobao.com/support/knowledge-1117985.htm?spm=0.0.0.0.bOwpfZ&dkey=searchview"
}
]
},
"dynStock":{
"holdQuantity":0,
"sellableQuantity":10968,
"sku":{
";1627207:1580782459;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":24,
"stock":24
},
";1627207:1580782454;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":456,
"stock":456
},
";1627207:1580782456;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":436,
"stock":436
},
";1627207:1580782452;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":102,
"stock":102
},
";1627207:1580782453;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":9349,
"stock":9349
},
";1627207:1580782460;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":601,
"stock":601
}
},
"stock":10968,
"stockType":"normal"
},
"qrcodeImgUrl":"//gcodex.alicdn.com/qrcode.do?biz_code=xcode&short_name=a.ZRs8&cmd=createSub?m=id:541869292523;scm:20140619.pc_detail.itemId.0",
"couponActivity":{
"buyerHasMianxi":false,
"coupon":{},
"showMianxiTips":false
},
"soldQuantity":{
"confirmGoodsCount":0,
"soldTotalCount":0
},
"promotion":{
"promoData":{
";1627207:1580782459;":[
{
"cart":true,
"loginPromotion":false,
"price":"9.90",
"start":false,
"type":"店鋪優(yōu)惠"
}
],
"def":[
{
"cart":true,
"loginPromotion":false,
"price":"9.90",
"start":false,
"type":"店鋪優(yōu)惠"
}
],
";1627207:1580782454;":[
{
"cart":true,
"loginPromotion":false,
"price":"9.90",
"start":false,
"type":"店鋪優(yōu)惠"
}
],
";1627207:1580782456;":[
{
"cart":true,
"loginPromotion":false,
"price":"9.90",
"start":false,
"type":"店鋪優(yōu)惠"
}
],
";1627207:1580782452;":[
{
"cart":true,
"loginPromotion":false,
"price":"9.90",
"start":false,
"type":"店鋪優(yōu)惠"
}
],
";1627207:1580782453;":[
{
"cart":true,
"loginPromotion":false,
"price":"9.90",
"start":false,
"type":"店鋪優(yōu)惠"
}
],
";1627207:1580782460;":[
{
"cart":true,
"loginPromotion":false,
"price":"9.90",
"start":false,
"type":"店鋪優(yōu)惠"
}
]
},
"saleDetailMap":{}
}
}
}
{
"code":{
"code":0,
"message":"SUCCESS"
},
"data":{
"viewer":{
"admin":false,
"bs":"",
"buyDomain":"buy.taobao.com",
"buyerId":"",
"cartDomain":"cart.taobao.com",
"cc":false,
"countryCode":"CN",
"ctUser":false,
"lgin":false,
"serviceTab":"ITEM",
"tkn":"73e34e3a76d31"
},
"deliveryFee":{
"data":{
"areaId":440300,
"areaName":"廣東深圳",
"sendCity":"江蘇南京",
"serviceInfo":{
"list":[
{
"id":"100_-4",
"info":"快遞免運費",
"isDefault":true,
"markInfo":"72小時內(nèi)發(fā)貨"
}
]
}
},
"dataUrl":"//detailskip.taobao.com/json/deliveryFee.htm",
"message":"ok",
"success":true
},
"activity":{},
"originalPrice":{
";1627207:1580782458;":{
"price":"12.00"
},
";1627207:1580782459;":{
"price":"12.00"
},
";1627207:1580782454;":{
"price":"12.00"
},
"def":{
"price":"12.00"
},
";1627207:1580782455;":{
"price":"12.00"
},
";1627207:1580782456;":{
"price":"12.00"
},
";1627207:1580782452;":{
"price":"12.00"
},
";1627207:1580782453;":{
"price":"12.00"
},
";1627207:1580782460;":{
"price":"12.00"
}
},
"price":"12.00",
"tradeContract":{
"pay":[
{
"icons":[
"//img.alicdn.com/tfs/TB1dvGWQFXXXXcFaXXXXXXXXXXX-16-16.png",
"//img.alicdn.com/tfs/TB1FdDlQFXXXXa5XpXXXXXXXXXX-32-32.png"
],
"title":"集分寶",
"url":"//jf.alipay.com"
}
],
"service":[
{
"desc":"滿足7天無理由退換貨申請的前提下,包郵商品需要買家承擔(dān)退貨郵費,非包郵商品需要買家承擔(dān)發(fā)貨和退貨郵費。",
"icons":[
"//img.alicdn.com/tps/i1/T1EQFpVgXXceOP_X-16-16.jpg",
null
],
"linkType":1,
"title":"7天無理由"
}
]
},
"dynStock":{
"holdQuantity":0,
"sellableQuantity":12377,
"sku":{
";1627207:1580782458;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":193,
"stock":193
},
";1627207:1580782459;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":36,
"stock":36
},
";1627207:1580782454;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":523,
"stock":523
},
";1627207:1580782455;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":181,
"stock":181
},
";1627207:1580782456;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":590,
"stock":590
},
";1627207:1580782452;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":354,
"stock":354
},
";1627207:1580782453;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":9806,
"stock":9806
},
";1627207:1580782460;":{
"holdQuantity":0,
"oversold":false,
"sellableQuantity":694,
"stock":694
}
},
"stock":12377,
"stockType":"normal"
},
"qrcodeImgUrl":"//gcodex.alicdn.com/qrcode.do?biz_code=xcode&short_name=a.ZRs8&cmd=createSub?m=id:561456069595;scm:20140619.pc_detail.itemId.0",
"couponActivity":{
"buyerHasMianxi":false,
"coupon":{},
"showMianxiTips":false
},
"soldQuantity":{
"confirmGoodsCount":1,
"soldTotalCount":4
},
"promotion":{
"promoData":{},
"saleDetailMap":{}
上面是開發(fā)技術(shù)員比較了解的東西,作為普通的賣家肯定是不會很理解的,總而言之,商家們在設(shè)置庫存數(shù)量的時候一定要多斟酌衡量,不要去夸大其談,也不可寫的太少了,比如說只寫幾個等情況。
幕思城為您更新最近最有用的電商資訊、電商規(guī)則淘寶,淘寶郵商淘寶問答。了解更多電商資訊、行業(yè)動向,記得關(guān)注幕思城!
這個問題還有疑問的話,可以加幕.思.城火星老師免費咨詢,微.信號是為: msc496。