淘宝/天猫的API接口,特别是那些用于获取淘宝app商品详情原数据的接口,提供了强大的功能,使得开发者能够轻松地获取和处理淘宝平台上的商品信息。以下是这些API接口的主要功能:
公共参数
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
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=520813250866
参数说明:num_iid:淘宝商品ID
响应参数
Version: Date:
名称 | 类型 | 必须 | 示例值 | 描述 |
---|---|---|---|---|
item | Mix | 0 | 获得淘宝app商品详情原数据 |
部分响应示例
{
"item": {
"apiStack": [
{
"name": "esi",
"value": {
"consumerProtection": {
"items": [
{
"title": "付款后48小时内发货"
},
{
"desc": "8天退货,退货邮费买家承担",
"title": "8天退货"
},
{
"desc": "商品在运输途中出现破损的,消费者可向卖家提出补寄申请,可补寄1次,补寄邮费由买家承担",
"title": "1次破损补寄"
},
{
"desc": "购买该商品,每笔成交都会有相应金额捐赠给公益。感谢您的支持,愿公益的快乐伴随您每一天。",
"title": "公益宝贝"
},
{
"title": "集分宝"
},
{
"title": "支付宝支付"
}
],
"passValue": "all"
},
"debug": {
"app": "alidetail",
"host": "[email protected]"
},
"delivery": {
"addressWeexUrl": "https://market.m.taobao.com/apps/market/detailrax/address-picker.html?spm=a2116h.app.0.0.16d957e9nDYOzv&wh_weex=true",
"areaId": "330102",
"completedTo": "杭州 上城 小营",
"extras": [],
"from": "广东深圳",
"overseaContraBandFlag": "false",
"postage": "快递: 快递包邮",
"to": "杭州上城"
},
"diversion": {
"detailTopSearch": {
"url": "https://s.m.taobao.com/h5entry?g_channelSrp=detail&placeholder=合法刀 随身&showText=合法刀 随身&g_historyOn=true&g_csearchdoor_spm=a2141.13130650&itemId=520813250866&detailShopId=127203758"
},
"productRecommend": {
"preloadUrl": "https://gw.alicdn.com/tfs/TB1PS8nBAPoK1RjSZKbXXX1IXXa-1125-1335.png?getAvatar=avatar",
"request": {
"api": "mtop.relationrecommend.WirelessRecommend.recommend",
"params": {
"appId": "10777",
"from": "dinamicX",
"params": "{\"itemid\":520813250866,\"spm\":\"0.0.0.0.hUro0P\",\"sellerid\":2596264565,\"appId\":\"10777\"}"
},
"version": "2.0"
},
"template": {
"android": "https://ossgw.alicdn.com/rapid-oss-bucket/template_online/tb_shop_recommend/64005743/tb_shop_recommend_android.xml",
"ios": "https://ossgw.alicdn.com/rapid-oss-bucket/template_online/tb_shop_recommend/64005743/tb_shop_recommend_ios.plist",
"name": "tb_shop_recommend",
"version": "37"
}
}
},
"extendedData": [],
"feature": {
"UTABForceNewSku": "true",
"bigImageSkuProp": "true",
"cainiaoNoramal": "true",
"dailyPrice": "true",
"enableDpbModule": "false",
"freshmanRedPacket": "true",
"guessYouLike": "true",
"hasCoupon": "true",
"hasNewCombo": "false",
"hasSku": "true",
"newAddress": "true",
"newIndicator": "true",
"newPrice": "true",
"newTaobaoActivity": "true",
"noShareGroup": "true",
"openAddOnTools": "false",
"openGradient": "true",
"openNewSku": "true",
"promotion2018": "true",
"promotion2019": "true",
"showSku": "true",
"showSkuThumbnail": "true",
"superActTime": "false",
"taobao2018": "true"
},
"gallery": [],
"hybrid": {
"shopRecommendItems": {
"height": "445",
"spm": "",
"url": "https://market.m.taobao.com/apps/market/detailrax/recommend-shop-bigpage.html?spm=a2116h.app.0.0.16d957e9B7oLGw&wh_weex=true&sellerId=2596264565&itemId=520813250866&detail_v=3.1.1&selfRmdFlag=true"
}
},
"item": {
"couponUrl": "//h5.m.taobao.com/present/hongbao.html?sellerId=2596264565",
"picGallaryOverScroll": {
"mainPic": {
"action": [
{
"fields": {
"url": "https://market.m.taobao.com/app/detail-project/pages/pages/banner-recommend?wx_navbar_hidden=true&_wx_statusbar_hidden=true&wh_weex=true&sellerId=2596264565&shopId=127203758&itemId=520813250866&spm=a2141.7631564&detailAlgoParam=&list_param=&abtest=76992_63166&detailUniqueId=02288d69701058eca52532215b7fed17"
},
"type": "open_url"
},
{
"fields": {
"trackName": "Page_Detail_Button-ItemDetailRecommend",
"trackParams": {
"spm": "a2141.7631564"
}
},
"type": "user_track"
}
],
"text": "滑\n动\n查\n看\n更\n多\n宝\n贝"
}
},
"showShopActivitySize": "2",
"skuText": "请选择 颜色分类 ",
"titleIcon": "",
"vagueSellCount": "16"
},
"layout": {
"config": {
"dependActionConfigID": "TB1Llk4UwHqK1RjSZFEhA3GMXXa",
"dependComponentConfigID": "TB1pw4VcQ9E3KVjSZFGhA319XXa",
"dependThemeConfigID": "TB1MfiMsQyWBuNjy0FphA1ssXXa"
},
"detailTemplateData": {
"homePage": [
{
"ID": "navi_bar",
"id": "navi_bar",
"key": "navi_bar",
"ruleId": ""
},
{
"ID": "pic_gallery",
"id": "pic_gallery",
"key": "pic_gallery",
"ruleId": ""
},
{
"ID": "main_layout",
"children": [
{
"key": "uniform_price",
"ruleId": "TB_default"
},
{
"key": "dinamic",
"ruleId": "tb_detail_price_cheapie_shadow"
},
{
"key": "dinamic",
"ruleId": "tb_detail_price_ttsale_shadow"
},
{
"key": "dinamic",
"ruleId": "TB_jhs_main_Belt_shadow"
},
{
"key": "tip",
"ruleId": "TB_presaleTmall2"
},
{
"key": "tip",
"ruleId": "TB_priceTip2"
},
{
"key": "tip",
"ruleId": "TB_pricedCouponTip2"
},
{
"key": "tip",
"ruleId": "TB_shipTime2"
},
{
"key": "dinamic",
"ruleId": "TB_coupon_promotion2019"
},
{
"key": "dinamic",
"ruleId": "TB_detail_black_card_brand_info"
},
{
"key": "dinamic",
"ruleId": "TB_detail_brand_info"
},
{
"key": "dinamic",
"ruleId": "TB_detail_title_normal"
},
{
"key": "dinamic",
"ruleId": "TB_detail_title_tmallMarket"
},
{
"key": "dinamic",
"ruleId": "TB_detail_title_xinxuan"
},
{
"key": "dinamic",
"ruleId": "TB_detail_kernel_params"
},
{
"key": "dinamic",
"ruleId": "TB_detail_small_activity"
},
{
"key": "dinamic",
"ruleId": "TB_detail_subInfo_default"
},
{
"key": "dinamic",
"ruleId": "TB_detail_appointment_store3"
},
{
"key": "dinamic",
"ruleId": "TB_detail_appointment_store"
},
{
"key": "dinamic",
"ruleId": "TB_detail_divider"
},
{
"key": "dinamic",
"ruleId": "TB_detail_entrance_artascope"
},
{
"key": "dinamic",
"ruleId": "TB_detail_divider"
异常示例
{
"error": "item-not-found",
"reason": "商品没找到",
"error_code": "2000",
"success": 0,
"cache": 0,
"api_info": "today:0 max:10000",
"execution_time": 0.081,
"server_time": "Beijing/2020-06-10 23:44:00",
"call_args": [],
"api_type": "taobao",
"request_id": "15ee0ffc041242"}
错误码解释
状态代码(error_code) | 状态信息 | 详细描述 | 是否收费 |
---|---|---|---|
0000 | success | 接口调用成功并返回相关数据 | 是 |
2000 | Search success but no result | 接口访问成功,但是搜索没有结果 | 是 |
4000 | Server internal error | 服务器内部错误 | 否 |
4001 | Network error | 网络错误 | 否 |
4002 | Target server error | 目标服务器错误 | 否 |
4003 | Param error | 用户输入参数错误 | 忽略 |
4004 | Account not found | 用户帐号不存在 | 忽略 |
4005 | Invalid authentication credentials | 授权失败 | 忽略 |
4006 | API stopped | 您的当前API已停用 | 忽略 |
4007 | Account stopped | 您的账户已停用 | 忽略 |
4008 | API rate limit exceeded | 并发已达上限 | 忽略 |
4009 | API maintenance | API维护中 | 忽略 |
4010 | API not found with these values | API不存在 | 忽略 |
4012 | Please add api first | 请先添加api | 忽略 |
4013 | Number of calls exceeded | 调用次数超限 | 忽略 |
4014 | Missing url param | 参数缺失 | 忽略 |
4015 | Wrong pageToken | 参数pageToken有误 | 忽略 |
4016 | Insufficient balance | 余额不足 | 忽略 |
4017 | timeout error | 请求超时 | 否 |
5000 | unknown error | 未知错误 | 否 |
- 商品信息查询:通过调用API接口,开发者可以查询商品的详细信息,包括商品标题、描述、价格、库存、销量等。这对于构建商品展示、比较和推荐等功能至关重要。
- 店铺信息查询:除了商品信息,API接口还可以提供店铺的相关数据,如店铺名称、信誉等级、店铺评分等。这有助于用户了解卖家的信誉和店铺的经营状况。
- 订单和物流信息查询:对于需要处理订单和物流的应用,API接口也提供了相应的功能。开发者可以通过API接口查询订单的状态、物流信息等,从而为用户提供实时的订单跟踪和物流查询服务。
- 数据分析和处理:通过获取大量的商品和用户数据,开发者可以进行深入的数据分析,了解商品的销售趋势、用户购买行为等。这有助于优化商业模式、提高营销效果,并为业务发展提供决策支持。
总的来说,淘宝/天猫的API接口为开发者提供了丰富的功能,使得他们能够灵活地获取和处理淘宝平台上的数据,从而实现各种应用的需求。需要注意的是,为了使用这些API接口,开发者需要先注册成为淘宝/天猫的开发者,并遵循相应的开发规范和接口文档进行操作。
标签:dinamic,ruleId,TB,app,detail,接口,key,淘宝,true From: https://blog.csdn.net/API_you847337137/article/details/137064986