一、API如何使用
1)开发者注册一个账号
2)然后为每个 应用注册一个应用程序键(App Key) 。
3)下载 API的SDK并掌握基本的API基础知识和调用
4)利用SDK接口和对象,传入AppKey或者必要的时候获取并传入SessionKey来进行程序开发。
5)利用平台的文档中心和API测试工具,对接口进行测试。从而了解返回信息,方便程序获取。
以上是一般 API应用开发的关键流程,其中通过文档中心和API测试工具,进行概念了解和接口信息查询很重要。因为这些数据就是我们需要在逐步显示出来的。的API很多,不过都分为了好几个领域,慢慢就会了解深入了。
请求参数
请求参数:num_iid=678950022274&is_promotion=1
参数说明:num_iid:淘宝商品ID
is_promotion:是否获取取促销价
响应示例
{
"item": {
"num_iid": "678950022274",
"title": "Joe/榴莲小熊小木雕金枕榴莲可爱桌面摆件车载创意七夕留恋你礼物",
"desc_short": "",
"price": "56",
"total_price": 0,
"suggestive_price": 0,
"orginal_price": "56.00",
"nick": "小文逛商店",
"num": "200",
"min_num": 0,
"detail_url": "https://item.taobao.com/item.htm?id=678950022274",
"pic_url": "//img.alicdn.com/imgextra/i1/471419967/O1CN012FTj0c2NUwM7qrRIq_!!471419967.jpg",
"brand": "other/其他",
"brandId": "29534",
"rootCatId": "50020808",
"cid": "50020835",
"crumbs": [],
"created_time": "",
"modified_time": "",
"delist_time": "",
"desc": "
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
",
"desc_img": [
"http://img.alicdn.com/imgextra/i2/471419967/O1CN01MB7bth2NUwLxobgs3_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i3/471419967/O1CN01BD5aqL2NUwMOsm6XZ_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i1/471419967/O1CN01To3lle2NUwMVM0yZY_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i4/471419967/O1CN01MEXaBy2NUwMWcj2nT_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i3/471419967/O1CN01E16Mds2NUwLswFxSl_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i3/471419967/O1CN01KObviD2NUwMOBgUDP_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i1/471419967/O1CN01l6MWvv2NUwMEgJECe_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i2/471419967/O1CN01Xyj1hI2NUwMXRgafC_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i1/471419967/O1CN01N3AQsX2NUwMO5ds7k_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i4/471419967/O1CN01V5OFlc2NUwMXRgSIq_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i2/471419967/O1CN01QVhsfF2NUwMOBh9o1_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i1/471419967/O1CN010rUvVz2NUwM4mn7wh_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i3/471419967/O1CN01DZwG1S2NUwMPv9a0Z_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i4/471419967/O1CN012AQXoB2NUwMWcl7kP_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i2/471419967/O1CN01cXaTLu2NUwM4mnGNJ_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i2/471419967/O1CN01xMUENe2NUwMOslu3W_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i4/471419967/O1CN016KvETX2NUwMEgHU4p_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i1/471419967/O1CN01h2j7B02NUwMPv9iLD_!!471419967.jpg",
"http://img.alicdn.com/imgextra/i1/471419967/O1CN01Cta6zs2NUwMScXthm_!!471419967.jpg"
],
"item_imgs": [
{
"url": "//img.alicdn.com/imgextra/i1/471419967/O1CN012FTj0c2NUwM7qrRIq_!!471419967.jpg"
},
{
"url": "//img.alicdn.com/imgextra/i4/471419967/O1CN01acMD7Z2NUwM9pWd8Q_!!471419967.jpg"
},
{
"url": "//img.alicdn.com/imgextra/i3/471419967/O1CN01gVMyKA2NUwM938epi_!!471419967.jpg"
},
{
"url": "//img.alicdn.com/imgextra/i3/471419967/O1CN01U6BAyp2NUwM2OSVk3_!!471419967.jpg"
},
{
"url": "//img.alicdn.com/imgextra/i1/471419967/O1CN01PHoY4g2NUwMBurq0V_!!471419967.jpg"
}
],
"item_weight": "",
"item_size": "",
"location": "福建泉州",
"post_fee": 0,
"express_fee": null,
"ems_fee": "",
"shipping_to": "",
"has_discount": "false",
"video": [],
"is_virtual": "",
"sample_id": "",
"is_promotion": "false",
"props_name": "1627207:7029338609:颜色分类:榴莲小熊 不带布条;1627207:21704644998:颜色分类:榴莲你小熊 带布条;1627207:21678087945:颜色分类:榴莲小熊木盒版",
"prop_imgs": {
"prop_img": [
{
"properties": "1627207:7029338609",
"url": "//img.alicdn.com/imgextra/i2/471419967/O1CN01p1Kw9Y2NUwLuvO4nZ_!!471419967.jpg"
},
{
"properties": "1627207:21704644998",
"url": "//img.alicdn.com/imgextra/i2/471419967/O1CN01Goe0oh2NUwM93t3EC_!!471419967.jpg"
},
{
"properties": "1627207:21678087945",
"url": "//img.alicdn.com/imgextra/i3/471419967/O1CN01U6BAyp2NUwM2OSVk3_!!471419967.jpg"
}
]
},
"property_alias": "",
"props": [
{
"name": "品牌",
"value": "other/其他"
},
{
"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": "朋友"
},
{
"name": "外观造型",
"value": "水果"
},
{
"name": "颜色",
"value": "香槟金"
},
{
"name": "摆件类型",
"value": "手工摆件"
},
{
"name": "修饰词",
"value": "创意"
},
{
"name": "摆放方式",
"value": "摆放"
}
],
"total_sold": "116",
"skus": {
"sku": [
{
"price": "56",
"total_price": 0,
"orginal_price": "56",
"properties": "1627207:7029338609",
"properties_name": "1627207:7029338609:颜色分类:榴莲小熊 不带布条",
"quantity": "200",
"sku_id": "5041667762614"
},
{
"price": "59",
"total_price": 0,
"orginal_price": "59",
"properties": "1627207:21704644998",
"properties_name": "1627207:21704644998:颜色分类:榴莲你小熊 带布条",
"quantity": "200",
"sku_id": "5040823682699"
},
{
"price": "68",
"total_price": 0,
"orginal_price": "68",
"properties": "1627207:21678087945",
"properties_name": "1627207:21678087945:颜色分类:榴莲小熊木盒版",
"quantity": "200",
"sku_id": "5040823682700"
}
]
},
"seller_id": "471419967",
"sales": 1000,
"shop_id": "427423429",
"props_list": {
"1627207:7029338609": "颜色分类:榴莲小熊 不带布条",
"1627207:21704644998": "颜色分类:榴莲你小熊 带布条",
"1627207:21678087945": "颜色分类:榴莲小熊木盒版"
},
"seller_info": {
"nick": "小文逛商店",
"item_score": "4.8 ",
"score_p": "4.9 ",
"delivery_score": "4.9 ",
"shop_type": "C",
"user_num_id": "471419967",
"sid": "427423429",
"title": "Joe的小作坊",
"zhuy": "https://shop427423429.taobao.com/",
"shop_name": "Joe的小作坊"
},
"tmall": false,
"error": "",
"warning": "",
"url_log": [],
"fav_count": "18432",
"fans_count": "5.6万",
"freight": "快递: 快递包邮",
"props_imgs": {
"prop_img": [
{
"properties": "1627207:7029338609",
"url": "//img.alicdn.com/imgextra/i2/471419967/O1CN01p1Kw9Y2NUwLuvO4nZ_!!471419967.jpg"
},
{
"properties": "1627207:21704644998",
"url": "//img.alicdn.com/imgextra/i2/471419967/O1CN01Goe0oh2NUwM93t3EC_!!471419967.jpg"
},
{
"properties": "1627207:21678087945",
"url": "//img.alicdn.com/imgextra/i3/471419967/O1CN01U6BAyp2NUwM2OSVk3_!!471419967.jpg"
}
]
},
"_ddf": "xdl",
"promo_type": null,
"props_img": {
"1627207:7029338609": "//img.alicdn.com/imgextra/i2/471419967/O1CN01p1Kw9Y2NUwLuvO4nZ_!!471419967.jpg",
"1627207:21704644998": "//img.alicdn.com/imgextra/i2/471419967/O1CN01Goe0oh2NUwM93t3EC_!!471419967.jpg",
"1627207:21678087945": "//img.alicdn.com/imgextra/i3/471419967/O1CN01U6BAyp2NUwM2OSVk3_!!471419967.jpg"
},
"format_check": "ok",
"shop_item": [],
"relate_items": []
},
"error": "",
"secache": "ddf407ec82b2c5a67f27747f9ddb9d17",
"secache_time": 1660547295,
"secache_date": "2022-08-15 15:08:15",
"translate_status": "",
"translate_time": 0,
"language": {
"default_lang": "cn",
"current_lang": "cn"
},
"reason": "",
"error_code": "0000",
"cache": 0,
"api_info": "today:221 max:10100 all[277=221+12+44];expires:2030-12-31",
"execution_time": "1.936",
"server_time": "Beijing/2022-08-15 15:08:15",
"client_ip": "106.6.32.219",
"call_args": {
"num_iid": "678950022274",
"is_promotion": "1"
},
"api_type": "taobao",
"translate_language": "zh-CN",
"translate_engine": "google_new",
"server_memory": "5.94MB",
"request_id": "gw-1.62f9f0dd314b7",
"last_id": "1152041651"
}