API是应用程序的开发接口,在开发程序的时候,我们有些功能可能不需要从到到位去研发,我们可以拿现有的开发出来的功能模块来使用,而这个功能模块,就叫做库(libary)。比如说:要实现数据传输的安全,这就要使用加密技术,使用加密技术就要用到加密算法,而加密算法,已经有好心人,帮我们开发出来了加密算法库,你直接就可以调用,不需要再开发算法。
1、公共参数
名称 | 类型 | 必须 | 描述 |
key | String | 是 | 调用key(免费获取测试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版本 |
2、请求参数
请求参数:num_iid=520813250866&is_promotion=1
参数说明:num_iid:淘宝商品ID
is_promotion:是否获取取促销价
3、代码展示
{
"item": {
"num_iid": "671470326240",
"title": "商场倒闭清仓捡漏美式军旅风工装衬衫男复古长袖衬衣耐脏磨工作服",
"desc_short": "",
"price": 6,
"orginal_price": 256,
"nick": "雄哥范250538267",
"num": 2400,
"pic_url": "https://gw.alicdn.com/imgextra/O1CN01LLYd672HU7wBVekGG_!!2510809153.jpg",
"brand": null,
"brandId": 0,
"rootCatId": 0,
"cid": 50010158,
"crumbs": null,
"detail_url": "https://item.taobao.com/item.htm?id=671470326240",
"desc": "<img width=\"750\"
"props": [
{
"name": "品牌",
"value": "other/其他"
},
{
"name": "尺码",
"value": "M,L,XL,2XL"
},
{
"name": "图案",
"value": "纯色"
},
{
"name": "领型",
"value": "翻领"
},
{
"name": "衣门襟",
"value": "单排扣"
},
{
"name": "颜色",
"value": "灰色,卡其色,白色长袖内搭"
},
{
"name": "袖型",
"value": "收口袖"
},
{
"name": "货号",
"value": "85"
},
{
"name": "细分风格",
"value": "潮"
},
{
"name": "基础风格",
"value": "青春流行"
},
{
"name": "适用季节",
"value": "春秋"
},
{
"name": "上市年份季节",
"value": "2022年春季"
},
{
"name": "袖长",
"value": "长袖"
},
{
"name": "厚薄",
"value": "常规"
},
{
"name": "适用场景",
"value": "其他休闲"
},
{
"name": "衣长",
"value": "常规款"
},
{
"name": "版型",
"value": "标准"
},
{
"name": "工艺处理",
"value": "水洗"
},
{
"name": "适用对象",
"value": "青年"
},
{
"name": "下摆设计",
"value": "本布下摆"
},
{
"name": "穿搭方式",
"value": "外穿"
}
],
"props_name": "20509:6145171:尺码:2XL;20509:28317:尺码:XL;20509:28316:尺码:L;20509:28315:尺码:M;20509:28315:尺码:M;20509:6145171:尺码:2XL;20509:28316:尺码:L;20509:28317:尺码:XL;20509:28317:尺码:XL;20509:28316:尺码:L;20509:6145171:尺码:2XL;20509:28315:尺码:M;1627207:28334:颜色:灰色;1627207:28334:颜色:灰色;1627207:28334:颜色:灰色;1627207:28334:颜色:灰色;1627207:28331:颜色:卡其色;1627207:28331:颜色:卡其色;1627207:28331:颜色:卡其色;1627207:28331:颜色:卡其色;1627207:831436512:颜色:白色长袖内搭;1627207:831436512:颜色:白色长袖内搭;1627207:831436512:颜色:白色长袖内搭;1627207:831436512:颜色:白色长袖内搭",
"total_sold": 268,
"skus": {
"sku": [
{
"price": 32.8,
"total_price": 0,
"orginal_price": 280,
"properties": "20509:6145171;1627207:28334",
"properties_name": "20509:6145171:尺码:2XL;1627207:28334:颜色:灰色",
"quantity": 200,
"sku_id": "4832897101543"
},
{
"price": 12.8,
"total_price": 0,
"orginal_price": 260,
"properties": "20509:6145171;1627207:831436512",
"properties_name": "20509:6145171:尺码:2XL;1627207:831436512:颜色:白色长袖内搭",
"quantity": 200,
"sku_id": "4832897101545"
},
{
"price": 6,
"total_price": 0,
"orginal_price": 256,
"properties": "20509:28315;1627207:831436512",
"properties_name": "20509:28315:尺码:M;1627207:831436512:颜色:白色长袖内搭",
"quantity": 200,
"sku_id": "4832897101536"
}
]
},
"seller_id": "2510809153",
"shop_id": "135326082",
"props_list": {
"20509:28315": "尺码:M",
"20509:28316": "尺码:L",
"20509:28317": "尺码:XL",
"20509:6145171": "尺码:2XL",
"1627207:28334": "颜色:灰色",
"1627207:28331": "颜色:卡其色",
"1627207:831436512": "颜色:白色长袖内搭"
},
"seller_info": {
"nick": "雄哥范250538267",
"item_score": 4.62959,
"score_p": 4.72707,
"delivery_score": 4.78939,
"shop_type": "",
"user_num_id": "2510809153",
"sid": "135326082",
"title": "",
"zhuy": "https://shop135326082.taobao.com",
"cert": null,
"open_time": "6年老店",
"credit_score": "tb-rank-cap:5",
"shop_name": "xiaojun's studio"
},
"tmall": false,
"update_time": "2022-07-25 00:10:08",
"data_update": "2022-07-25 00:10:08",
"data_f": "Ha",
"data_from": "hid",
"promo_type": null,
"props_img": {
"1627207:28334": "//gd4.alicdn.com/imgextra/i3/2510809153/O1CN01gytGlJ2HU7wCg03xa_!!2510809153.jpg",
"1627207:28331": "//gd1.alicdn.com/imgextra/i4/2510809153/O1CN01znB9Vf2HU7w7svOUl_!!2510809153.jpg",
"1627207:831436512": "//gd2.alicdn.com/imgextra/i3/2510809153/O1CN019BXQPJ2HU7wAll36j_!!2510809153.jpg"
},
"error": null,
"format_check": "ok",
"sales": 0,
"desc_img": [
"http://img.alicdn.com/imgextra/i4/2510809153/O1CN013JWvFo2HU7w1OFpoa_!!2510809153.jpg",
"http://img.alicdn.com/imgextra/i2/2510809153/O1CN01UKixzj2HU7wAlkRin_!!2510809153.jpg",
"http://img.alicdn.com/imgextra/i4/2510809153/O1CN01Z9I48H2HU7w7swbMQ_!!2510809153.jpg",
"http://img.alicdn.com/imgextra/i1/2510809153/O1CN01taTIjy2HU7w59CflO_!!2510809153.jpg",
"http://img.alicdn.com/imgextra/i4/2510809153/O1CN01O20Qsf2HU7vzsrlLt_!!2510809153.jpg",
"http://img.alicdn.com/imgextra/i1/2510809153/O1CN01gsgkM42HU7wAllFaK_!!2510809153.jpg",
"https://www.o0b.cn/i.php?t.png&rid=gw-3.62dd6ede7c096&p=2990497081&k=e.com&t=1658679008"
],
"shop_item": [],
"relate_items": []
},
"error": "",
"secache": "3f18d63eb67be12438974172a81d8594",
"secache_time": 1666573152,
"secache_date": "2022-10-24 08:59:12",
"translate_status": "",
"translate_time": 0,
"language": {
"default_lang": "cn",
"current_lang": "cn"
},
"reason": "",
"error_code": "0000",
"cache": 0,
"api_info": "today:1 max:10000 all[19=1+0+18];expires:2030-12-31",
"execution_time": "0.243",
"server_time": "Beijing/2022-10-24 08:59:12",
"client_ip": "117.170.201.38",
"call_args": {
"num_iid": "671470326240",
"is_promotion": "1"
},
"api_type": "taobao",
"translate_language": "zh-CN",
"translate_engine": "google_new",
"server_memory": "0.91MB",
"request_id": "gw-4.6355e36099e3b",
"last_id": "1306659669"
}