万邦淘宝/天猫获得淘宝商品评论 API 返回值说明

item_review-获得淘宝商品评论 [查看演示] API测试工具

onebound.taobao.item_review

公共参数

请求地址: https://api-gw.onebound.cn/taobao/item_review

名称 类型 必须 描述
keyString调用key(必须以GET方式拼接在URL中)
secretString调用密钥
api_nameStringAPI接口名称(包括在请求地址中)[item_search,item_get,item_search_shop等]
cacheString[yes,no]默认yes,将调用缓存的数据,速度比较快
result_typeString[json,jsonu,xml,serialize,var_export]返回数据格式,默认为json,jsonu输出的内容中文可以直接阅读
langString[cn,en,ru]翻译语言,默认cn简体中文
versionStringAPI版本
请求参数

请求参数:num_iid=600530677643&data=&page=1

参数说明:num_iid:淘宝商品ID
sort:排序 0:默认排序 ,1: 最新排序

响应参数
名称 类型 示例值 描述
items
items[]淘宝商品评论数据
请求示例
	
-- 请求示例 url 默认请求参数已经URL编码处理
curl -i "https://api-gw.onebound.cn/taobao/item_review/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=600530677643&data=&page=1"
<?php

// 请求示例 url 默认请求参数已经URL编码处理
// 本示例代码未加密secret参数明文传输,若要加密请参考:https://api.onebound.cn/taobao/demo/sdk2020/demo-sign.php
$method = "GET";
$url = "https://api-gw.onebound.cn/taobao/item_review/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=600530677643&data=&page=1";
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_ENCODING, "gzip");
var_dump(curl_exec($curl));
?>
<?php
//定义缓存目录和引入文件
define("DIR_RUNTIME","runtime/");
define("DIR_ERROR","runtime/");
define("SECACHE_SIZE","0");
//SDK下载地址 http://api-gw.onebound.cn/taobao/demo/sdk2020/onebound-api-sdk.zip
include ("ObApiClient.php");

$obapi = new otao\ObApiClient();
$obapi->api_url = "http://api-gw.onebound.cn/";
$obapi->api_urls = array("http://api-gw.onebound.cn/","http://api-1.onebound.cn/");//备用API服务器
$obapi->api_urls_on = true;//当网络错误时,是否启用备用API服务器
$obapi->api_key = "<您自己的apiKey>";
$obapi->api_secret = "<您自己的apiSecret>";
$obapi->api_version ="";
$obapi->secache_path ="runtime/";
$obapi->secache_time ="86400";
$obapi->cache = true;

$api_data = $obapi->exec(
                array(
	                "api_type" =>"taobao",
	                "api_name" =>"item_review",
	                "api_params"=>array (
  'num_iid' => '600530677643',
  'data' => '',
  'page' => '1',
)
                )
            );
 var_dump($api_data);
?>
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
import java.nio.charset.Charset;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.PrintWriter;
import java.net.URLConnection;

