淘宝商品评价api接口,淘宝商品评论api接口

通过商品id,获取商品评价信息、评价内容、买家秀图片

1、注册订单侠开放平台账号

注册地址: https://www.dingdanxia.com/user/register/index.html  

2、获取接口秘钥apikey

登录个人中心 - 系统设置 - 接口管理 找到接秘钥apikey,apikey 接口秘钥是调用接口的唯一凭证,请妥善保管! 

3、PHP代码调用示例

<?php
// +----------------------------------------------------------------------
// | 订单侠开放平台 www.dingdanxia.com  [ 专为淘客开发者提供一站式API解决方案 ] 
// +----------------------------------------------------------------------
//接口秘钥
$apikey = '这里填写你的apikey';
//淘宝商品评论api接口
$apiurl = "http://api.tbk.dingdanxia.com/shop/getfeedback";


//开始调用
$result = curl_post($apiurl, array(
    //接口秘钥
        "apikey"    => $apikey,
	//商品id
	"id"        => "539801480973",
        //页码
        "page"    => 1,
        //每页显示多少条数据
        "size"     => 20
));


//打印结果
print_r($result);

/**
 * post请求
 * @param string $url
 * @param array $params
 * @param int $timeout
 */
function curl_post($url, $params, $timeout = 3) {
    try {
        foreach ($params as $key => $val) {
            $post[] = "{$key}={$val}";
        }
        $post_data  = implode('&', $post);
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
        return curl_exec($ch);
    }
    catch (Exception $e) {
        return false;
    }
}

4、接口返回结果

{
	"code": 200,
	"msg": "请求成功【success】",
	"total_results": "67",
	"data": [{
			"feedback": "衣服几天到货了很满意",
			"feedbackDate": "2020-03-04",
			"userNick": "t**4",
			"skuMap": {
				"尺码": "5XL(适合140-150斤左右)",
				"颜色分类": "1930外套-红条"
			},
			"feedPicList": []
		},
		{
			"feedback": "衣服到的很快呢,质量也很好,穿上很合适很喜欢!!!颜色也好 ",
			"feedbackDate": "2020-03-04",
			"userNick": "c**4",
			"skuMap": {
				"尺码": "5XL(适合140-150斤左右)",
				"颜色分类": "1930外套-麻灰无里衬"
			},
			"feedPicList": [
				"//img.alicdn.com/imgextra/i1/0/O1CN01bH8XSt1dQNuU4fbho_!!0-rate.jpg",
				"//img.alicdn.com/imgextra/i4/0/O1CN01qvEpWG1dQNucK3j1n_!!0-rate.jpg"
			]
		}
	]
}	

接口文档:https://www.dingdanxia.com/doc/35/8

在线测试:https://www.dingdanxia.com/apitest/35/8

实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值