淘宝库存接口如何获取

关注:21 发布时间:2022-01-17 09:12:01

1)打开你的给的商品后发现库存都是个位数,立刻就去随便搜索了一个库存数稍微大一些的商品。( https://item.taobao.com/item.htm?id=531414649886 )

2)打开fiddler发送请求。然后在ctrl+ f搜索了某个sku的库存 "689" 符合条件的只有个位数请求。一眼望过去,有一个域名是:" detailskip.taobao.com " 点开发现包含所有库存信息。 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,确认服务器有验证,观察fiddler中的请求,除了 "referer" 并无其他信息。 "//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": "店铺优惠"

}

],

"def": [

{

"cart": true,

"loginpromotion": false,

"price": "9.90",

"start": false,

"type": "店铺优惠"

}

],

";1627207:1580782454;": [

{

"cart": true,

"loginpromotion": false,

"price": "9.90",

"start": false,

"type": "店铺优惠"

}

],

";1627207:1580782456;": [

{

"cart": true,

"loginpromotion": false,

"price": "9.90",

"start": false,

"type": "店铺优惠"

}

],

";1627207:1580782452;": [

{

"cart": true,

"loginpromotion": false,

"price": "9.90",

"start": false,

"type": "店铺优惠"

}

],

";1627207:1580782453;": [

{

"cart": true,

"loginpromotion": false,

"price": "9.90",

"start": false,

"type": "店铺优惠"

}

],

";1627207:1580782460;": [

{

"cart": true,

"loginpromotion": false,

"price": "9.90",

"start": false,

"type": "店铺优惠"

}

]

},

"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小时内发货"

}

]

}

},

"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天无理由退换货申请的前提下,包邮商品需要买家承担退货邮费,非包邮商品需要买家承担发货和退货邮费。",

"icons": [

"//img.alicdn.com/tps/i1/t1eqa5fpvgxxceop_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": { }

上面是开发技术员比较了解的东西,作为普通的卖家肯定是不会很理解的,总而言之,商家们在设置库存数量的时候一定要多斟酌衡量,不要去夸大其谈,也不可写的太少了,比如说只写几个等情况。

淘宝库存接口

获取到请求地址 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,确认服务器有验证,观察fiddler中的请求,除了 "referer" 并无其他信息。

4)请求时增加个"referer"正常工作.到这里就全部完成了.。

额外提醒。这里并没有验证更多信息,比如说请求次数限制等问题,如果碰到可以尝试抓一下各个平台的接口测试。

需要如下代码:

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小时内发货"

},

{

"id": "100_-7",

"info": "ems ¥12.00",

"markinfo": "20小时内发货"

}

]

}

},

"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天退货,退货邮费买家承担",

"icons": [

"//img.alicdn.com/tps/i2/tb1xy_zgpxxxxbexxxxaz6ufxxx-16-16.png",

null

],

"linktype": 1,

"title": "8天退货"

},

{

"desc": "购买该商品,每笔成交都会有相应金额捐赠给公益。感谢您的支持,愿公益的快乐伴随您每一天。",

"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": "店铺优惠"

}

],

"def": [

{

"cart": true,

"loginpromotion": false,

"price": "9.90",

"start": false,

"type": "店铺优惠"

}

],

";1627207:1580782454;": [

{

"cart": true,

"loginpromotion": false,

"price": "9.90",

"start": false,

"type": "店铺优惠"

}

],

";1627207:1580782456;": [

{

"cart": true,

"loginpromotion": false,

"price": "9.90",

"start": false,

"type": "店铺优惠"

}

],

";1627207:1580782452;": [

{

"cart": true,

"loginpromotion": false,

"price": "9.90",

"start": false,

"type": "店铺优惠"

}

],

";1627207:1580782453;": [

{

"cart": true,

"loginpromotion": false,

"price": "9.90",

"start": false,

"type": "店铺优惠"

}

],

";1627207:1580782460;": [

{

"cart": true,

"loginpromotion": false,

"price": "9.90",

"start": false,

"type": "店铺优惠"

}

]

},

"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小时内发货"

}

]

}

},

"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天无理由退换货申请的前提下,包邮商品需要买家承担退货邮费,非包邮商品需要买家承担发货和退货邮费。",

"icons": [

"//img.alicdn.com/tps/i1/t1eqa5fpvgxxceop_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": { }

上面是开发技术员比较了解的东西,作为普通的卖家肯定是不会很理解的,总而言之,商家们在设置库存数量的时候一定要多斟酌衡量,不要去夸大其谈,也不可写的太少了,比如说只写几个等情况。

淘宝库存接口

猜你喜欢

最新加入十大品牌