前言
item_search-按关键字搜索淘宝商品接口,可以通过关键词搜索请求接口拿到商品列表页面的商品标题,商品价格,商品优惠价,商品视频,商品图片,商品sku属性,商品sku属性描述,发货地,库存,商品销量,店铺优惠券,店铺促销信息等页面上有的数据均可以拿到,以上的数据可以用于行业数据分析,商品搬家业务,商品品牌维护,商品价格监控,商品销量监控,代购商城等业务场景均可以用上,接口代码分享如下:
1.请求参数 (点击获取请求key和secret )
请求参数:q=女装&start_price=0&end_price=0&page=1&cat=0&discount_only=&sort=&page_size=&seller_info=&nick=&ppath=&imgid=&filter=
参数说明:q:搜索关键字
cat:分类ID
start_price:开始价格
end_price:结束价格
sort:排序[bid,_bid,bid2,_bid2,_sale,_credit]
(bid:总价,bid2:商品价格,sale:销量,credit信用,加_前缀为从大到小排序)
page:页数
2.请求代码示例,支持高并发请求(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/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&q=女装&start_price=0&end_price=0&page=1&cat=0&discount_only=&sort=&page_size=&seller_info=&nick=&ppath=&imgid=&filter="
headers = {
"Accept-Encoding": "gzip",
"Connection": "close"
}
if __name__ == "__main__":
r = requests.get(url, headers=headers)
json_obj = r.json()
print(json_obj)
3.接口响应示例
Result Object:标签:url,price,关键词,接口,seller,item,搜索,com,id From: https://blog.51cto.com/u_14655602/5996605
---------------------------------------
{
"items": {
"page": "1",
"real_total_results": 905784,
"total_results": 2000,
"page_size": 20,
"pagecount": 100,
"data_from": "ti",
"item": [
{
"title": "针织衫女半高领打底衫内搭秋冬洋气加绒毛衣2022年新款高级感上衣",
"pic_url": "//img.alicdn.com/bao/uploaded/i4/885825895/O1CN01TzQyD31tPxQlgwZlf_!!885825895.jpg",
"promotion_price": "65.00",
"price": "65.00",
"sales": 30000,
"num_iid": "627717462490",
"seller_nick": "冷冷冷冷的咖啡",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=627717462490"
},
{
"title": "黑色直筒牛仔裤女秋冬加绒大码胖妹妹mm高腰显瘦弹力修容微喇叭裤",
"pic_url": "//img.alicdn.com/bao/uploaded/i4/2027554172/O1CN01CqWZ0H1ggpBcLlknb_!!2027554172.jpg",
"promotion_price": "68.90",
"price": "68.90",
"sales": 10000,
"num_iid": "694704222686",
"seller_nick": "给我一首歌的时间2004",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=694704222686"
},
{
"title": "超厚羊羔绒加绒裤子女冬季运动裤女士外穿宽松纯休闲棉裤加厚卫裤",
"pic_url": "//img.alicdn.com/bao/uploaded/i2/2578013093/O1CN01asO4Dm1YidojS47za_!!2578013093.png",
"promotion_price": "39.00",
"price": "39.00",
"sales": 10000,
"num_iid": "687494628723",
"seller_nick": "三个花没钱没得花",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=687494628723"
},
{
"title": "奶油阔腿裤子女秋冬加绒加厚2022高腰宽松显瘦百搭垂感休闲直筒裤",
"pic_url": "//img.alicdn.com/bao/uploaded/i3/3902150568/O1CN01sS8rxz1G4Bl1WyQgV_!!3902150568.jpg",
"promotion_price": "15.90",
"price": "15.90",
"sales": 10000,
"num_iid": "690751581706",
"seller_nick": "花花笑哈哈3636",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=690751581706"
},
{
"title": "秋冬保暖棉背心女内穿打底衣加绒加厚防寒学生韩版小吊带外穿上衣",
"pic_url": "//img.alicdn.com/bao/uploaded/i3/2200824665381/O1CN01tAjaCQ1pcXwGfUJkm_!!0-item_pic.jpg",
"promotion_price": "9.61",
"price": "9.61",
"sales": 10000,
"num_iid": "658286928617",
"seller_nick": "tb096225082",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=658286928617"
},
{
"title": "半高领打底衫女秋冬高级感内搭毛衣春秋洋气2022新款中领针织上衣",
"pic_url": "//img.alicdn.com/bao/uploaded/i4/885825895/O1CN01Y96Phv1tPxQna9kAw_!!885825895-0-lubanu-s.jpg",
"promotion_price": "39.00",
"price": "39.00",
"sales": 10000,
"num_iid": "627193940947",
"seller_nick": "冷冷冷冷的咖啡",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=627193940947"
},
{
"title": "K姐自制【双重保暖德绒羊毛打底】300克德绒羊毛小高领套头打底衫",
"pic_url": "//img.alicdn.com/bao/uploaded/i1/10550225/O1CN01pHDjxm1DX5v8Uty8s_!!0-item_pic.jpg",
"promotion_price": "79.00",
"price": "79.00",
"sales": 10000,
"num_iid": "694740874666",
"seller_nick": "大弓100",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=694740874666"
},
{
"title": "dmeSTYLE连帽连衣裙女2022秋冬女装显瘦女士裙子",
"pic_url": "//img.alicdn.com/bao/uploaded/i1/3058655500/O1CN011Vitm51qV39x79BTS_!!0-item_pic.jpg",
"promotion_price": "269.00",
"price": "269.00",
"sales": 9000,
"num_iid": "694005208664",
"seller_nick": "dmestyle旗舰店",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=694005208664"
},
{
"title": "毛衣女冬加绒加厚半高领打底衫秋冬高级感内搭2022新款一体绒上衣",
"pic_url": "//img.alicdn.com/bao/uploaded/i4/885825895/O1CN01sO9LVb1tPxWZqsmzD_!!885825895.jpg",
"promotion_price": "69.90",
"price": "69.90",
"sales": 9000,
"num_iid": "657777128585",
"seller_nick": "冷冷冷冷的咖啡",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=657777128585"
},
{
"title": "皮毛一体羊羔毛毛外套女秋冬季麂鹿皮绒机车服夹克高级感大衣女装",
"pic_url": "//img.alicdn.com/bao/uploaded/i4/852258787/O1CN01GP2wJK2EmV20HhIm3_!!852258787.jpg",
"promotion_price": "309.00",
"price": "309.00",
"sales": 9000,
"num_iid": "679991464592",
"seller_nick": "wow芭拉芭拉",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=679991464592"
},
{
"title": "打底衫女内搭秋冬2022新款爆款黑色半高领加绒莫代尔洋气白色上衣",
"pic_url": "//img.alicdn.com/bao/uploaded/i1/885825895/O1CN01ZUL33k1tPxVdVVCAy_!!885825895.jpg",
"promotion_price": "39.00",
"price": "39.00",
"sales": 9000,
"num_iid": "653805002137",
"seller_nick": "冷冷冷冷的咖啡",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=653805002137"
},
{
"title": "韩国chic秋冬复古小个子V领修身打底针织连衣裙女内搭毛衣包臀裙",
"pic_url": "//img.alicdn.com/bao/uploaded/i3/883880594/O1CN01gfGYXw1GG5z8JatYz_!!883880594.png",
"promotion_price": "39.98",
"price": "39.98",
"sales": 8000,
"num_iid": "662598791027",
"seller_nick": "彤宝宝20086",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=662598791027"
},
{
"title": "2022新款轻薄羽绒服女内胆短款圆领内搭外穿薄款女装无领轻便外套",
"pic_url": "//img.alicdn.com/bao/uploaded/i3/2172487769/O1CN01Xwm7Md27GFp8vKmww_!!0-item_pic.jpg",
"promotion_price": "99.00",
"price": "99.00",
"sales": 8000,
"num_iid": "628360471560",
"seller_nick": "思蝶儿旗舰店",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=628360471560"
},
{
"title": "双面德绒半高领打底衫女秋冬大码胖妹妹200斤加绒加厚宽松内搭T恤",
"pic_url": "//img.alicdn.com/bao/uploaded/i3/2126630480/O1CN01hp9o5i1FPsothuyME_!!2126630480.jpg",
"promotion_price": "69.90",
"price": "69.90",
"sales": 8000,
"num_iid": "627509481840",
"seller_nick": "黄泽钦的杂货铺",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=627509481840"
},
{
"title": "白色打底衫女秋冬半高领2022年新款内搭洋气冬季毛衣黑色针织上衣",
"pic_url": "//img.alicdn.com/bao/uploaded/i1/676716255/O1CN01EiPA2j1w4q6tbT1aB_!!676716255.jpg",
"promotion_price": "49.00",
"price": "49.00",
"sales": 8000,
"num_iid": "659661313457",
"seller_nick": "小龙妹0612",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=659661313457"
},
{
"title": "德绒长袖t恤女装2022早春新款秋冬季加厚绒内搭打底衫上衣服ins潮",
"pic_url": "//img.alicdn.com/bao/uploaded/i2/3596248858/O1CN01bI0TMe2FJ13tGWZ9R_!!0-item_pic.jpg",
"promotion_price": "9.90",
"price": "9.90",
"sales": 7000,
"num_iid": "656925689645",
"seller_nick": "追印旗舰店",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=656925689645"
},
{
"title": "春秋新款半高领修身针织打底衫女冬韩版内搭外穿慵懒时尚休闲上衣",
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2200711151795/O1CN01iJZAjP1P89eL6q7lI_!!0-item_pic.jpg",
"promotion_price": "29.90",
"price": "29.90",
"sales": 7000,
"num_iid": "657722405362",
"seller_nick": "南人女装旗舰",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=657722405362"
},
{
"title": "女装连衣裙半身裙直播拍卖",
"pic_url": "//img.alicdn.com/bao/uploaded/i2/2522350351/O1CN01fA86Hu1ESniNTqNXL_!!2522350351.jpg",
"promotion_price": "12.90",
"price": "12.90",
"sales": 6000,
"num_iid": "652901147276",
"seller_nick": "武林盟主vsxiao",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=652901147276"
},
{
"title": "纯棉黑白色小吊带打底背心女款内搭秋冬加绒保暖美背上衣网红超火",
"pic_url": "//img.alicdn.com/bao/uploaded/i1/2200711151795/O1CN011D21ra1P89jb0kOfb_!!0-item_pic.jpg",
"promotion_price": "29.00",
"price": "29.00",
"sales": 6000,
"num_iid": "693979627066",
"seller_nick": "女装旗舰",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=693979627066"
},
{
"title": "U家试衣间2022冬季女长绒摇粒绒保暖茄克长袖开衫立领外套Y439138",
"pic_url": "//img.alicdn.com/bao/uploaded/i3/2207380789080/O1CN014ScMWI2GwgzEl2xxW_!!2207380789080.jpg",
"promotion_price": "35.60",
"price": "35.60",
"sales": 6000,
"num_iid": "655264901742",
"seller_nick": "小蓉儿呀520",
"seller_id": null,
"detail_url": "https://item.taobao.com/item.htm?id=655264901742"
}
],
"item_weight_update": 0
},
"error_code": "0000",
"reason": "ok",
"secache": "a8881ed5637e3c7e84f03acdc86be64f",
"secache_time": 1673146400,
"secache_date": "2023-01-08 10:53:20",
"translate_status": "",
"translate_time": 0,
"language": {
"default_lang": "cn",
"current_lang": "cn"
},
"error": "",
"cache": 0,
"api_info": "today:19 max:10100 all[45=19+11+15];expires:2030-12-31",
"execution_time": "1.888",
"server_time": "Beijing/2023-01-08 10:53:20",
"client_ip": "106.6.32.182",
"call_args": {
"q": "女装",
"start_price": "0",
"end_price": "0",
"page": "1",
"cat": "0"
},
"api_type": "taobao",
"translate_language": "zh-CN",
"translate_engine": "baidu",
"server_memory": "0.93MB",
"request_id": "gw-4.63ba301eb252b",
"last_id": "1462573431"
}