API文档中心

热门接口:产品ID找同款全量维权查询万能转链字符串ID转换 (有API需求可联系本站)

淘宝天猫商品评论接口

专用卡
调用权限:仅限专用卡调用
接口使用场景等说明:

淘宝天猫商品评论接口,可以查询淘宝或天猫的产品评论详情,

返回的评论接口值,包括买家头像,评论图,评论视频,评论文字等等。


本接口可以与淘宝天猫商品详情接口配合使用,在你的APP或公众号,或网站的产品详情介绍页,先调用详情页接口获取最新评论,当客户要进一步查看评论接口时,再调用本评论分页接口。

接口请求地址

环境 http 地址 https 地址
正式环境 http://api.veapi.cn/tbk/tbcomment 暂无

请求方式:GETPOST

请求参数

参数名称 参数类型 必填 示例值 描述
vekey String V123M56 公共参数,接口秘钥,请在会员中心获取
para String 582034508419 产品ID
pageno Number 默认1 评论内容页码(注每页固定返回10条评论数量)
mode String pc 可选值为空或指定值pc。不提供本参数时,评论是手淘版,指定为pc时,则是淘宝PC端评论,

请求示例

  • HTTP
  • PHP
  • JAVA
  • PYTHON
GET/POST  http://api.veapi.cn/tbk/tbcomment?para=582034508419&pageno=1 

使用curl函数,curl不是php原生库,需要安装才能使用

$api="http://api.veapi.cn/tbk/tbcomment?para=582034508419&pageno=1";

$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; //返回值
使用okhttp3/httpclient/jsoup/hutool,以hutool为例:

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/tbcomment?para=582034508419&pageno=1";
        // JDK 8u111版本后,若目标页面为HTTPS协议,请启用proxy用户密码鉴权
        //System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");

        // 发送请求
        String result = HttpRequest.get(url)
                .timeout(10000)//设置超时,毫秒
                .execute().body();
        System.out.println(result);
    }
}
推荐使用 requests,支持访问http,https网页:

import requests
		
# 要访问的API网页
target_url = "http://api.veapi.cn/tbk/tbcomment?para=582034508419&pageno=1"

# 发送请求
response = requests.get(target_url)

# 获取页面内容
if response.status_code == 200:
	print response.text

返回值(JSON)

参数名称 参数类型 示例值 描述
rateList String[]   评论内容

返回示例

【提示】推广链接通常有时效性,示例中的链接为创建文档时生成,仅用于展示返回结果使用,有可能已失效。
{ "error": "0", "msg": "评论查询成功", "data": { "abBucketName": "default_buckets#-1", "abCode": "default_buckets", "allowInteract": "true", "canReport": "false", "configMap": { "card_version": "old", "show_comments": "false" }, "feedAllCount": "24661", "feedAppendCount": "364", "feedMediaCount": "1209", "feedPicCount": "1157", "feedStoreCount": "0", "feedVideoCount": "90", "firstPageTips": "淘宝鼓励真实有帮助的评价", "foldCount": "16492", "from": "search-rp", "fuzzyRateCount": "2万+", "inviteText": "", "latestSort": "true", "range": "20000", "rateList": [ { "addCartUrl": "https://sku.taobao.com/index.htm?itemId=523268814802&bottomMode=ADDCART&asyncApiType=normalBuy&skuId=3669398490881", "allowComment": "true", "allowInteract": "true", "allowReportReview": "true", "allowReportUser": "false", "allowShieldReview": "false", "allowShieldUser": "false", "annoy": "1", "auctionNumId": "523268814802", "copy": "false", "createTimeInterval": "1个月前", "creditLevel": "9", "feedPicList": [ { "cover": "false", "fileId": "1929807523003761439", "status": "1", "thumbnail": "//img.alicdn.com/imgextra/i4/0/O1CN01BIy1gT2IYXPdtzaD1_!!0-rate.jpg" }, { "cover": "false", "fileId": "1929807531548715104", "status": "1", "thumbnail": "//img.alicdn.com/imgextra/i4/0/O1CN01lNFU4R2IYXPnEHL0K_!!0-rate.jpg" } ], "feedPicPathList": [ "//img.alicdn.com/imgextra/i4/0/O1CN01BIy1gT2IYXPdtzaD1_!!0-rate.jpg", "//img.alicdn.com/imgextra/i4/0/O1CN01lNFU4R2IYXPnEHL0K_!!0-rate.jpg" ], "feedback": "产品功能:好,颜色很不错! 外观材质:类似于纸,但是又带点胶的那种,可以防点水。 商品品质:一般,主要是味道,很大的味道,跟油漆类似的,不知道多久能散 ", "feedbackDate": "2022-11-17", "formalBlackUser": "false", "goldUser": "false", "hasDetail": "true", "headFrameUrl": "", "headPicUrl": "https://img.alicdn.com/imgextra/i4/O1CN01GbZNxl26Vzotrjqli_!!6000000007668-2-tps-160-160.png", "id": "1193135249324", "interactInfo": { "alreadyLike": "false", "commentCount": "0", "likeCount": "3", "readCount": "2353" }, "own": "false", "rateType": "1", "repeatBusiness": "false", "reply": "", "share": { "shareCover": "//img.alicdn.com/imgextra/i4/0/O1CN01BIy1gT2IYXPdtzaD1_!!0-rate.jpg", "shareSupport": "true", "shareURL": "//h5.m.taobao.com/user_comment/comment_detail.html?rateId=1193135249324&sellerId=MXm7zMm*-vmgYPGheMHgyMGvuvkcbMGvWM0Q4PHPzMmvT&isEncode=true" }, "skuId": "3669398490881", "skuMap": { "尺寸/加工方式": "中", "颜色分类": "银丝木" }, "skuValueStr": "中; 银丝木", "skuVids": "428034394#109101", "structTagEndSize": "0", "structTagList": [ { "id": "1", "title": "产品功能", "content": "好,颜色很不错!" }, { "id": "2", "title": "外观材质", "content": "类似于纸,但是又带点胶的那种,可以防点水。" }, { "id": "3", "title": "商品品质", "content": "一般,主要是味道,很大的味道,跟油漆类似的,不知道多久能散" } ], "userId": "0", "userIndexURL": "", "userMark": "uertI3N9vGDe0YQgMYhbSILdqq8eMU1j1x0sAMfVe/U=", "userNick": "芯**6", "userStar": "7", "userStarPic": "https://img.alicdn.com/imgextra/i4/O1CN01ZlCYMx1nbVriw6u0S_!!6000000005108-2-tps-92-45.png" } ], "showInvite": "false", "skuFilter": "true", "total": "8169", "totalPage": "500", "userType": "1" } }

错误码

如果error不为0时,请点此查看错误码表格

在线
客服

会员请加QQ群交流:

微信
咨询

加微信咨询
顶部