长话短说,节约彼此宝贵时间,我们以淘宝商品详情数据为例:
请求方式:HTTPS POST GET
请求地址:https://o0b.cn/anzexi
公共参数
名称 | 类型 | 必须 | 描述技术交流18179014480 |
---|---|---|---|
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版本 |
请求参数
请求参数:num_iid=688433900015&is_promotion=1
参数说明:num_iid:淘宝商品ID
is_promotion:是否获取取促销价
请求示例
-- 请求示例 url 默认请求参数已经URL编码处理
curl -i "https://api-gw.onebound.cn/1688/item_get/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=610947572360"
PHP
&secret=<您自己的apiSecret>&num_iid=610947572360";
$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));
?>
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://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": "688433900015",
"title": "OLAMIMI定制 亲子 中性款 加厚加绒保暖休闲棒球服休闲外套",
"desc_short": "",
"price": "155.00",
"total_price": 0,
"suggestive_price": 0,
"orginal_price": "155.00",
"nick": "hohoxixi99",
"num": "61",
"min_num": 0,
"detail_url": "https://item.taobao.com/item.htm?id=688433900015",
"pic_url": "//img.alicdn.com/imgextra/i1/4050655529/O1CN01fNHn1h1qiKde6HkeL_!!4050655529.jpg",
"brand": "other/其他",
"brandId": "29534",
"rootCatId": "50008165",
"cid": "50010518",
"crumbs": [],
"created_time": "",
"modified_time": "",
"delist_time": "",
"desc": " \n \n \n \n \n ",
"desc_img": [],
"item_imgs": [
{
"url": "https://img.alicdn.com/bao/uploaded/i1/4050655529/O1CN01Ha6uhX1qiKdXvLzFK_!!4050655529.jpg"
},
{
"url": "http://img.alicdn.com/imgextra/i1/4050655529/O1CN01X4Ts731qiKdT4kWpj_!!4050655529.jpg"
},
{
"url": "http://img.alicdn.com/imgextra/i4/4050655529/O1CN01zI8LX41qiKdYkhAiG_!!4050655529.jpg"
},
{
"url": "http://img.alicdn.com/imgextra/i1/4050655529/O1CN01cjhMfk1qiKdW32wmu_!!4050655529.jpg"
},
{
"url": "http://img.alicdn.com/imgextra/i3/4050655529/O1CN01Fd6gX51qiKdcGNTqg_!!4050655529.jpg"
}
],
"item_weight": "",
"item_size": "",
"location": "福建福州",
"post_fee": " 10.00",
"express_fee": null,
"ems_fee": "",
"shipping_to": "",
"has_discount": "false",
"video": {
"url": "https://cloud.video.taobao.com/play/u/4050655529/p/2/e/6/t/1/384264855298.mp4?appKey=38829"
},
"is_virtual": "",
"sample_id": "",
"is_promotion": "false",
"props_name": "1627207:8283632:颜色分类:正红 现货;1627207:29720535:颜色分类:米杏 现货;1627207:941220220:颜色分类:正红 预售;1627207:1064474755:颜色分类:米杏 预售;122216343:33273:参考身高:100cm;122216343:568:参考身高:110cm;122216343:50792021:参考身高:120cm;122216343:3285954:参考身高:130cm;122216343:3376466:参考身高:140cm;122216343:917:参考身高:150cm;122216343:26774:参考身高:160cm;122216343:1735712377:参考身高:165cm(亲子)",
"prop_imgs": {
"prop_img": [
{
"properties": "1627207:8283632",
"url": "//img.alicdn.com/imgextra/i1/4050655529/O1CN01X4Ts731qiKdT4kWpj_!!4050655529.jpg"
},
{
"properties": "1627207:29720535",
"url": "//img.alicdn.com/imgextra/i1/4050655529/O1CN01cjhMfk1qiKdW32wmu_!!4050655529.jpg"
},
{
"properties": "1627207:941220220",
"url": "//img.alicdn.com/imgextra/i2/4050655529/O1CN01bP27MQ1qiKddRYUY8_!!4050655529.jpg"
},
{
"properties": "1627207:1064474755",
"url": "//img.alicdn.com/imgextra/i1/4050655529/O1CN01cjhMfk1qiKdW32wmu_!!4050655529.jpg"
}
]
},
"property_alias": "",
"props": [
{
"name": "品牌",
"value": "other/其他"
},
{
"name": "适用年龄",
"value": "13岁"
},
{
"name": "面料",
"value": "其他/other"
},
{
"name": "图案",
"value": "纯色"
},
{
"name": "风格",
"value": "休闲"
},
{
"name": "产地",
"value": "中国大陆"
},
{
"name": "省份",
"value": "福建省"
},
{
"name": "地市",
"value": "福州市"
},
{
"name": "适用性别",
"value": "男女通用"
},
{
"name": "模特实拍",
"value": "实拍有模特"
},
{
"name": "衣门襟",
"value": "套头"
},
{
"name": "是否带帽子",
"value": "否"
},
{
"name": "颜色分类",
"value": "正红,米杏,正红 预售,米杏 预售"
},
{
"name": "货号",
"value": "22444"
},
{
"name": "参考身高",
"value": "100cm,110cm,120cm,130cm,140cm,150cm,160cm,165cm(亲子)"
},
{
"name": "适用季节",
"value": "冬季"
},
{
"name": "厚薄",
"value": "厚款"
},
{
"name": "安全等级",
"value": "B类"
},
{
"name": "材质成分",
"value": "其他材质100%"
}
],
"total_sold": "589",
"skus": {
"sku": [
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:8283632;122216343:33273",
"properties_name": "1627207:8283632:颜色分类:正红 现货;122216343:33273:参考身高:100cm",
"quantity": "12",
"sku_id": "4908646413264"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:8283632;122216343:568",
"properties_name": "1627207:8283632:颜色分类:正红 现货;122216343:568:参考身高:110cm",
"quantity": "18",
"sku_id": "4908646413265"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:8283632;122216343:50792021",
"properties_name": "1627207:8283632:颜色分类:正红 现货;122216343:50792021:参考身高:120cm",
"quantity": "0",
"sku_id": "4908646413266"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:8283632;122216343:3285954",
"properties_name": "1627207:8283632:颜色分类:正红 现货;122216343:3285954:参考身高:130cm",
"quantity": "0",
"sku_id": "4908646413267"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:8283632;122216343:3376466",
"properties_name": "1627207:8283632:颜色分类:正红 现货;122216343:3376466:参考身高:140cm",
"quantity": "0",
"sku_id": "4908646413268"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:8283632;122216343:917",
"properties_name": "1627207:8283632:颜色分类:正红 现货;122216343:917:参考身高:150cm",
"quantity": "0",
"sku_id": "4908646413269"
},
{
"price": "175",
"total_price": 0,
"orginal_price": "175",
"properties": "1627207:8283632;122216343:26774",
"properties_name": "1627207:8283632:颜色分类:正红 现货;122216343:26774:参考身高:160cm",
"quantity": "0",
"sku_id": "4908646413270"
},
{
"price": "205",
"total_price": 0,
"orginal_price": "205",
"properties": "1627207:8283632;122216343:1735712377",
"properties_name": "1627207:8283632:颜色分类:正红 现货;122216343:1735712377:参考身高:165cm(亲子)",
"quantity": "0",
"sku_id": "4908646413271"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:29720535;122216343:33273",
"properties_name": "1627207:29720535:颜色分类:米杏 现货;122216343:33273:参考身高:100cm",
"quantity": "7",
"sku_id": "4908646413272"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:29720535;122216343:568",
"properties_name": "1627207:29720535:颜色分类:米杏 现货;122216343:568:参考身高:110cm",
"quantity": "14",
"sku_id": "4908646413273"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:29720535;122216343:50792021",
"properties_name": "1627207:29720535:颜色分类:米杏 现货;122216343:50792021:参考身高:120cm",
"quantity": "3",
"sku_id": "4908646413274"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:29720535;122216343:3285954",
"properties_name": "1627207:29720535:颜色分类:米杏 现货;122216343:3285954:参考身高:130cm",
"quantity": "6",
"sku_id": "4908646413275"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:29720535;122216343:3376466",
"properties_name": "1627207:29720535:颜色分类:米杏 现货;122216343:3376466:参考身高:140cm",
"quantity": "0",
"sku_id": "4908646413276"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:29720535;122216343:917",
"properties_name": "1627207:29720535:颜色分类:米杏 现货;122216343:917:参考身高:150cm",
"quantity": "0",
"sku_id": "4908646413277"
},
{
"price": "175",
"total_price": 0,
"orginal_price": "175",
"properties": "1627207:29720535;122216343:26774",
"properties_name": "1627207:29720535:颜色分类:米杏 现货;122216343:26774:参考身高:160cm",
"quantity": "0",
"sku_id": "4908646413278"
},
{
"price": "205",
"total_price": 0,
"orginal_price": "205",
"properties": "1627207:29720535;122216343:1735712377",
"properties_name": "1627207:29720535:颜色分类:米杏 现货;122216343:1735712377:参考身高:165cm(亲子)",
"quantity": "1",
"sku_id": "4908646413279"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:941220220;122216343:33273",
"properties_name": "1627207:941220220:颜色分类:正红 预售;122216343:33273:参考身高:100cm",
"quantity": "0",
"sku_id": "4911308829264"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:941220220;122216343:568",
"properties_name": "1627207:941220220:颜色分类:正红 预售;122216343:568:参考身高:110cm",
"quantity": "0",
"sku_id": "4911308829267"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:941220220;122216343:50792021",
"properties_name": "1627207:941220220:颜色分类:正红 预售;122216343:50792021:参考身高:120cm",
"quantity": "0",
"sku_id": "4911308829266"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:941220220;122216343:3285954",
"properties_name": "1627207:941220220:颜色分类:正红 预售;122216343:3285954:参考身高:130cm",
"quantity": "0",
"sku_id": "4911308829263"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:941220220;122216343:3376466",
"properties_name": "1627207:941220220:颜色分类:正红 预售;122216343:3376466:参考身高:140cm",
"quantity": "0",
"sku_id": "4911308829265"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:941220220;122216343:917",
"properties_name": "1627207:941220220:颜色分类:正红 预售;122216343:917:参考身高:150cm",
"quantity": "0",
"sku_id": "4911308829268"
},
{
"price": "175",
"total_price": 0,
"orginal_price": "175",
"properties": "1627207:941220220;122216343:26774",
"properties_name": "1627207:941220220:颜色分类:正红 预售;122216343:26774:参考身高:160cm",
"quantity": "0",
"sku_id": "4911308829262"
},
{
"price": "205",
"total_price": 0,
"orginal_price": "205",
"properties": "1627207:941220220;122216343:1735712377",
"properties_name": "1627207:941220220:颜色分类:正红 预售;122216343:1735712377:参考身高:165cm(亲子)",
"quantity": "0",
"sku_id": "4911308829261"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:1064474755;122216343:33273",
"properties_name": "1627207:1064474755:颜色分类:米杏 预售;122216343:33273:参考身高:100cm",
"quantity": "0",
"sku_id": "4911308829256"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:1064474755;122216343:568",
"properties_name": "1627207:1064474755:颜色分类:米杏 预售;122216343:568:参考身高:110cm",
"quantity": "0",
"sku_id": "4911308829259"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:1064474755;122216343:50792021",
"properties_name": "1627207:1064474755:颜色分类:米杏 预售;122216343:50792021:参考身高:120cm",
"quantity": "0",
"sku_id": "4911308829258"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:1064474755;122216343:3285954",
"properties_name": "1627207:1064474755:颜色分类:米杏 预售;122216343:3285954:参考身高:130cm",
"quantity": "0",
"sku_id": "4911308829255"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:1064474755;122216343:3376466",
"properties_name": "1627207:1064474755:颜色分类:米杏 预售;122216343:3376466:参考身高:140cm",
"quantity": "0",
"sku_id": "4911308829257"
},
{
"price": "155",
"total_price": 0,
"orginal_price": "155",
"properties": "1627207:1064474755;122216343:917",
"properties_name": "1627207:1064474755:颜色分类:米杏 预售;122216343:917:参考身高:150cm",
"quantity": "0",
"sku_id": "4911308829260"
},
{
"price": "175",
"total_price": 0,
"orginal_price": "175",
"properties": "1627207:1064474755;122216343:26774",
"properties_name": "1627207:1064474755:颜色分类:米杏 预售;122216343:26774:参考身高:160cm",
"quantity": "0",
"sku_id": "4911308829254"
},
{
"price": "205",
"total_price": 0,
"orginal_price": "205",
"properties": "1627207:1064474755;122216343:1735712377",
"properties_name": "1627207:1064474755:颜色分类:米杏 预售;122216343:1735712377:参考身高:165cm(亲子)",
"quantity": "0",
"sku_id": "4911308829253"
}
]
},
"seller_id": "4050655529",
"sales": 4,
"shop_id": "292864958",
"props_list": {
"1627207:8283632": "颜色分类:正红 现货",
"1627207:29720535": "颜色分类:米杏 现货",
"1627207:941220220": "颜色分类:正红 预售",
"1627207:1064474755": "颜色分类:米杏 预售",
"122216343:33273": "参考身高:100cm",
"122216343:568": "参考身高:110cm",
"122216343:50792021": "参考身高:120cm",
"122216343:3285954": "参考身高:130cm",
"122216343:3376466": "参考身高:140cm",
"122216343:917": "参考身高:150cm",
"122216343:26774": "参考身高:160cm",
"122216343:1735712377": "参考身高:165cm(亲子)"
},
"seller_info": {
"nick": "hohoxixi99",
"item_score": "4.8 ",
"score_p": "4.9 ",
"delivery_score": "4.9 ",
"shop_type": "C",
"user_num_id": "4050655529",
"sid": "292864958",
"title": "olamimi kids 原创设计",
"zhuy": "https://shop292864958.taobao.com/",
"shop_name": "olamimi kids 原创设计"
},
"tmall": false,
"error": "",
"warning": "",
"url_log": [],
"fav_count": "1632",
"fans_count": "48.6万",
"freight": "快递: 10.00元",
"props_imgs": {
"prop_img": [
{
"properties": "1627207:8283632",
"url": "//img.alicdn.com/imgextra/i1/4050655529/O1CN01X4Ts731qiKdT4kWpj_!!4050655529.jpg"
},
{
"properties": "1627207:29720535",
"url": "//img.alicdn.com/imgextra/i1/4050655529/O1CN01cjhMfk1qiKdW32wmu_!!4050655529.jpg"
},
{
"properties": "1627207:941220220",
"url": "//img.alicdn.com/imgextra/i2/4050655529/O1CN01bP27MQ1qiKddRYUY8_!!4050655529.jpg"
},
{
"properties": "1627207:1064474755",
"url": "//img.alicdn.com/imgextra/i1/4050655529/O1CN01cjhMfk1qiKdW32wmu_!!4050655529.jpg"
}
]
},
"_ddf": "xdl",
"promo_type": null,
"props_img": {
"1627207:8283632": "//img.alicdn.com/imgextra/i1/4050655529/O1CN01X4Ts731qiKdT4kWpj_!!4050655529.jpg",
"1627207:29720535": "//img.alicdn.com/imgextra/i1/4050655529/O1CN01cjhMfk1qiKdW32wmu_!!4050655529.jpg",
"1627207:941220220": "//img.alicdn.com/imgextra/i2/4050655529/O1CN01bP27MQ1qiKddRYUY8_!!4050655529.jpg",
"1627207:1064474755": "//img.alicdn.com/imgextra/i1/4050655529/O1CN01cjhMfk1qiKdW32wmu_!!4050655529.jpg"
},
"format_check": "ok",
"shop_item": [],
"relate_items": []
},
"error": "",
"secache": "34fdd707d1ee41e51ef476f0e9d2d047",
"secache_time": 1690256009,
"secache_date": "2023-07-25 11:33:29",
"translate_status": "",
"translate_time": 0,
"language": {
"default_lang": "cn",
"current_lang": "cn"
},
你可能感兴趣的:(经验分享,淘宝api接口开发系列,1688api接口开发系列,java,开发语言,API接口,python,商品详情数据)