接口使用场景等说明:本接口可以获取淘宝或天猫的全网产品详情信息:
包括:
1、完整版:
完整版详情返回值内容包括:
1.商品SKU信息
2.卖家详细信息:商家头像,评分,店铺名,等级,销量等等。
3.产品规格信息
4.淘宝/天猫商品的销量信息,以及月销量信息。
5.头部商品评论信息,和商品评价关键字
2、简版详情:
可获取商品标题,图片,旺旺名称,店铺名称这些字段。
本接口不局限于淘宝客商品,未加入淘宝联盟的商品的详情也可获取。
环境 | http 地址 | https 地址 |
---|---|---|
正式环境 | http://api.veapi.cn/tbk/tbprodetail | 暂无 |
参数名称 | 参数类型 | 必填 | 示例值 | 描述 |
---|---|---|---|---|
vekey | String | 是 | V123M56 | 公共参数,接口秘钥,请在会员中心获取 |
id | String | 是 | 56688541226 | 天猫或淘宝产品ID |
onlysimple | Number | 否 | 默认0 | 如果您只需要 商品标题,图片,旺旺名称这些字段,那么推荐使用简版参数:可选值1,表示只要简版的商品详情信息。 |
type | String | 否 | app | 返回值类型:可选值h5和app,默认h5,推荐你同时兼容这两种类型,以便如果有故障时,切换到另一种类型。注意:当参数onlysimple=1时,本参数无效。 |
newdetail | Number | 否 | 1 | 新备用线路,可选值0和1,可和type=app共同做为备用线路。当本参数设置为1时启用新备用线路,type=app则失效。注意:当参数onlysimple=1时,本参数无效。 |
GET/POST http://api.veapi.cn/tbk/tbprodetail?vekey=xxx&id=产品id
$api="http://api.veapi.cn/tbk/tbprodetail?vekey=xxx&id=产品id"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $api); //curl_setopt($ch, CURLOPT_POST, true); //POST方式时启用 //curl_setopt($ch, CURLOPT_POSTFIELDS, $postData ); //POST方式时传参 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //如果使用https请启用 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //如果使用https请启用 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); //返回数据流,不直接输出 curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); //使用gzip压缩传输让访问更快 curl_setopt($ch, CURLOPT_TIMEOUT, 6); //允许执行的最长秒数。这里设定6S curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); $result = curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); echo $result; //返回值
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpRequest; public class testGetParam { public static void main(String[] args) { // API网址 String url = "http://api.veapi.cn/tbk/tbprodetail?vekey=xxx&id=产品id"; // JDK 8u111版本后,若目标页面为HTTPS协议,请启用proxy用户密码鉴权 //System.setProperty("jdk.http.auth.tunneling.disabledSchemes", ""); // 发送请求 String result = HttpRequest.get(url) .timeout(10000)//设置超时,毫秒 .execute().body(); System.out.println(result); } }
import requests # 要访问的API网页 target_url = "http://api.veapi.cn/tbk/tbprodetail?vekey=xxx&id=产品id" # 发送请求 response = requests.get(target_url) # 获取页面内容 if response.status_code == 200: print response.text
参数名称 | 参数类型 | 示例值 | 描述 |
---|---|---|---|
seller | Object | 卖家店铺信息 | |
item | Object | 商品信息 | |
rate | Object | 评论信息 | |
skuBase | Object | SKU信息 | |
apiStack | Object | 详细介绍 | |
props | Object | 属性选项 |
{ "error": "0", "msg": "商品详情调用成功!特别提示:以下示例是片断,非全部内容,因为全部返回值太长,所以有截断,需完整返回值可以联系我们", "data": { "seller": { "shopCard": "本店共75件宝贝在热卖", "shopName": "梦想真美好", "certIcon": "http://gw.alicdn.com/tfs/TB1zgzmlZLJ8KJjy0FnXXcFDpXa-171-148.png", "entranceList": [ { "backgroundColor": "#ffffff", "borderColor": "#FF5000", "action": [ { "params": { "url": "//shop.m.taobao.com/shop/shop_index.htm?user_id=248453492&item_id=23883488910¤tClickTime=-1" }, "key": "open_url" }, { "params": { "trackParams": { "spm": "a.2141.7631564.shoppage" }, "trackName": "Button-NewShopcard-ShopPage" }, "key": "user_track" } ], "text": "进店逛逛", "textColor": "#FF5000" }, { "backgroundColor": "#ffffff", "borderColor": "#FF5000", "action": [ { "params": { "url": "//shop.m.taobao.com/shop/shop_index.htm?user_id=248453492&item_id=23883488910&shop_navi=allitems" }, "key": "open_url" }, { "params": { "trackParams": { "spm": "a.2141.7631564.allitem" }, "trackName": "Button-NewShopcard-AllItem" }, "key": "user_track" } ], "text": "全部宝贝", "textColor": "#FF5000" } ], "evaluates": [ { "score": "4.8 ", "tmallLevelTextColor": "#23D2BD", "level": "-1", "levelText": "低", "levelBackgroundColor": "#D8FFFA", "levelTextColor": "#23D2BD", "title": "宝贝描述", "tmallLevelBackgroundColor": "#D8FFFA", "type": "desc" }, { "score": "4.8 ", "tmallLevelTextColor": "#23D2BD", "level": "-1", "levelText": "低", "levelBackgroundColor": "#D8FFFA", "levelTextColor": "#23D2BD", "title": "卖家服务", "tmallLevelBackgroundColor": "#D8FFFA", "type": "serv" }, { "score": "4.8 ", "tmallLevelTextColor": "#23D2BD", "level": "-1", "levelText": "低", "levelBackgroundColor": "#D8FFFA", "levelTextColor": "#23D2BD", "title": "物流服务", "tmallLevelBackgroundColor": "#D8FFFA", "type": "post" } ], "certText": "金牌卖家", "showShopLinkIcon": "false", "simpleShopDOStatus": "1", "fbt2User": "梦想真美好", "creditLevel": "18", "taoShopUrl": "//shop.m.taobao.com/shop/shop_index.htm?user_id=248453492&item_id=23883488910", "evaluates2": [ { "score": "4.8 ", "titleColor": "#999999", "level": "-1", "levelText": "低", "scoreTextColor": "#999999", "levelTextColor": "#FF7333", "title": "宝贝描述", "type": "desc" }, { "score": "4.8 ", "titleColor": "#999999", "level": "-1", "levelText": "低", "scoreTextColor": "#999999", "levelTextColor": "#FF7333", "title": "卖家服务", "type": "serv" }, { "score": "4.8 ", "titleColor": "#999999", "level": "-1", "levelText": "低", "scoreTextColor": "#999999", "levelTextColor": "#FF7333", "title": "物流服务", "type": "post" } ], "pcShopUrl": "//shop58614615.taobao.com", "allItemCount": "75", "atmosphereColor": "#ffffff", "creditLevelIcon": "//gw.alicdn.com/tfs/TB1Iw2CixrI8KJjy0FpXXb5hVXa-132-24.png", "shopId": "58614615", "goodRatePercentage": "98.95%", "sellerNick": "梦想真美好", "shopIcon": "//img.alicdn.com/imgextra//0d/14/T1jIurFAdXXXb1upjX.jpg", "isShowCertIcon": "true", "shopUrl": "tmall://page.tm/shop?item_id=23883488910&shopId=58614615", "shopVersion": "0", "userId": "248453492", "atmophereMask": "false", "fans": "29.5万", "shopType": "C", "sellerType": "C", "shopTextColor": "#111111" }, "propsCut": "品牌 适用年龄 尺码 面料 图案 风格 通勤 领型 主要颜色 袖型 货号 图案文化 适用季节 年份季节 袖长 衣长 服装版型 材质成分 ", "item": { "images": [ "//img.alicdn.com/imgextra/i3/248453492/O1CN01sq50ff1bfNqmyPZvi_!!248453492.jpg", "//img.alicdn.com/imgextra/i1/248453492/O1CN01gLIakx1bfNqoAvhRq_!!248453492.jpg", "//img.alicdn.com/imgextra/i1/248453492/O1CN01VHfduF1bfNqfxHerG_!!248453492.jpg", "//img.alicdn.com/imgextra/i3/248453492/O1CN01XI6JIt1bfNqp1EQl0_!!248453492.jpg", "//img.alicdn.com/imgextra/i4/248453492/O1CN01AZKugG1bfNqWoeYsT_!!248453492.jpg" ], "moduleDescUrl": "//hws.m.taobao.com/d/modulet/v5/WItemMouldDesc.do?id=23883488910&f=icoss!023883488910!13892183977", "tmallDescUrl": "//mdetail.tmall.com/templates/pages/desc?id=23883488910", "favcount": "334762", "cartUrl": "https://h5.m.taobao.com/awp/base/cart.htm", "countMultiple": [], "exParams": {}, "title": "短袖t恤女白色紧身纯棉短款体恤夏季新款半袖修身内搭打底衫上衣", "openDecoration": "false", "commentCount": "14748", "rootCategoryId": "16", "itemId": "23883488910", "skuText": "请选择主要颜色 尺码 ", "moduleDescParams": { "f": "desc/icoss!023883488910!13892183977", "id": "23883488910" }, "brandValueId": "4051257", "subtitle": "", "categoryId": "50000671" }, "rate": { "keywords": [ { "count": "11", "attribute": "40161019-11", "type": "1", "word": "不起球" } ], "utFeedId": "1194695564624_1193136494013", "propRate": [], "invite": { "showInvite": "false", "inviteText": "" }, "totalCount": "1万+" }, "vertical": {}, "props2": {}, "skuBase": { "skus": [ { "propPath": "20509:814810229;1627207:28320", "skuId": "3712306445438" } ], "props": [ { "values": [ { "vid": "814810229", "name": "S(88斤以下)" } ], "name": "尺码", "pid": "20509" } ] }, "apiStack": [ { "name": "这里内容太多,有删节....", "value": "{}" } ], "pcTrade": {}, "props": { "groupProps": [ { "基本信息": [ { "品牌": "HI" }, { "适用年龄": "25-29周岁" } ] } ] } } }