public class Example {
	private static String readAll(Reader rd) throws IOException {
		StringBuilder sb = new StringBuilder();
		int cp;
		while ((cp = rd.read()) != -1) {
			sb.append((char) cp);
		}
		return  sb.toString();
	}
	public static JSONObject postRequestFromUrl(String url, String body) throws IOException, JSONException {
		URL realUrl = new URL(url);
		URLConnection conn = realUrl.openConnection();
		conn.setDoOutput(true);
		conn.setDoInput(true);
		PrintWriter out = new PrintWriter(conn.getOutputStream());
		out.print(body);
		out.flush();
		InputStream instream = conn.getInputStream();
		try {
			BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8")));
			String jsonText = readAll(rd);
			JSONObject json = new JSONObject(jsonText);
			return json;
		} finally {
			instream.close();
		}
	}
	public static JSONObject getRequestFromUrl(String url) throws IOException, JSONException {
		URL realUrl = new URL(url);
		URLConnection conn = realUrl.openConnection();
		InputStream instream = conn.getInputStream();
		try {
			BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8")));
			String jsonText = readAll(rd);
			JSONObject json = new JSONObject(jsonText);
			return json;
		} finally {
			instream.close();
		}
	}
	public static void main(String[] args) throws IOException, JSONException {
		// 请求示例 url 默认请求参数已经URL编码处理
		String url = "https://api-gw.onebound.cn/taobao/item_review/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=600530677643&data=&page=1";
		JSONObject json = getRequestFromUrl(url);
		System.out.println(json.toString());
	}

}
//using System.Net.Security;
//using System.Security.Cryptography.X509Certificates;
private const String method = "GET";
static void Main(string[] args)
{
	String bodys = "";
	// 请求示例 url 默认请求参数已经做URL编码
	String url = "https://api-gw.onebound.cn/taobao/item_review/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=600530677643&data=&page=1";
	HttpWebRequest httpRequest = null;
	HttpWebResponse httpResponse = null; 
	if (url.Contains("https://"))
	{
		ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
		httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url));
	}
	else
	{
		httpRequest = (HttpWebRequest)WebRequest.Create(url);
	}
	httpRequest.Method = method;
	if (0 < bodys.Length)
	{
		byte[] data = Encoding.UTF8.GetBytes(bodys);
		using (Stream stream = httpRequest.GetRequestStream())
		{
		stream.Write(data, 0, data.Length);
		}
	}
	try
	{
		httpResponse = (HttpWebResponse)httpRequest.GetResponse();
	}
	catch (WebException ex)
	{
		httpResponse = (HttpWebResponse)ex.Response;
	}
	Console.WriteLine(httpResponse.StatusCode);
	Console.WriteLine(httpResponse.Method);
	Console.WriteLine(httpResponse.Headers);
	Stream st = httpResponse.GetResponseStream();
	StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
	Console.WriteLine(reader.ReadToEnd());
	Console.WriteLine("\n");
}
public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
	return true;
}
# coding:utf-8
"""
Compatible for python2.x and python3.x
requirement: pip install requests
"""
from __future__ import print_function
import requests
# 请求示例 url 默认请求参数已经做URL编码
url = "https://api-gw.onebound.cn/taobao/item_review/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=600530677643&data=&page=1"
headers = {
    "Accept-Encoding": "gzip",
    "Connection": "close"
}
if __name__ == "__main__":
    r = requests.get(url, headers=headers)
    json_obj = r.json()
    print(json_obj)
