item_list_weight-批量获取商品信息
taobao.item_list_weight
| 名称 | 类型 | 必须 | 描述 |
|---|---|---|---|
| key | String | 是 | 调用key(调用注测免测*试) |
| 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版本 |
请求参数:num_iids=14905766423,584458528092
参数说明:num_iids:商品id,多个用英文逗号分隔
Version: Date:
| 名称 | 类型 | 必须 | 示例值 | 描述 |
|---|---|---|---|---|
| num_iid | Bigint | 0 | 14905766423 | 宝贝ID |
| weight | Float | 0 | 0.24 | 重量 |
| unit | String | 0 | kg | 单位 |
<?php
// 请求示例 url 默认请求参数已经URL编码处理
// 本示例代码未加密secret参数明文传输,若要加密请参考:https://open.onebound.cn/help/demo/sdk/demo-sign.php
$method = "GET";
$url = "https://api-gw.onebound.cn/taobao/item_list_weight/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iids=14905766423,584458528092";
$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));
?>
参数说明
-
通用参数说明
- 参数不要乱传,否则不管成功失败都会扣费
- url说明 平台:淘宝,京东等, API类型:[item_search,item_get,item_search_shop等]
- version:API版本
- key:调用key,测试key:test_api_key
- secret:调用secret,测试secret:(不用填写)
- cache:[yes,no]默认yes,将调用缓存的数据,速度比较快
- result_type:[json,xml,serialize,var_export]返回数据格式,默认为json
- lang:[cn,en,ru] 翻译语言,默认cn简体中文
- secret:密钥
-
API:item_search 参数说明:
- q:搜索关键字
- cat:分类ID
- start_price:开始价格
- end_price:结束价格
- sort:排序[bid,bid,bid2,_bid2,_sale,_credit]
(bid:总价,bid2:商品价格,sale:销量,credit信用,加前缀为从大到小排序) - page:页数
- page_size:每页宝贝数量,默认40
- seller_info:是否获取商家信息[yes,no],默认yes
-
API:item_get 参数说明: num_iid:宝贝ID