写点什么

淘宝商品详情 API 接口:实时更新商品信息与数据

  • 2024-05-09
    江西
  • 本文字数:7328 字

    阅读完需:约 24 分钟

淘宝(现在通常被称为天猫,属于阿里巴巴集团)的商品详情 API 接口并不是直接面向普通开发者或公众开放的。这些 API 主要用于阿里巴巴集团内部的系统以及与其有合作关系的商家或开发者。


然而,如果你是一个淘宝或天猫的商家,并且你有自己的店铺和商品,你可以通过淘宝或天猫的开放平台(Open Platform)来访问和使用一些 API 接口,以获取和更新你的商品信息。

以下是一些关于如何使用淘宝或天猫 API 的基本步骤:

  1. 注册成为开发者:首先,你需要在淘宝或天猫的开放平台上注册成为开发者,并创建一个应用。

  2. 获取API权限:在注册应用后,你需要申请你想要使用的 API 接口的权限。对于商品详情 API,你可能需要申请“商品”或“商品管理”等相关权限。

  3. 获取 API 密钥:一旦你的 API 权限被批准,你将获得一个 API 密钥(通常包括 App Key 和 App Secret),用于在调用 API 时进行身份验证。

  4. 调用 API:使用你的 API 密钥和相应的 API 端点,你可以编写代码来调用 API 并获取商品信息。对于实时更新商品信息,你可能需要使用一些定时任务或事件触发机制来定期调用 API 并更新你的数据。

  5. 处理 API 响应:API 的响应通常以 JSON 或 XML 格式返回。你需要解析这些响应以获取你需要的商品信息。

  6. 遵守使用限制:请确保你遵守淘宝或天猫 API 的使用限制和政策,否则你的 API 权限可能会被取消。

  7. 参数说明


  1. API:item_search 参数说明:

    q:搜索关键字

    cat:分类 ID

    start_price:开始价格

    end_price:结束价格

    sort:排序[bid,bid,bid2,_bid2,_sale,_credit]


    (bid:总价,bid2:商品价格,sale:销量,credit 信用,加前缀为从大到小排序)

    page:页数

    page_size:每页宝贝数量,默认 40

    seller_info:是否获取商家信息[yes,no],默认 yes

    API:item_get 参数说明: num_iid:宝贝 ID

  2. 此 API 目前支持以下基本接口:

    item_get 获得淘宝商品详情

    item_get_pro 获得淘宝商品详情高级版

    item_review 获得淘宝商品评论

    item_fee 获得淘宝商品快递费用

    item_password 获得淘口令真实 url

    item_list_updown 批量获得淘宝商品上下架时间

    seller_info 获得淘宝店铺详情

    item_search 按关键字搜索淘宝商品

    item_search_tmall 按关键字搜索天猫商品

    item_search_pro 高级关键字搜索淘宝商品

    item_search_img 按图搜索淘宝商品(拍立淘)

    item_search_shop 获得店铺的所有商品

    item_search_seller 搜索店铺列表

    item_search_guang 爱逛街

    item_search_suggest 获得搜索词推荐

    item_search_jupage 天天特价

    item_search_coupon 优惠券查询

    cat_get 获得淘宝分类详情

    item_cat_get 获得淘宝商品类目

    item_search_samestyle 搜索同款的商品

    item_search_similar 搜索相似的商品

    item_sku 获取 sku 详细信息

    item_recommend 获取推荐商品列表

    brand_cat 获取品牌分类列表

    brand_cat_top 获取分类推荐品牌列表

    brand_cat_list 得到指定分类的品牌列表

    brand_keyword_list 得到指定关键词的品牌列表

    brand_info 得到品牌相关信息

    brand_product_list 得到指定品牌的产品

    custom 自定义 API 操作

    buyer_cart_add 添加到购物车

    buyer_cart_remove 删除购物车商品

    buyer_cart_clear 清空购物车

    buyer_cart_list 获取购物车的商品列表

    buyer_cart_order 将购物车商品保存为订单

    buyer_order_list 获取购买到的商品订单列表

    buyer_order_detail 获取购买到的商品订单详情

    buyer_order_express 获取购买到的商品订单物流

    buyer_order_message 获取购买到的订单买家留言

    buyer_address_list 收货地址列表

    buyer_address_clear 清除收货地址

    buyer_address_remove 删除收货地址

    buyer_address_modify 修改收货地址

    buyer_address_add 添加收货地址

    buyer_info 买家信息

    buyer_token 买家 token

    seller_order_list 获取卖出的商品订单列表

    seller_order_detail 获取卖出的商品订单详情

    seller_order_close 卖家关闭一笔交易

    seller_order_message 获取或修改卖出去的订单备注

    seller_auction_list 商品可上下架商品列表

    seller_auction 商品上下架

    seller_item_add 商品上传

    upload_img 上传图片到淘宝

    img2text 图片识别商品接口

    tbk_order_query 淘宝客订单查询

    item_list_weight 批量获取商品信息

    item_history_price 获取商品历史价格信息

    item_get_app 获得淘宝 app 商品详情原数据


