淘宝商品详情数据接口APP端,H5端代码如下:
公共参数
名称 | 类型 | 必须 | 描述交流中心18179014480 |
---|---|---|---|
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版本 |
请求参数:num_iid=722170765945&is_promotion=1
参数说明:num_iid:淘宝商品ID
is_promotion:是否获取取促销价
请求示例
# 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://api-gw.onebound.cn/taobao/item_get/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=652874751412&is_promotion=1"
headers = {
"Accept-Encoding": "gzip",
"Connection": "close"
}
if __name__ == "__main__":
r = requests.get(url, headers=headers)
json_obj = r.json()
print(json_obj)
响应示例
{
"item": {
"num_iid": "722170765945",
"title": "法式奶fufu蓝色连衣裙女夏季森系泡泡袖碎花收腰显瘦初恋温柔长裙",
"desc_short": "",
"price": "88.00",
"total_price": 0,
"suggestive_price": 0,
"orginal_price": "88.00",
"nick": "时尚巧衣公主店",
"num": "200",
"min_num": 0,
"detail_url": "https://item.taobao.com/item.htm?id=722170765945",
"pic_url": "//img.alicdn.com/imgextra/i4/2535442840/O1CN01AUZsNU1WqlfZuMf9g_!!2535442840.jpg",
"brand": "",
"brandId": null,
"rootCatId": "50010404",
"cid": "121366010",
"crumbs": [],
"created_time": "",
"modified_time": "",
"delist_time": "",
"desc": "<img size=\"219282\">https://img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg</img><img size=\"203520\">https://img.alicdn.com/imgextra/i4/2535442840/O1CN01AUZsNU1WqlfZuMf9g_!!2535442840.jpg</img><img size=\"218964\">https://img.alicdn.com/imgextra/i4/2535442840/O1CN014isU3q1WqlfnerT6o_!!2535442840.jpg</img><img size=\"238416\">https://img.alicdn.com/imgextra/i1/2535442840/O1CN01jZlE0g1WqlffsC9AA_!!2535442840.jpg</img><img src=\"https://www.o0b.cn/i.php?t.png&rid=gw-1.64b74eb7d5842&p=1778786612&k=i_key&t=1689734841\" style=\"display:none\" />",
"desc_img": [],
"item_imgs": [
{
"url": "//img.alicdn.com/imgextra/i4/2535442840/O1CN01AUZsNU1WqlfZuMf9g_!!2535442840.jpg"
},
{
"url": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01jZlE0g1WqlffsC9AA_!!2535442840.jpg"
},
{
"url": "//img.alicdn.com/imgextra/i4/2535442840/O1CN014isU3q1WqlfnerT6o_!!2535442840.jpg"
},
{
"url": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg"
}
],
"item_weight": "",
"item_size": "",
"location": "广东广州",
"post_fee": 0,
"express_fee": null,
"ems_fee": "",
"shipping_to": "",
"has_discount": "false",
"video": {
"url": null
},
"is_virtual": "",
"sample_id": "",
"is_promotion": "false",
"props_name": "1627207:85087968:颜色分类:蓝色S;1627207:37742845:颜色分类:蓝色M;1627207:132231577:颜色分类:蓝色L;1627207:380736480:颜色分类:蓝色XL",
"prop_imgs": {
"prop_img": [
{
"properties": "1627207:85087968",
"url": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg"
},
{
"properties": "1627207:37742845",
"url": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg"
},
{
"properties": "1627207:132231577",
"url": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg"
},
{
"properties": "1627207:380736480",
"url": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg"
}
]
},
"property_alias": "",
"props": [
{
"name": "图案",
"value": "碎花"
},
{
"name": "颜色分类",
"value": "蓝色S,蓝色M,蓝色L,蓝色XL"
}
],
"total_sold": "18",
"skus": {
"sku": [
{
"price": "88",
"total_price": 0,
"orginal_price": "88",
"properties": "1627207:85087968",
"properties_name": "1627207:85087968:颜色分类:蓝色S",
"quantity": "200",
"sku_id": "5025602965769"
},
{
"price": "88",
"total_price": 0,
"orginal_price": "88",
"properties": "1627207:37742845",
"properties_name": "1627207:37742845:颜色分类:蓝色M",
"quantity": "200",
"sku_id": "5025602965770"
},
{
"price": "88",
"total_price": 0,
"orginal_price": "88",
"properties": "1627207:132231577",
"properties_name": "1627207:132231577:颜色分类:蓝色L",
"quantity": "200",
"sku_id": "5025602965771"
},
{
"price": "88",
"total_price": 0,
"orginal_price": "88",
"properties": "1627207:380736480",
"properties_name": "1627207:380736480:颜色分类:蓝色XL",
"quantity": "200",
"sku_id": "5025602965772"
}
]
},
"seller_id": "2535442840",
"sales": 55,
"shop_id": "215477240",
"props_list": {
"1627207:85087968": "颜色分类:蓝色S",
"1627207:37742845": "颜色分类:蓝色M",
"1627207:132231577": "颜色分类:蓝色L",
"1627207:380736480": "颜色分类:蓝色XL"
},
"seller_info": {
"nick": "时尚巧衣公主店",
"item_score": "4.8 ",
"score_p": "4.8 ",
"delivery_score": "4.8 ",
"shop_type": "C",
"user_num_id": "2535442840",
"sid": "215477240",
"title": "MaSAi玛莎",
"zhuy": "https://shop215477240.taobao.com/",
"shop_name": "MaSAi玛莎"
},
"tmall": false,
"error": "",
"warning": "",
"url_log": [],
"fav_count": "914",
"fans_count": "6199",
"freight": "快递: 快递包邮",
"props_imgs": {
"prop_img": [
{
"properties": "1627207:85087968",
"url": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg"
},
{
"properties": "1627207:37742845",
"url": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg"
},
{
"properties": "1627207:132231577",
"url": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg"
},
{
"properties": "1627207:380736480",
"url": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg"
}
]
},
"_ddf": "xdl",
"promo_type": null,
"props_img": {
"1627207:85087968": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg",
"1627207:37742845": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg",
"1627207:132231577": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg",
"1627207:380736480": "//img.alicdn.com/imgextra/i1/2535442840/O1CN01hKjj7t1WqlfZuM3jo_!!2535442840.jpg"
},
"format_check": "ok",
"shop_item": [],
"relate_items": []
},
"error": "",
"secache": "8df7c98f8507c47a16fc524e3b620883",
"secache_time": 1689734841,
"secache_date": "2023-07-19 10:47:21",
"translate_status": "",
"translate_time": 0,
"language": {
"default_lang": "cn",
"current_lang": "cn"
},
"reason": "",
"error_code": "0000",
"cache": 0,
"api_info": "today:189 max:10100 all[4150=189+31+3930];expires:2030-12-31",
"execution_time": "1.89",
"server_time": "Beijing/2023-07-19 10:47:21",
"client_ip": "106.6.33.52",
"call_args": {
"num_iid": "722170765945",
"is_promotion": "1"
},