大家都知道,淘宝的反爬虫机制十分严,而很多时候,没办法高效的拿到数据内容响应终端需求,而依赖爬虫就会造成动不动就出现滑块验证,让人很无解,正好,公司有这样的需求,让我负责解决这个问题,刚开始各种尝试,始终没有绕过拼多多的滑块验证码,搞了好几天,都没有进展;
然后各种网上资料查询,最终还是不负努力,找到更好的解决方案,让采集不再出现任何滑块验证码,完全解密通过,实现更好的用户体验,已经封装成了淘宝整店商品列表API接口、淘宝商店铺所有商品API接口、淘宝店铺详情API接口,淘宝店铺列表API接口,淘宝店铺商品列表API接口、淘宝APP详情API接口、淘宝详情API接口,淘宝SKU信息接口,淘宝整店商品API接口,可以用于不同的业务场景,且可以高并发调用请求,也封装了包括京东详情接口,1688店铺所有商品接口,抖音店铺所有商品接口,小红书店铺所有商品接口,拼多多店铺所有商品接口均可以适用,支持高并发调用请求,可见其他的文章介绍,希望能够帮助到有需要的朋友,下面是接口代码对接展示:
1.公共参数
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
key | String | 是 | 调用key(必须以GET方式拼接在URL中,点击获取测试key和secret) |
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版本 |
2.请求参数
请求参数:shop_id=433655136&page=1&sort=
参数说明: shop_id:shop_id page:页码
sort:排序[new,bid,sale]
(new 新品,bid:价格,sale:销量,bid加_前缀为从大到小排序)
3.请求示例(CURL、PHP 、PHPsdk 、Java 、C# 、Python…)
# 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://wx19970108018/taobao/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&shop_id=433655136&page=1&sort="
headers = {
"Accept-Encoding": "gzip",
"Connection": "close"
}
if __name__ == "__main__":
r = requests.get(url, headers=headers)
json_obj = r.json()
print(json_obj)
4.响应示例
{
"items": {
"page": "1",
"total_results": "79",
"real_total_results": "79",
"item": [
{
"num_iid": 669226587081,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN019nY7jr1nzKRIsV4mL_!!2209411885160.jpg",
"title": "IFIK Crop Top Baby Tee Y2K鼻祖单品之一 牛仔绣花露脐T恤短袖",
"original_price": "180.00",
"price": "180.00",
"sales": 700,
"detail_url": "//detail.tmall.com/item.htm?id=669226587081"
},
{
"num_iid": 674736794134,
"pic_url": "//img.alicdn.com/bao/uploaded/i2/2209411885160/O1CN01u5KuJI1nzKSmt3oMD_!!2209411885160.jpg",
"title": "IFIK Denim Jumpsuit 90S小辣椒 Polo背心修身洗水黑连体牛仔短裤",
"original_price": "380.00",
"price": "380.00",
"sales": 38,
"detail_url": "//detail.tmall.com/item.htm?id=674736794134"
},
{
"num_iid": 674677242275,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01S2PXJ11nzKSS1sXnF_!!2209411885160.jpg",
"title": "IFIK Denim Mini Skort 白鹿同款 '辣妹教条'牛仔低腰复古短裙裤",
"original_price": "350.00",
"price": "350.00",
"sales": 200,
"detail_url": "//detail.tmall.com/item.htm?id=674677242275"
},
{
"num_iid": 675006395148,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01BoBx2k1nzKSTrlpK5_!!2209411885160.jpg",
"title": "IFIK Leather Jacket 'Hunter复古水洗牛仔拼皮夹克 短款垫肩外套",
"original_price": "580.00",
"price": "580.00",
"sales": 100,
"detail_url": "//detail.tmall.com/item.htm?id=675006395148"
},
{
"num_iid": 674342109993,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01x2oAnJ1nzKSRWjJMF_!!2209411885160.jpg",
"title": "IFIK Bootcut Jeans #1969 50粒铆钉复古高腰微喇重洗水牛仔裤",
"original_price": "400.00",
"price": "400.00",
"sales": 100,
"detail_url": "//detail.tmall.com/item.htm?id=674342109993"
},
{
"num_iid": 668871730997,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01oTX8pT1nzKRJAF4kU_!!2209411885160.jpg",
"title": "IFIK Cargo Pants「工装裤工艺天花板」阔腿口袋洗水牛仔长裤2色",
"original_price": "450.00",
"price": "450.00",
"sales": 100,
"detail_url": "//detail.tmall.com/item.htm?id=668871730997"
},
{
"num_iid": 674677778191,
"pic_url": "//img.alicdn.com/bao/uploaded/i2/2209411885160/O1CN01c1wYun1nzKSibRX4Y_!!2209411885160.jpg",
"title": "IFIK Pink Blazer90s多位重洗水粉色Y2K辣妹牛仔西服垫肩西装外套",
"original_price": "630.00",
"price": "630.00",
"sales": 91,
"detail_url": "//detail.tmall.com/item.htm?id=674677778191"
},
{
"num_iid": 674664614634,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN012rWh6Z1nzKSVHcmx7_!!2209411885160.jpg",
"title": "IFIK Denim Top叛逆摩登 街头涂鸦拼接洗水牛仔短款收腰抹胸吊带",
"original_price": "280.00",
"price": "280.00",
"sales": 85,
"detail_url": "//detail.tmall.com/item.htm?id=674664614634"
},
{
"num_iid": 670709161783,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01EoODNl1nzKSZqqVGU_!!2209411885160.jpg",
"title": "IFIK Ripped Shorts 'Railway叛逆街头翻边破坏高腰热裤牛仔短裤",
"original_price": "330.00",
"price": "330.00",
"sales": 100,
"detail_url": "//detail.tmall.com/item.htm?id=670709161783"
},
{
"num_iid": 658363512622,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01Vykuw11nzKPfz6KiU_!!2209411885160.jpg",
"title": "IFIK Black Wrap Jeans 告别含蓄 腰部不对称绑带镂空修身牛仔裤",
"original_price": "399.00",
"price": "399.00",
"sales": 75,
"detail_url": "//detail.tmall.com/item.htm?id=658363512622"
},
{
"num_iid": 641715452555,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01rAgKuB1nzKRMzQbiG_!!2209411885160.jpg",
"title": "IFIK 辣妹紧身牛仔背心上衣女外穿潮夏季低胸性感设计感短款马甲",
"original_price": "199.00",
"price": "199.00",
"sales": 100,
"detail_url": "//detail.tmall.com/item.htm?id=641715452555"
},
{
"num_iid": 670733077588,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01y21SnV1nzKRqx1cIt_!!2209411885160.jpg",
"title": "IFIK Leg Belt Bag 'Dressage' 月牙形牛仔暗纹绑带腿包迷你包",
"original_price": "380.00",
"price": "380.00",
"sales": 66,
"detail_url": "//detail.tmall.com/item.htm?id=670733077588"
},
{
"num_iid": 671047562893,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01GojMeK1nzKRjZ6atG_!!2209411885160.jpg",
"title": "IFIK Body Chain 于文文同款 金属与牛仔的碰撞Chocker身体链腰链",
"original_price": "180.00",
"price": "180.00",
"sales": 100,
"detail_url": "//detail.tmall.com/item.htm?id=671047562893"
},
{
"num_iid": 670696261652,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01eWda891nzKSWUN4pA_!!2209411885160.jpg",
"title": "IFIK Baggy Jeans#1997复古水洗U形口袋涂鸦低腰拖地阔腿牛仔长裤",
"original_price": "460.00",
"price": "460.00",
"sales": 52,
"detail_url": "//detail.tmall.com/item.htm?id=670696261652"
},
{
"num_iid": 676185010276,
"pic_url": "//img.alicdn.com/bao/uploaded/i4/2209411885160/O1CN01rNs95l1nzKSTVAJ1t_!!2209411885160.png",
"title": "IFIK热卖款套装惊喜盲盒福袋 不退不换不选款(总价值超过500元)",
"original_price": "321.00",
"price": "321.00",
"sales": 52,
"detail_url": "//detail.tmall.com/item.htm?id=676185010276"
},
{
"num_iid": 673964740022,
"pic_url": "//img.alicdn.com/bao/uploaded/i4/2209411885160/O1CN01wncAVf1nzKSnnbEkv_!!2209411885160.jpg",
"title": "IFIK Slit Dress 'WILD'洗水教科书 挂脖收腰A字高开叉牛仔连衣裙",
"original_price": "450.00",
"price": "450.00",
"sales": 32,
"detail_url": "//detail.tmall.com/item.htm?id=673964740022"
},
{
"num_iid": 675014811734,
"pic_url": "//img.alicdn.com/bao/uploaded/i3/2209411885160/O1CN01OZxRMg1nzKSb3SlX0_!!2209411885160.jpg",
"title": "IFIK Strappy Top 美式清爽日常 2重色牛仔绣花上衣罗纹背心吊带",
"original_price": "180.00",
"price": "180.00",
"sales": 87,
"detail_url": "//detail.tmall.com/item.htm?id=675014811734"
},
{
"num_iid": 641715436154,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01W9hDjx1nzKN9QPI0H_!!2209411885160.jpg",
"title": "IFIK Blue Bicolor Logo Jacket “拼出一片天”短款牛仔夹克外套",
"original_price": "449.00",
"price": "449.00",
"sales": 43,
"detail_url": "//detail.tmall.com/item.htm?id=641715436154"
},
{
"num_iid": 653891158457,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01RnUFcu1nzKRCeVWkA_!!2209411885160.jpg",
"title": "IFIK Tribute to Justin Blazer 90年代经典Y2K牛仔西服西装外套",
"original_price": "629.00",
"price": "629.00",
"sales": 40,
"detail_url": "//detail.tmall.com/item.htm?id=653891158457"
},
{
"num_iid": 668082924988,
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2209411885160/O1CN01tEKgwT1nzKRJuGHwZ_!!2209411885160.jpg",
"title": "IFIK Catgirl Top 哥谭黎明'To Dawn on' 系列短款牛仔抹胸上衣",
"original_price": "270.00",
"price": "270.00",
"sales": 55,
"detail_url": "//detail.tmall.com/item.htm?id=668082924988"
}
],
"pagecount": "4",
"page_size": 40,
"_ddf": "yke",
"shop_info": []
},
"error_code": "0000",
"reason": "ok",
"secache": "5177b6f4db5be7bfce9032529452fd88",
"secache_time": 1657097063,
"secache_date": "2022-07-06 16:44:23",
"translate_status": "",
"translate_time": 0,
"language": {
"default_lang": "cn",
"current_lang": "cn"
},
"error": "",
"cache": 1,
"api_info": "today:151 max:10100 all[279=151+79+50];expires:2030-12-31",
"execution_time": "0.291",
"server_time": "Beijing/2022-07-12 09:51:12",
"client_ip": "106.6.35.174",
"call_args": {
"seller_nick": "433655136",
"start_price": "1"
},
"api_type": "taobao",
"translate_language": "zh-CN",
"translate_engine": "baidu_api",
"server_memory": "5.85MB",
"request_id": "gw-3.62ccd3907c926",
"last_id": "1072171781"
}