淘宝/天猫获取sku详细信息API接口(item_sku-获取sku详细信息)代码展示:
1.请求参数 (支持高并发请求响应)
请求参数:num_iid=572050066584&sku_id=3880971359554&is_promotion=0
参数说明:sku_id:SKU ID
num_iid:商品ID
is_promotion:是否获取取促销价
2.公共参数
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
key | String | 是 | 调用key(必须以GET方式拼接在URL中,点击获取请求地址) |
secret | String | 是 | 调用密钥 (接口代码wechat19970108018) |
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版本 |
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_sku/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=572050066584&sku_id=3880971359554&is_promotion=0"
- headers = {
- "Accept-Encoding": "gzip",
- "Connection": "close"
- }
- if __name__ == "__main__":
- r = requests.get(url, headers=headers)
- json_obj = r.json()
- print(json_obj)
4.代码响应示例
- Result Object:
- ---------------------------------------
- {
- "item": {
- "num_iid": "572050066584",
- "name": "尺码:S;颜色分类:白色衬衫",
- "img": "//gd1.alicdn.com/imgextra/i2/3542320334/TB2gPaOyYSYBuNjSspiXXXNzpXa_!!3542320334.jpg",
- "price": 135,
- "orginal_price": 135,
- "express_fee": null,
- "title": "雪纺白色衬衫女长袖面试职业正装2018秋新款OL防走光工作服打底衣",
- "detail_link": "https://item.taobao.com/item.htm?id=572050066584",
- "pic_url": "https://gw.alicdn.com/imgextra/TB2zGWny4SYBuNjSsphXXbGvVXa_!!3542320334.jpg",
- "quantity": 200,
- "properties": "20509:28314;1627207:3714507",
- "sku_id": "3880971359554"
- },
- "secache": "1ada3a5e5067def024375a479537a3f4",
- "secache_time": 1663754072,
- "secache_date": "2022-09-21 17:54:32",
- "error": "",
- "reason": "",
- "error_code": "0000",
- "cache": 0,
- "api_info": "today:132 max:10100 all[268=132+64+72];expires:2030-12-31",
- "execution_time": "2.361",
- "server_time": "Beijing/2022-09-21 17:54:32",
- "client_ip": "106.6.38.190",
- "call_args": {
- "num_iid": "572050066584"
- },
- "api_type": "taobao",
- "translate_language": "zh-CN",
- "translate_engine": "google_new",
- "server_memory": "0.92MB",
- "request_id": "gw-4.632adf566aa10",
- "last_id": "1231508507"
- }