taobao.item_get

返回数据示例

"item": {		"num_iid": "652874751412",		"title": "奶油风布艺沙发现代简约轻奢小户型客厅直排可拆洗沙发原木可定制",		"desc_short": "",		"price": 480,		"orginal_price": 480,		"nick": "惜情yqq1127",		"num": 1515,		"pic_url": "https://gw.alicdn.com/bao/uploaded/i4/2568161054/O1CN01aYBriY1Jem9UDtt9e_!!2568161054.jpg",		"brand": "#0 工厂",		"brandId": 0,		"rootCatId": 0,		"cid": 50020632,		"crumbs": null,		"detail_url": "https://item.taobao.com/item.htm?id=652874751412",		"desc": "<div > \n   <div >\n    <img src=\"http://img.alicdn.com/imgextra/i3/2568161054/O1CN01LFmSOU1Jem9QOjMPb_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i3/2568161054/O1CN014vyOOT1Jem9DpHz3Y_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i1/2568161054/O1CN01B3PpsA1Jem9N8V7uf_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i2/2568161054/O1CN015JbyeY1Jem9MZshUt_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i1/2568161054/O1CN01HXSoxx1Jem9RvgzHN_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i3/2568161054/O1CN01IEultA1Jem9MdEx8R_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i3/2568161054/O1CN0176K98O1Jem9QOjE69_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i4/2568161054/O1CN013Pxp1O1Jem9RvgeTv_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i1/2568161054/O1CN01SfyZ8M1Jem9QOi1Gx_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i4/2568161054/O1CN01bb1POa1Jem9Sdgve2_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i3/2568161054/O1CN018Eo9dV1Jem9KV0y79_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i1/2568161054/O1CN01vuEofr1Jem9Nzy9xY_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i4/2568161054/O1CN01qw9sAi1Jem8wkNKpy_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i1/2568161054/O1CN01HeFhFw1Jem8rLnjBY_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i2/2568161054/O1CN01SNgjoi1Jem9QOil15_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i2/2568161054/O1CN01RXf3RA1Jem9DpHVwj_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i4/2568161054/O1CN01gZmZjt1Jem9ISThgm_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i2/2568161054/O1CN01YL0FHM1Jem9PQTjX9_!!2568161054.jpg\"  />\n    <img src=\"http://img.alicdn.com/imgextra/i4/2568161054/O1CN01UhsEhZ1Jem8yvJIhZ_!!2568161054.jpg\"  />\n   </div> \n  </div><img src=\"https://www.o0b.cn/i.php?t.png&rid=gw-4.6636120d3308a&p=2008605577&k=52823&t=1714819597\" style=\"display:none\" />",		"item_imgs": [			{				"url": "//gw.alicdn.com/bao/uploaded/i4/2568161054/O1CN01aYBriY1Jem9UDtt9e_!!2568161054.jpg"			},			{				"url": "//gw.alicdn.com/bao/uploaded/i3/2568161054/O1CN01kjOfNb1Jem9DmWn8Y_!!2568161054.jpg"			},			{				"url": "//gw.alicdn.com/bao/uploaded/i1/2568161054/O1CN01HoB9ha1Jem9DmWn8r_!!2568161054.jpg"			},			{				"url": "//gw.alicdn.com/bao/uploaded/i4/2568161054/O1CN011PjP2P1Jem9MXEUFT_!!2568161054.jpg"			},			{				"url": "//gw.alicdn.com/bao/uploaded/i3/2568161054/O1CN01KUfBFL1Jem9KTTMn1_!!2568161054.jpg"			}		],		"item_weight": 0,		"location": null,		"post_fee": 0,		"express_fee": 0,		"ems_fee": 0,		"shipping_to": "",		"has_discount": "false",		"video": {			"url": "https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/428224913062.mp4"		},		"is_virtual": null,		"sample_id": "",		"is_promotion": "false",		"prop_imgs": {			"prop_img": [				{					"properties": "1627207:28321",					"url": "https://gw.alicdn.com/bao/uploaded/i1/2568161054/O1CN017GTZ4h1Jem9Qra1ap_!!2568161054.jpg"				}			]		},		"property_alias": "",		"props": [			{				"name": "品牌",				"value": "#0 工厂"			},			{				"name": "型号",				"value": "520"			},			{				"name": "材质",				"value": "木"			},			{				"name": "木质材质",				"value": "松木"			},			{				"name": "面料",				"value": "绒布"			},			{				"name": "风格",				"value": "北欧"			},			{				"name": "几人坐",				"value": "脚踏90*60*48cm,双人165*95*67cm,三人210*95*67cm,单人100*95*67cm,四人位240*95*67cm,大四人320*95*76cm,3米贵妃沙发,定制尺寸"			},			{				"name": "颜色分类",				"value": "乳白色"			},			{				"name": "填充物",				"value": "海绵"			},			{				"name": "结构工艺",				"value": "木质工艺"			},			{				"name": "是否可定制",				"value": "是"			},			{				"name": "沙发组合形式",				"value": "U形"			},			{				"name": "是否可拆洗",				"value": "是"			},			{				"name": "适用对象",				"value": "成年人"			},			{				"name": "是否带储物空间",				"value": "否"			},			{				"name": "产地",				"value": "上海"			},			{				"name": "地市",				"value": "上海市"			},			{				"name": "区县",				"value": "奉贤区"			},			{				"name": "是否组装",				"value": "否"			},			{				"name": "出租车是否可运输",				"value": "否"			},			{				"name": "填充物硬度",				"value": "软"			},			{				"name": "款式定位",				"value": "经济型"			}		],		"props_name": "31480:14306495906:几人坐:脚踏90*60*48cm;31480:14306495907:几人坐:双人165*95*67cm;31480:14306495908:几人坐:三人210*95*67cm;31480:14306495909:几人坐:单人100*95*67cm;31480:21480914361:几人坐:四人位240*95*67cm;31480:21480914362:几人坐:大四人320*95*76cm;31480:1387571900:几人坐:3米贵妃沙发;31480:32527954:几人坐:定制尺寸;1627207:28321:颜色分类:乳白色;1627207:28321:颜色分类:乳白色;1627207:28321:颜色分类:乳白色;1627207:28321:颜色分类:乳白色;1627207:28321:颜色分类:乳白色;1627207:28321:颜色分类:乳白色;1627207:28321:颜色分类:乳白色;1627207:28321:颜色分类:乳白色",		"total_sold": 100,		"skus": {			"sku": [				{					"price": 480,					"total_price": 0,					"orginal_price": 480,					"properties": "31480:14306495906;1627207:28321",					"properties_name": "31480:14306495906:几人坐:脚踏90*60*48cm;1627207:28321:颜色分类:乳白色",					"quantity": 200,					"sku_id": "4881047531343"				},				{					"price": 1688,					"total_price": 0,					"orginal_price": 1688,					"properties": "31480:14306495907;1627207:28321",					"properties_name": "31480:14306495907:几人坐:双人165*95*67cm;1627207:28321:颜色分类:乳白色",					"quantity": 129,					"sku_id": "4881047531344"				},				{					"price": 2088,					"total_price": 0,					"orginal_price": 2088,					"properties": "31480:14306495908;1627207:28321",					"properties_name": "31480:14306495908:几人坐:三人210*95*67cm;1627207:28321:颜色分类:乳白色",					"quantity": 186,					"sku_id": "4881047531345"				},				{					"price": 968,					"total_price": 0,					"orginal_price": 968,					"properties": "31480:14306495909;1627207:28321",					"properties_name": "31480:14306495909:几人坐:单人100*95*67cm;1627207:28321:颜色分类:乳白色",					"quantity": 200,					"sku_id": "4881047531346"				},				{					"price": 2388,					"total_price": 0,					"orginal_price": 2388,					"properties": "31480:21480914361;1627207:28321",					"properties_name": "31480:21480914361:几人坐:四人位240*95*67cm;1627207:28321:颜色分类:乳白色",					"quantity": 200,					"sku_id": "5039985183001"				},				{					"price": 3188,					"total_price": 0,					"orginal_price": 3188,					"properties": "31480:21480914362;1627207:28321",					"properties_name": "31480:21480914362:几人坐:大四人320*95*76cm;1627207:28321:颜色分类:乳白色",					"quantity": 200,					"sku_id": "5039985183002"				},				{					"price": 3400,					"total_price": 0,					"orginal_price": 3400,					"properties": "31480:1387571900;1627207:28321",					"properties_name": "31480:1387571900:几人坐:3米贵妃沙发;1627207:28321:颜色分类:乳白色",					"quantity": 200,					"sku_id": "5039984824000"				},				{					"price": 3000,					"total_price": 0,					"orginal_price": 3000,					"properties": "31480:32527954;1627207:28321",					"properties_name": "31480:32527954:几人坐:定制尺寸;1627207:28321:颜色分类:乳白色",					"quantity": 200,					"sku_id": "5039985183003"				}			]		},		"seller_id": "2568161054",		"shop_id": "567158267",		"props_list": {			"31480:14306495906": "几人坐:脚踏90*60*48cm",			"31480:14306495907": "几人坐:双人165*95*67cm",			"31480:14306495908": "几人坐:三人210*95*67cm",			"31480:14306495909": "几人坐:单人100*95*67cm",			"31480:21480914361": "几人坐:四人位240*95*67cm",			"31480:21480914362": "几人坐:大四人320*95*76cm",			"31480:1387571900": "几人坐:3米贵妃沙发",			"31480:32527954": "几人坐:定制尺寸",			"1627207:28321": "颜色分类:乳白色"		},		"seller_info": {			"nick": "惜情yqq1127",			"item_score": 5,			"score_p": 5,			"delivery_score": 5,			"shop_type": "",			"user_num_id": "2568161054",			"sid": null,			"title": "",			"zhuy": "https://shop567158267.taobao.com",			"cert": null,			"open_time": "",			"credit_score": "tb-rank-blue:4",			"shop_name": "佑安居"		},		"tmall": false,		"update_time": "2024-05-04 18:46:37",		"data_up": "40504184637",		"data_f": "ha",		"data_from": "hid",		"promo_type": null,		"props_img": {			"1627207:28321": "https://gw.alicdn.com/bao/uploaded/i1/2568161054/O1CN017GTZ4h1Jem9Qra1ap_!!2568161054.jpg"		},		"error": null,		"format_check": "ok",		"sales": 0,		"desc_img": [			"http://img.alicdn.com/imgextra/i3/2568161054/O1CN01LFmSOU1Jem9QOjMPb_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i3/2568161054/O1CN014vyOOT1Jem9DpHz3Y_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i1/2568161054/O1CN01B3PpsA1Jem9N8V7uf_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i2/2568161054/O1CN015JbyeY1Jem9MZshUt_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i1/2568161054/O1CN01HXSoxx1Jem9RvgzHN_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i3/2568161054/O1CN01IEultA1Jem9MdEx8R_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i3/2568161054/O1CN0176K98O1Jem9QOjE69_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i4/2568161054/O1CN013Pxp1O1Jem9RvgeTv_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i1/2568161054/O1CN01SfyZ8M1Jem9QOi1Gx_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i4/2568161054/O1CN01bb1POa1Jem9Sdgve2_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i3/2568161054/O1CN018Eo9dV1Jem9KV0y79_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i1/2568161054/O1CN01vuEofr1Jem9Nzy9xY_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i4/2568161054/O1CN01qw9sAi1Jem8wkNKpy_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i1/2568161054/O1CN01HeFhFw1Jem8rLnjBY_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i2/2568161054/O1CN01SNgjoi1Jem9QOil15_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i2/2568161054/O1CN01RXf3RA1Jem9DpHVwj_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i4/2568161054/O1CN01gZmZjt1Jem9ISThgm_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i2/2568161054/O1CN01YL0FHM1Jem9PQTjX9_!!2568161054.jpg",			"http://img.alicdn.com/imgextra/i4/2568161054/O1CN01UhsEhZ1Jem8yvJIhZ_!!2568161054.jpg",			"https://www.o0b.cn/i.php?t.png&rid=gw-4.6636120d3308a&p=2008605577&k=52823&t=1714819597"		],		"shop_item": [],		"relate_items": []	},	"error": "",	"secache": "4ad7ad2480af253fec9c2fd4daa266bb",	"secache_time": 1715217857,	"secache_date": "2024-05-09 09:24:17",	"translate_status": "",
复制代码


用户头像

还未添加个人签名 2023-11-13 加入

还未添加个人简介

评论

发布
暂无评论
淘宝商品详情API接口:实时更新商品信息与数据_API 编排_技术冰糖葫芦_InfoQ写作社区