响应示例
{
	"items": {
		"totalpage": 120,
		"total_results": 2384,
		"page_size": 20,
		"page": "1",
		"item": [
			{
				"rate_content": "鞋子很棒😄😄😄趁着活动买来送妈妈做3.8妇女节的礼物。一直在她家买物流很快,质感很好,鞋底很软。客服的服务也很到位,只是这次翻车了十分对不起6号小姐姐😭手机卡了不小心点了差评😂真的是万分抱歉😭",
				"rate_date": "2021-03-03",
				"pics": [
					"//img.alicdn.com/imgextra/i4/0/O1CN01cEKgIM1S7BbteJQdi_!!0-rate.jpg",
					"//img.alicdn.com/imgextra/i4/0/O1CN018KRNFY1S7BbuwruJw_!!0-rate.jpg"
				],
				"display_user_nick": "小**酱",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:38",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "鞋子比较好,之前买了一双很好穿,又入手一双,客服回复也很及时。",
				"rate_date": "2021-02-21",
				"pics": [
					"//img.alicdn.com/imgextra/i4/0/O1CN01WIfslI2C4rvlgcGWJ_!!0-rate.jpg"
				],
				"display_user_nick": "董**4",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:37",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "整体评价:穿着很舒服, 版型风格:版型百搭好看 客服小姐姐也很棒,问的问题回答的都很好也很及时 ",
				"rate_date": "2021-02-16",
				"pics": [
					"//img.alicdn.com/imgextra/i2/0/O1CN01kizQMN1uHXo9uQRLI_!!0-rate.jpg"
				],
				"display_user_nick": "杰**5",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:37",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "三号客服棒棒哒。鞋子穿上很舒服 也比店里便宜很多 ",
				"rate_date": "2021-02-23",
				"pics": [],
				"display_user_nick": "很**q",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:36",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "去年在实体店买的,今年去没看到,在网上一搜正好在做活动,鞋子很好看,非常满意。 ",
				"rate_date": "2021-02-19",
				"pics": [
					"//img.alicdn.com/imgextra/i2/0/O1CN01qzpKiu22hfK5gmmc1_!!0-rate.jpg"
				],
				"display_user_nick": "平**5",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:36",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "三号客服棒棒哒😊😊 ",
				"rate_date": "2021-02-28",
				"pics": [],
				"display_user_nick": "1**甜",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:40",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "鞋子舒适,1号客服服务棒棒哒 ",
				"rate_date": "2021-02-23",
				"pics": [],
				"display_user_nick": "喵**宙",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:37",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "我觉得戈美其的鞋子性价比很高,穿着很好看,百搭,也舒服。 ",
				"rate_date": "2021-02-04",
				"pics": [
					"//img.alicdn.com/imgextra/i4/0/O1CN01E0hPlV1JED8jCMpyP_!!0-rate.jpg",
					"//img.alicdn.com/imgextra/i2/0/O1CN01A2cf2u1JED8o1Xxfi_!!0-rate.jpg",
					"//img.alicdn.com/imgextra/i2/0/O1CN011TsaGW1JED8otwFxI_!!0-rate.jpg"
				],
				"display_user_nick": "阿**鼠",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:36",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "整体评价:百搭款式,跟描述的一样,一号客服也挺好的,有耐心 ",
				"rate_date": "2021-02-14",
				"pics": [],
				"display_user_nick": "2**一",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:37",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "版型很棒,上脚轻巧,性价比高",
				"rate_date": "2021-02-06",
				"pics": [],
				"display_user_nick": "刘**0",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:36",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "还不错,包装可以,鞋码感觉有点小了 ",
				"rate_date": "2021-02-20",
				"pics": [],
				"display_user_nick": "嗨**儿",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:40",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "褪色特别严重,问了之后,说补偿几块钱去找弄鞋的打蜡,当时比较忙没有回了,后来发信息就客服没有回了,可是后来想想,给了,我又去哪里打蜡。 之前在他们家买的,鞋子很好,所在再买了这双,但是这个真的有点失望的,穿着久了点,还累,特别累。不好,一点都不好。 ",
				"rate_date": "2021-02-14",
				"pics": [
					"//img.alicdn.com/imgextra/i4/0/O1CN01wP1X3i20dsoo6Lgvl_!!0-rate.jpg"
				],
				"display_user_nick": "许**啊",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:37",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "鞋子还算满意,唯一不足的就是没有拉链,质量款式还是很好看的,,可以放心购买。",
				"rate_date": "2021-01-10",
				"pics": [],
				"display_user_nick": "欢**8",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:38",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "这双鞋实物比照片好看太多了,一号客服很棒,服务热情周到👍👍👍 ",
				"rate_date": "2021-02-03",
				"pics": [],
				"display_user_nick": "叫**汤",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:36",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "质量很好,去年买了一双,今年又买一双",
				"rate_date": "2021-02-09",
				"pics": [],
				"display_user_nick": "洋**4",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:40",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "太好看了吧!一点都不输给四五百块的靴子!款式和皮质都很好!性价比超高!爱了❤️ ",
				"rate_date": "2021-01-23",
				"pics": [
					"//img.alicdn.com/imgextra/i4/0/O1CN01BEsXdc1KgtYifxMZf_!!0-rate.jpg",
					"//img.alicdn.com/imgextra/i1/0/O1CN0111MAQy1Lc94FEfzVe_!!0-rate.jpg",
					"//img.alicdn.com/imgextra/i2/0/O1CN01nTmK1T1RfhqATKCQw_!!0-rate.jpg",
					"//img.alicdn.com/imgextra/i3/0/O1CN01oA8iuD1ro77gZ6g8U_!!0-rate.jpg"
				],
				"display_user_nick": "李**7",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:37",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "此用户没有填写评价。",
				"rate_date": "2021-02-14",
				"pics": [],
				"display_user_nick": "萌**儿",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:38",
				"add_feedback": "穿的第二天鞋带就断掉了!联系客服让我随便先买一个将就 过了春节联系补鞋带 今天联系了一天 客服理都不理!!差评!!太差劲了!!",
				"add_feedback_images": [
					"//img.alicdn.com/imgextra/i3/0/O1CN017UE6wN1jTwlAMlmNb_!!0-rate.jpg",
					"//img.alicdn.com/imgextra/i1/0/O1CN01YXyhSy21DbiKgLaes_!!0-rate.jpg",
					"//img.alicdn.com/imgextra/i2/0/O1CN01W9V5ab23ZFf6rWJW5_!!0-rate.jpg"
				]
			},
			{
				"rate_content": "靴子挺舒适,适合配裤子穿,唯一一点就是没拉链,系带很麻烦",
				"rate_date": "2021-01-27",
				"pics": [],
				"display_user_nick": "w**2",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:36",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "3号客服棒棒的",
				"rate_date": "2021-02-08",
				"pics": [],
				"display_user_nick": "l**4",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:36",
				"add_feedback": "",
				"add_feedback_images": []
			},
			{
				"rate_content": "此用户没有填写评价。",
				"rate_date": "2020-12-08",
				"pics": [],
				"display_user_nick": "晶**黛",
				"auction_sku": "颜色分类:黑色【内里:超细纤维】;尺码:36",
				"add_feedback": "这鞋子,双十一还没有平时买便宜呢,双十一买两双还294块多呢,现在买111.5就能买了   呵",
				"add_feedback_images": []
			}
		],
		"data_from": "td"
	},
	"secache": "c8bde0fb0758d449f9b07cca295d4b61",
	"secache_time": 1614912982,
	"secache_date": "2021-03-05 10:56:22",
	"translate_status": "",
	"translate_time": 0,
	"language": {
		"default_lang": "cn",
		"current_lang": "cn"
	},
	"error": "",
	"reason": "",
	"error_code": "0000",
	"cache": 0,
	"api_info": "today:12 max:10000",
	"execution_time": 0.734,
	"server_time": "Beijing/2021-03-05 10:56:22",
	"client_ip": "106.6.39.197",
	"call_args": {
		"num_iid": "600530677643",
		"page": "1"
	},
	"api_type": "taobao",
	"translate_language": "zh-CN",
	"translate_engine": "google_cn",
	"server_memory": "7.15MB",
	"request_id": "gw-2.60419dd5c5ae0"
}
异常示例
{
  "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) 状态信息 详细描述 是否收费
0000success接口调用成功并返回相关数据
2000Search success but no result接口访问成功,但是搜索没有结果
4000Server internal error服务器内部错误
4001Network error网络错误
4002Target server error目标服务器错误
4003Param error用户输入参数错误
4004Account not found用户帐号不存在
4005Invalid authentication credentials授权失败
4006API stopped您的当前API已停用
4007Account stopped您的账户已停用
4008API rate limit exceeded并发已达上限
4009API maintenanceAPI维护中
4010API not found with these valuesAPI不存在
4012Please add api first请先添加api
4013Number of calls exceeded调用次数超限
4014Missing url param参数缺失
4015Wrong pageToken参数pageToken有误
4016Insufficient balance余额不足
4017timeout error请求超时
5000unknown error未知错误
API 工具
如何获得此API
立即开通 有疑问联系客服QQ:QQ:583964941583964941(微信同号)