淘宝开放平台提供了一系列的API接口,允许开发者获取商品的详细信息,包括商品详情、详情图、SKU价格等。以下是淘宝API接口调用的一般指南:
1. **注册账号和获取授权**:首先,需要在淘宝开放平台上注册一个开发者账号,并完成实名认证。注册完成后,你将获得AppKey和AppSecret,这两个参数将在后续的API调用中用到。
2. **获取AccessToken**:AccessToken是淘宝开放平台提供的访问令牌,用于验证开发者的身份。开发者可以通过调用淘宝开放平台的OAuth2.0授权接口来获取AccessToken。
3. **调用商品详情API**:获取到AccessToken后,可以通过调用商品详情API来获取商品的详细信息。API的请求地址通常为`https://api.taobao.com/h5/api/item/detail.htm`,请求参数包括商品ID(item_id)、需要返回的商品字段(fields)和淘宝开放平台提供的AccessToken(access_token)。
4. **获取商品详情**:使用商品详情API可以获取商品的标题、价格、图片等基本信息。你需要提供商品的ID或其他唯一标识作为参数。
item_get-获得淘宝商品详情
taobao.item_get 请求示例 (点击获取测试key和secret)
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
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版本(复制薇:Anzexi58 获取 API SDK文件) |
请求参数:num_iid=652874751412&is_promotion=1
参数说明:num_iid:淘宝商品ID
is_promotion:是否获取取促销价
响应示例
{
"item": {
"num_iid": "724506739969",
"title": "Navigare意大利小帆船卡其色条纹长袖衬衫女新款休闲显瘦打底衬衣",
"desc_short": "",
"price": "535",
"total_price": 0,
"suggestive_price": 0,
"orginal_price": null,
"nick": "navigare纳维凯尔旗舰店",
"num": 87,
"min_num": 0,
"detail_url": "https://item.taobao.com/item.htm?id=724506739969",
"pic_url": "//img.alicdn.com/imgextra/i1/3432100952/O1CN01xtkX9h1Iu3u4ekCXo_!!3432100952-0-lubanu-s.jpg",
"brand": "Navigare/纳维凯尔",
"brandId": null,
"rootCatId": "16",
"cid": "162104",
"crumbs": [],
"created_time": "",
"modified_time": "",
"delist_time": "",
"desc": "<img src=\"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01ka9i9Q1Iu3u2aWPQj_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01WgYLcf1Iu3jMEqSRk_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i2/3432100952/O1CN01Pax66O1Iu3jKzeuX7_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i2/3432100952/O1CN01DZGZN11Iu3jOx0qUz_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i2/3432100952/O1CN01wUmDtp1Iu3jJ33sQy_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01268rA31Iu3jRT7gbT_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01LEpT5a1Iu3jQdK6r3_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01nSV31w1Iu3jPwSzb4_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01IwboQg1Iu3jS4LyLl_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01X0GGZl1Iu3jL3c9Bt_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01tdDJKl1Iu3u4v7HGv_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i3/3432100952/O1CN014hbpvY1Iu3u1tRvne_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01JQ3KqR1Iu3u0h7Dvd_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i1/3432100952/O1CN019mHhcX1Iu3u1tRKMy_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01d11J1d1Iu3jOS2ric_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01c7Yx7a1Iu3jJ32Oxs_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01z1rEDT1Iu3jLWsjOd_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i2/3432100952/O1CN01Yp7g8D1Iu3u2aWCxf_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01a4XZHa1Iu3u82S4BH_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01VMcaWA1Iu3jLWsriI_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01wCVSAK1Iu3jRT7t60_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01eCDtIH1Iu3jMVynGX_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01XdbAPT1Iu3jMErjTE_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01hqLPKB1Iu3u7Me0II_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01PyQMsK1Iu3u82RfCr_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01YXeu6d1Iu3jNeO0f9_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i4/3432100952/O1CN013QbxFe1Iu3jIUbzjO_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01lKSgkM1Iu3jCOdOHM_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01Z4OHjy1Iu3jJ31vqS_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01XTe4Ym1Iu3jCOdFy4_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01OAj46a1Iu3jL3dDj6_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01PiKftY1Iu3jMVuAJk_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01ZL1qnu1Iu3jOx1aFr_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01YtFiJP1Iu3jL3dYVn_!!3432100952.jpg\"/><img src=\"https://img.alicdn.com/imgextra/i2/3432100952/O1CN01m5mXGb1Iu3pQhJJ4n_!!3432100952.jpg\"/>",
"desc_img": [
"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01ka9i9Q1Iu3u2aWPQj_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01WgYLcf1Iu3jMEqSRk_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i2/3432100952/O1CN01Pax66O1Iu3jKzeuX7_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i2/3432100952/O1CN01DZGZN11Iu3jOx0qUz_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i2/3432100952/O1CN01wUmDtp1Iu3jJ33sQy_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01268rA31Iu3jRT7gbT_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01LEpT5a1Iu3jQdK6r3_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01nSV31w1Iu3jPwSzb4_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01IwboQg1Iu3jS4LyLl_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01X0GGZl1Iu3jL3c9Bt_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01tdDJKl1Iu3u4v7HGv_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i3/3432100952/O1CN014hbpvY1Iu3u1tRvne_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01JQ3KqR1Iu3u0h7Dvd_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i1/3432100952/O1CN019mHhcX1Iu3u1tRKMy_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01d11J1d1Iu3jOS2ric_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01c7Yx7a1Iu3jJ32Oxs_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01z1rEDT1Iu3jLWsjOd_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i2/3432100952/O1CN01Yp7g8D1Iu3u2aWCxf_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01a4XZHa1Iu3u82S4BH_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01VMcaWA1Iu3jLWsriI_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01wCVSAK1Iu3jRT7t60_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01eCDtIH1Iu3jMVynGX_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01XdbAPT1Iu3jMErjTE_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01hqLPKB1Iu3u7Me0II_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01PyQMsK1Iu3u82RfCr_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01YXeu6d1Iu3jNeO0f9_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i4/3432100952/O1CN013QbxFe1Iu3jIUbzjO_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01lKSgkM1Iu3jCOdOHM_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i3/3432100952/O1CN01Z4OHjy1Iu3jJ31vqS_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01XTe4Ym1Iu3jCOdFy4_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01OAj46a1Iu3jL3dDj6_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01PiKftY1Iu3jMVuAJk_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i1/3432100952/O1CN01ZL1qnu1Iu3jOx1aFr_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i4/3432100952/O1CN01YtFiJP1Iu3jL3dYVn_!!3432100952.jpg",
"https://img.alicdn.com/imgextra/i2/3432100952/O1CN01m5mXGb1Iu3pQhJJ4n_!!3432100952.jpg"
],
"item_imgs": [
{
"url": "//img.alicdn.com/imgextra/i1/3432100952/O1CN01xtkX9h1Iu3u4ekCXo_!!3432100952-0-lubanu-s.jpg"
},
{
"url": "//img.alicdn.com/imgextra/i2/3432100952/O1CN01Fwrb921Iu3jLZGd8U_!!3432100952-0-lubanu-s.jpg"
},
{
"url": "//img.alicdn.com/imgextra/i2/3432100952/O1CN01Wx2Ynl1Iu3jQdKJEx_!!3432100952.jpg"
},
{
"url": "//img.alicdn.com/imgextra/i2/3432100952/O1CN01T4iAQN1Iu3jIUbiyc_!!3432100952.jpg"
},
{
"url": "//img.alicdn.com/imgextra/i2/3432100952/O1CN01QdGe4G1Iu3jLWrelP_!!3432100952.jpg"
}
],
"item_weight": "",
"item_size": "",
"location": "江苏无锡",
"post_fee": " 免运费",
"express_fee": null,
"ems_fee": "",
"shipping_to": "",
"has_discount": "",
"video": {
"url": "https://cloud.video.taobao.com/play/u/3432100952/p/2/e/6/t/1/308992030477.mp4?appKey=38829"
},
"is_virtual": "",
"sample_id": "",
"is_promotion": "",
"props_name": "20509:28314:尺码:S;20509:28315:尺码:M;20509:28316:尺码:L;20509:28317:尺码:XL;1627207:1658506583:颜色分类:深卡其/灰;1627207:1068806382:颜色分类:豆绿/蓝",
"prop_imgs": {
"prop_img": [
{
"properties": "1627207:1658506583",
"url": "//img.alicdn.com/imgextra/i4/3432100952/O1CN01eatDpU1Iu3jKO8MUV_!!3432100952.jpg"
},
{
"properties": "1627207:1068806382",
"url": "//img.alicdn.com/imgextra/i2/3432100952/O1CN01PkoQep1Iu3jPGlFMu_!!3432100952.jpg"
}
]
},
"property_alias": "",
"props": [
{
"name": "品牌",
"value": "Navigare/纳维凯尔"
},
{
"name": "适用年龄",
"value": "30-34周岁"
},
{
"name": "尺码",
"value": "S M L XL"
},
{
"name": "图案",
"value": "条纹"
},
{
"name": "风格",
"value": "通勤"
},
{
"name": "通勤",
"value": "韩版"
},
{
"name": "领型",
"value": "其他/other"
},
{
"name": "颜色分类",
"value": "深卡其/灰 豆绿/蓝"
},
{
"name": "袖型",
"value": "常规"
},
{
"name": "货号",
"value": "2313041061-242580"
},
{
"name": "年份季节",
"value": "2021年夏季"
},
{
"name": "袖长",
"value": "长袖"
},
{
"name": "衣长",
"value": "常规款"
},
{
"name": "服装版型",
"value": "直筒型"
},
{
"name": "服装款式细节",
"value": "纽扣"
},
{
"name": "销售渠道类型",
"value": "商场同款(线上线下都销售)"
},
{
"name": "材质成分",
"value": "棉96.5% 聚氨酯弹性纤维(氨纶)3.5%"
}
],
"total_sold": "0",
"skus": {
"sku": [
{
"price": 535,
"sub_price": "495",
"total_price": 0,
"orginal_price": 535,
"properties": "1627207:1658506583;20509:28314",
"properties_name": "1627207:1658506583:颜色分类:深卡其/灰;20509:28314:尺码:S",
"quantity": "19",
"sku_id": "5033351197535"
},
{
"price": 535,
"sub_price": "495",
"total_price": 0,
"orginal_price": 535,
"properties": "1627207:1658506583;20509:28315",
"properties_name": "1627207:1658506583:颜色分类:深卡其/灰;20509:28315:尺码:M",
"quantity": "14",
"sku_id": "5033351197536"
},
{
"price": 535,
"sub_price": "495",
"total_price": 0,
"orginal_price": 535,
"properties": "1627207:1658506583;20509:28316",
"properties_name": "1627207:1658506583:颜色分类:深卡其/灰;20509:28316:尺码:L",
"quantity": "2",
"sku_id": "5033351197537"
},
{
"price": 535,
"sub_price": null,
"total_price": 0,
"orginal_price": 535,
"properties": "1627207:1658506583;20509:28317",
"properties_name": "1627207:1658506583:颜色分类:深卡其/灰;20509:28317:尺码:XL",
"quantity": "0",
"sku_id": "5033351197538"
},
{
"price": 535,
"sub_price": "495",
"total_price": 0,
"orginal_price": 535,
"properties": "1627207:1068806382;20509:28314",
"properties_name": "1627207:1068806382:颜色分类:豆绿/蓝;20509:28314:尺码:S",
"quantity": "24",
"sku_id": "5033351197539"
},
{
"price": 535,
"sub_price": "495",
"total_price": 0,
"orginal_price": 535,
"properties": "1627207:1068806382;20509:28315",
"properties_name": "1627207:1068806382:颜色分类:豆绿/蓝;20509:28315:尺码:M",
"quantity": "24",
"sku_id": "5033351197540"
},
{
"price": 535,
"sub_price": "495",
"total_price": 0,
"orginal_price": 535,
"properties": "1627207:1068806382;20509:28316",
"properties_name": "1627207:1068806382:颜色分类:豆绿/蓝;20509:28316:尺码:L",
"quantity": "4",
"sku_id": "5033351197541"
},
{
"price": 535,
"sub_price": null,
"total_price": 0,
"orginal_price": 535,
"properties": "1627207:1068806382;20509:28317",
"properties_name": "1627207:1068806382:颜色分类:豆绿/蓝;20509:28317:尺码:XL",
"quantity": "0",
"sku_id": "5033351197542"
}
]
},
"seller_id": "3432100952",
"sales": 400,
"shop_id": "444933622",
"props_list": {
"20509:28314": "尺码:S",
"20509:28315": "尺码:M",
"20509:28316": "尺码:L",
"20509:28317": "尺码:XL",
"1627207:1658506583": "颜色分类:深卡其/灰",
"1627207:1068806382": "颜色分类:豆绿/蓝"
},
"seller_info": {
"nick": "navigare纳维凯尔旗舰店",
"item_score": "4.8 ",
"score_p": "4.8 ",
"delivery_score": "4.9 ",
"shop_type": "B",
"user_num_id": "3432100952",
"sid": "444933622",
"title": "navigare纳维凯尔旗舰店",
"zhuy": "https://shop444933622.taobao.com/",
"shop_name": "navigare纳维凯尔旗舰店"
},
"tmall": true,
"error": "",
"warning": "",
"url_log": [],
"sub_price": "495",
"fav_count": "1024",
"fans_count": "66.0万",
"freight": "快递: 免运费",
"props_imgs": {
"prop_img": [
{
"properties": "1627207:1658506583",
"url": "//img.alicdn.com/imgextra/i4/3432100952/O1CN01eatDpU1Iu3jKO8MUV_!!3432100952.jpg"
},
{
"properties": "1627207:1068806382",
"url": "//img.alicdn.com/imgextra/i2/3432100952/O1CN01PkoQep1Iu3jPGlFMu_!!3432100952.jpg"
}
]
},
"_ddf": "clo",
"props_img": {
"1627207:1658506583": "//img.alicdn.com/imgextra/i4/3432100952/O1CN01eatDpU1Iu3jKO8MUV_!!3432100952.jpg",
"1627207:1068806382": "//img.alicdn.com/imgextra/i2/3432100952/O1CN01PkoQep1Iu3jPGlFMu_!!3432100952.jpg"
}
},
"secache": "f5f11c8f6d40c039e8507c457536d617",
"secache_time": 1713857503,
"secache_date": "2024-04-23 15:31:43",
"translate_status": "",
"translate_time": 0,
"language": {
"default_lang": "cn",
"current_lang": "cn"
},
"error": "",
"reason": "",
"error_code": "0000",
"cache": 0,
"api_info": "today:168 max:10000 all[302=168+51+83];expires:2030-10-30",
"execution_time": "2.782",
"server_time": "Beijing/2024-04-23 15:31:43",