公共参数? 查看API完整文档
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
key | String | 是 | 调用key(必须以GET方式拼接在URL中) |
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版本 |
API请求示例
<?php
// 请求示例 url 默认请求参数已经URL编码处理
// 本示例代码未加密secret参数明文传输,若要加密请参考:API文档
$method = "GET";
$url = "https://api-gw.cn/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=";
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_ENCODING, "gzip");
var_dump(curl_exec($curl));
?>
?
响应示例
"items": {
"page": "1",
"real_total_results": 200,
"total_results": 2000,
"page_size": 20,
"pagecount": 100,
"data_from": "szx",
"item": [
{
"title": "秋冬中长款女士毛呢大衣高档柔软面料中老年妈妈女装修身呢子外套",
"pic_url": "http://gw.alicdn.com/i1/832633895/O1CN01v9nrhx1edxYezbajh_!!832633895.jpg",
"orginal_price": "329.8",
"promotion_price": "329.8",
"price": "329.8",
"sales": 1,
"num_iid": "741361161153",
"seller_nick": "啄木鸟运营店",
"detail_url": "https://item.taobao.com/item.htm?id=741361161153"
},
{
"title": "飞行员夹克设计感小众街头棒球服2023新款女装美式复古外套女春秋",
"pic_url": "http://gw.alicdn.com/i2/2187834683/O1CN01t7kDTh1kSrfLoyUfv_!!2187834683.jpg",
"orginal_price": "55.9",
"promotion_price": "55.9",
"price": "55.9",
"sales": 1,
"num_iid": "744425139997",
"seller_nick": "小CC女装小店",
"detail_url": "https://item.taobao.com/item.htm?id=744425139997"
},
{
"title": "外套女春秋2023新款秋装修身套装女装上衣运动粉色棉质卫衣秋季薄",
"pic_url": "http://gw.alicdn.com/i1/2950624550/O1CN01nS6I4u1jTwzT3USqP_!!2950624550.jpg",
"orginal_price": "79.0",
"promotion_price": "79.0",
"price": "79.0",
"sales": 2,
"num_iid": "744703721325",
"seller_nick": "张小瑶同学",
"detail_url": "https://item.taobao.com/item.htm?id=744703721325"
},
{
"title": "2023新款高级设计感洋气ins开衫上衣小香风短款长袖外套女装",
"pic_url": "http://gw.alicdn.com/i1/2832801581/O1CN017Q6zKJ1NY93cQ0rXJ_!!2832801581.jpg",
"orginal_price": "93.6",
"promotion_price": "93.6",
"price": "93.6",
"sales": 1,
"num_iid": "739552657500",
"seller_nick": "墨雾港风休闲女装",
"detail_url": "https://item.taobao.com/item.htm?id=739552657500"
},
{
"title": "欧阳喜《夏日绮梦》新国风女装夏季约会裙子气质少女新中式连衣裙",
"pic_url": "http://gw.alicdn.com/i4/96605289/O1CN012bFthB1owPi1c5yFJ_!!0-item_pic.jpg",
"orginal_price": "158.0",
"promotion_price": "158.0",
"price": "158.0",
"sales": 8,
"num_iid": "719479968768",
"seller_nick": "欧阳喜OYANXI",
"detail_url": "https://item.taobao.com/item.htm?id=719479968768"
},
{
"title": "小妈风连衣裙女包臀裙黑丝搭配的裙子辣妹穿搭秋冬季新款女装套装",
"pic_url": "http://gw.alicdn.com/i1/2215532503471/O1CN013u9ROP1bVldF8XpVB_!!2215532503471.jpg",
"orginal_price": "26.9",
"promotion_price": "26.9",
"price": "26.9",
"sales": 100,
"num_iid": "744926439879",
"seller_nick": "曼茜欣",
"detail_url": "https://item.taobao.com/item.htm?id=744926439879"
},
{
"title": "风衣女士中长款小个子2023春秋季女装新款英伦风大衣外套时尚洋气",
"pic_url": "http://gw.alicdn.com/i2/2187834683/O1CN01fgMsZe1kSrfKhHZaB_!!2187834683.jpg",
"orginal_price": "75.9",
"promotion_price": "75.9",
"price": "75.9",
"sales": 3,
"num_iid": "744691099355",
"seller_nick": "小CC女装小店",
"detail_url": "https://item.taobao.com/item.htm?id=744691099355"
},
{
"title": "连帽卫衣女秋冬2023年女装妈妈上衣冬季加绒加厚洋气外套",
"pic_url": "http://gw.alicdn.com/i4/2960160722/O1CN01vf0Hhe1HCiqZzHn7Q_!!2960160722.jpg",
"orginal_price": "13.8",
"promotion_price": "13.8",
"price": "13.8",
"sales": 20,
"num_iid": "744548004840",
"seller_nick": "AE服饰女装店",
"detail_url": "https://item.taobao.com/item.htm?id=744548004840"
},
{
"title": "纯棉奶乖连帽卫衣女秋冬2023新款小个子宽松字母印花女装秋季上衣",
"pic_url": "http://gw.alicdn.com/i2/2214359593133/O1CN01ceA2Nf1Z0xlbTPEM5_!!2214359593133.jpg",
"orginal_price": "49.88",
"promotion_price": "49.88",
"price": "49.88",
"sales": 6,
"num_iid": "746376707675",
"seller_nick": "欧雅坊精品女装",
"detail_url": "https://item.taobao.com/item.htm?id=746376707675"
},
{
"title": "优衣库男装女装情侣装(UT) kaws卫衣T恤长袖印花运动衫亲子467395",
"pic_url": "http://gw.alicdn.com/i1/196993935/O1CN014uESyl1ewHQwjddBN_!!0-item_pic.jpg",
"orginal_price": "199.0",
"promotion_price": "199.0",
"price": "199.0",
"sales": 500,
"num_iid": "735603199058",
"seller_nick": "优衣库官方旗舰店",
"detail_url": "https://item.taobao.com/item.htm?id=735603199058"
},
{
"title": "优衣库男装女装情侣装(UT) kaws卫衣T恤长袖印花运动衫亲子467773",
"pic_url": "http://gw.alicdn.com/i1/196993935/O1CN01UgzWwH1ewHQsy0l65_!!0-item_pic.jpg",
"orginal_price": "199.0",
"promotion_price": "199.0",
"price": "199.0",
"sales": 1000,
"num_iid": "735606555790",
"seller_nick": "优衣库官方旗舰店",
"detail_url": "https://item.taobao.com/item.htm?id=735606555790"
},
{
"title": "优衣库 宋轶同款 男装女装情侣装UT kaws印花T恤短袖亲子装467775",
"pic_url": "http://gw.alicdn.com/i2/196993935/O1CN01mRnSpr1ewHR2dQ5uF_!!0-item_pic.jpg",
"orginal_price": "99.0",
"promotion_price": "99.0",
"price": "99.0",
"sales": 500,
"num_iid": "735604199230",
"seller_nick": "优衣库官方旗舰店",
"detail_url": "https://item.taobao.com/item.htm?id=735604199230"
},
{
"title": "白色长袖t恤纯棉宽松加绒打底衫女内搭大码上衣秋季新款女装",
"pic_url": "http://gw.alicdn.com/i2/2187834683/O1CN01UB41Mm1kSrfJdews1_!!2187834683.jpg",
"orginal_price": "49.9",
"promotion_price": "49.9",
"price": "49.9",
"sales": 4,
"num_iid": "744695399084",
"seller_nick": "小CC女装小店",
"detail_url": "https://item.taobao.com/item.htm?id=744695399084"
},
{
"title": "早秋装新款妈妈上衣服大码宽松长袖条纹t恤女装体恤内搭打底衫女",
"pic_url": "http://gw.alicdn.com/i4/2960160722/O1CN01oIX6MH1HCiqmtmfcv_!!2960160722.jpg",
"orginal_price": "7.8",
"promotion_price": "7.8",
"price": "7.8",
"sales": 20,
"num_iid": "744553812924",
"seller_nick": "AE服饰女装店",
"detail_url": "https://item.taobao.com/item.htm?id=744553812924"
},
{
"title": "优衣库 男装女装情侣装(UT) kaws印花T恤(短袖亲子装)467525",
"pic_url": "http://gw.alicdn.com/i3/196993935/O1CN01ZcPAli1ewHR4CkgBl_!!0-item_pic.jpg",
"orginal_price": "99.0",
"promotion_price": "99.0",
"price": "99.0",
"sales": 200,
"num_iid": "735461950612",
"seller_nick": "优衣库官方旗舰店",
"detail_url": "https://item.taobao.com/item.htm?id=735461950612"
},
{
"title": "半高领德绒打底衫女装内搭长袖上衣秋冬中领加厚t恤",
"pic_url": "http://gw.alicdn.com/i4/2216751516082/O1CN01Y0LkQ41unblJsfvND_!!2216751516082.jpg",
"orginal_price": "29.9",
"promotion_price": "29.9",
"price": "29.9",
"sales": 10,
"num_iid": "744350316840",
"seller_nick": "晨晨时尚女装",
"detail_url": "https://item.taobao.com/item.htm?id=744350316840"
},
{
"title": "优衣库 男装女装情侣装(UT) kaws印花T恤(短袖亲子装)467774",
"pic_url": "http://gw.alicdn.com/i4/196993935/O1CN01fa7iYx1ewHR28pPQ6_!!0-item_pic.jpg",
"orginal_price": "99.0",
"promotion_price": "99.0",
"price": "99.0",
"sales": 500,
"num_iid": "735602171641",
"seller_nick": "优衣库官方旗舰店",
"detail_url": "https://item.taobao.com/item.htm?id=735602171641"
},
{
"title": "黑色微喇牛仔裤女装小个子高腰喇叭裤修身显瘦复古马蹄裤子春秋",
"pic_url": "http://gw.alicdn.com/i1/2201475355988/O1CN01jOu30Q1u6YWy49la2_!!2201475355988.jpg",
"orginal_price": "49.9",
"promotion_price": "49.9",
"price": "49.9",
"sales": 1,
"num_iid": "744835150284",
"seller_nick": "依岚服装",
"detail_url": "https://item.taobao.com/item.htm?id=744835150284"
},
{
"title": "秋冬新款窄版高腰阔腿裤女小个子女装松紧腰休闲裤加绒垂感长裤",
"pic_url": "http://gw.alicdn.com/i2/2244309596/O1CN01kNuu4N2Kl1SSfx5sy_!!2244309596.jpg",
"orginal_price": "49.0",
"promotion_price": "49.0",
"price": "49.0",
"sales": 5,
"num_iid": "699982776245",
"seller_nick": "都米郡纯棉女装",
"detail_url": "https://item.taobao.com/item.htm?id=699982776245"
},
{
"title": "美式卫衣女装学生韩版宽松潮ins春秋冬季拉链外套加绒加厚连帽bf",
"pic_url": "http://gw.alicdn.com/i3/2692282779/O1CN01sknuw11WOpYMJkuCm_!!2692282779.jpg",
"orginal_price": "48.0",
"promotion_price": "48.0",
"price": "48.0",
"sales": 1,
"num_iid": "742540458371",
"seller_nick": "酱酱欧尼小个子穿搭",
"detail_url": "https://item.taobao.com/item.htm?id=742540458371"
}
],
"item_weight_update": 0
},
?
错误码解释
状态代码(error_code) | 状态信息 | 详细描述 | 是否收费 |
---|---|---|---|
0000 | success | 接口调用成功并返回相关数据 | 是 |
2000 | Search success but no result | 接口访问成功,但是搜索没有结果 | 是 |
4000 | Server internal error | 服务器内部错误 | 否 |
4001 | Network error | 网络错误 | 否 |
4002 | Target server error | 目标服务器错误 | 否 |
4003 | Param error | 用户输入参数错误 | 忽略 |
4004 | Account not found | 用户帐号不存在 | 忽略 |
4005 | Invalid authentication credentials | 授权失败 | 忽略 |
4006 | API stopped | 您的当前API已停用 | 忽略 |
4007 | Account stopped | 您的账户已停用 | 忽略 |
4008 | API rate limit exceeded | 并发已达上限 | 忽略 |
4009 | API maintenance | API维护中 | 忽略 |
4010 | API not found with these values | API不存在 | 忽略 |
4012 | Please add api first | 请先添加api | 忽略 |
4013 | Number of calls exceeded | 调用次数超限 | 忽略 |
4014 | Missing url param | 参数缺失 | 忽略 |
4015 | Wrong pageToken | 参数pageToken有误 | 忽略 |
4016 | Insufficient balance | 余额不足 | 忽略 |
4017 | timeout error | 请求超时 | 否 |
5000 | unknown error | 未知错误 | 否 |
?