一、拼多多商品评论API接口(item_review-获得拼多多商品评论接口),拼多多评论API接口接口可获取到评论内容,评论日期,评论图片,买家昵称,评论商品属性,追评内容,追评图片,视频地址,视频截图,页数等页面上的参数均可以获取到,可应用于商品销售情况分析,电商选品分析,品牌口碑挖掘和竞争对手分析等业务,希望能够帮助到有需要的朋友,代码对接如下:
1.公共参数
名称 | 类型 | 必须 | 描述 (交流威信19970108018) |
---|---|---|---|
key | String | 是 | 调用key(必须以GET方式拼接在URL中,点击获取测试key和secret) |
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版本 |
2.请求参数
参数名称 | 类型 | 必填 | 说明 |
itemId | string | 是 | 商品id |
3.返回参数
参数名称 | 类型 | 说明 | |
average | int | 平均值 | |
regular_customers | int | 常客 | |
picture_num_text | string | 图片数量文本 | |
server_time | int | 服务时间 | |
regular_customers_iconfont | int | 常客数量 | |
video_num_text | string | 视频数量文本 | |
video | int | 视频 | |
review_num_text | string | 评论数量文本 | |
video_iconfont | int | 视频数量 | |
picture | string | 图片 | |
labels | array | 标签 | |
level | int | 标签优先级 | |
num | int | 标签数 | |
name | string | 标签名称 | |
id | int | 标签id | |
positive | int | - | |
text | string | 标签内容 | |
regular_customers_num_text | string | 常客数量文本 | |
picture_iconfont | int | 图标 | |
recommend_list | array | 推荐列表 | |
number | int | 标签数量 | |
default_num | int | 默认数 | |
append_num_text | string | 追加数量文本 | |
score_num | int | 得分 | |
append_iconfont | int | 附加数 | |
exps | array | - | |
label_info | array | 标签信息 | |
bucket | int | 存储空间 | |
strategy_name | string | 攻略 | |
timestamp | string | 时间戳 | |
append | int | 追加 | |
illegal_number | int | 非法数 | |
dataType | string | 数据类型 | |
dataType | int | 是否有下一页 | |
page | int | 页数 |
4. 请求示例(CURL、PHP 、PHPsdk 、Java 、C# 、Python...)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 测试环境: python2.7
# 安装requests依赖 => pip install requests/ easy_install requests
import requests
import json
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
def api_send_request(method, url, params=None, headers=None):
'''
转发请求到目的主机
@param method str 请求方法
@param url str 请求地址
@param params dict 请求参数
@param headers dict 请求头
'''
method = str.upper(method)
if method == "POST":
return requests.post(url=url, data=params, headers=headers)
elif method == "GET":
return requests.get(url=url, params=params, headers=headers)
else:
return None
method = "POST"
url = "http://wx19970108018加上后出请求链接"
headers = None
params = {
"appkey" : "yourappsecret",
"itemId" : "5914165983"
}
result = api_send_request(method=method, url=url, params=params, headers=headers)
if result:
body = result.result
response = json.loads(body)
status_code = response["status"]
if (status_code == "200"):
print("请求成功:%s" % (body,))
5.响应示例
{
"status": 200,
"msg": "OK",
"result": {
"page": {
"hasNext": true,
"currentPage": 0
},
"data": {
"average": 0,
"server_time": 1615198701,
"video_num_text": "视频(1)",
"video": 1,
"special_labels": [
{
"view": {
"back_color": "#FDEFEE",
"label_type": 2,
"click_back_color": "#F7D7D5",
"text_color": "#58595B",
"select_text_color": "#FFFFFF",
"select_back_color": "#E02E24",
"click_text_color": "#7C7372"
},
"outer_positive_count": 0,
"num": 115,
"name": "全部",
"id": "0",
"positive": 1,
"text": "全部(115)",
"positive_id": ""
},
{
"view": {
"iconfont": 59452,
"back_color": "#FDEFEE",
"label_type": 3,
"click_back_color": "#F7D7D5",
"text_color": "#58595B",
"select_text_color": "#FFFFFF",
"select_back_color": "#E02E24",
"click_text_color": "#7C7372"
},
"num": 73,
"name": "最新",
"label_merge_outer_count": 73,
"merge_outer_text": "最新",
"id": "700000000",
"positive": 1,
"text": "最新"
},
{
"view": {
"iconfont": 59135,
"back_color": "#FDEFEE",
"label_type": 3,
"click_back_color": "#F7D7D5",
"text_color": "#58595B",
"select_text_color": "#FFFFFF",
"select_back_color": "#E02E24",
"click_text_color": "#7C7372"
},
"num": 60,
"name": "有图",
"label_merge_outer_count": 60,
"merge_outer_text": "有图(60)",
"id": "100000000",
"positive": 1,
"text": "有图(60)"
},
{
"view": {
"iconfont": 59403,
"back_color": "#FDEFEE",
"label_type": 3,
"click_back_color": "#F7D7D5",
"text_color": "#58595B",
"select_text_color": "#FFFFFF",
"select_back_color": "#E02E24",
"click_text_color": "#7C7372"
},
"num": 1,
"name": "视频",
"label_merge_outer_count": 1,
"merge_outer_text": "视频(1)",
"id": "600000000",
"positive": 1,
"text": "视频(1)"
},
{
"view": {
"iconfont": 59147,
"back_color": "#FDEFEE",
"label_type": 3,
"click_back_color": "#F7D7D5",
"text_color": "#58595B",
"select_text_color": "#FFFFFF",
"select_back_color": "#E02E24",
"click_text_color": "#7C7372"
},
"num": 4,
"name": "回头客",
"label_merge_outer_count": 4,
"merge_outer_text": "回头客(4)",
"id": "400000000",
"positive": 1,
"text": "回头客(4)"
}
],
"regular_customers_num_text": "回头客(4)",
"picture_iconfont": 59135,
"recommend_list": [],
"number": 115,
"append_num_text": "",
"exps": {
"label_info": {
"bucket": 16,
"strategy_name": "N",
"timestamp": 1615198701142
}
},
"illegal_number": 0,
"regular_customers": 4,
"picture_num_text": "有图(60)",
"regular_customers_iconfont": 59147,
"main_review_num_with_comment": 69,
"review_num_text": "全部(115)",
"video_iconfont": 59403,
"picture": 60,
"labels": [
{
"view": {
"back_color": "#FDEFEE",
"label_type": 0,
"click_back_color": "#F7D7D5",
"text_color": "#58595B",
"select_text_color": "#FFFFFF",
"select_back_color": "#E02E24",
"click_text_color": "#7C7372"
},
"level": 1,
"outer_positive_count": 0,
"num": 29,
"name": "好吃",
"id": "a78e4f228bedccade583ee3dd8bfd586",
"positive": 1,
"text": "好吃(29)"
},
{
"view": {
"back_color": "#FDEFEE",
"label_type": 0,
"click_back_color": "#F7D7D5",
"text_color": "#58595B",
"select_text_color": "#FFFFFF",
"select_back_color": "#E02E24",
"click_text_color": "#7C7372"
},
"level": 1,
"outer_positive_count": 0,
"num": 10,
"name": "物流很快",
"id": "0ad8c17dc30f2e42283d0fa81163d64c",
"positive": 1,
"text": "物流很快(10)"
},
{
"view": {
"back_color": "#FDEFEE",
"label_type": 0,
"click_back_color": "#F7D7D5",
"text_color": "#58595B",
"select_text_color": "#FFFFFF",
"select_back_color": "#E02E24",
"click_text_color": "#7C7372"
},
"level": 1,
"outer_positive_count": 0,
"num": 10,
"name": "包装很好",
"id": "232a85c70c5abca5c34cd5cd5eea800d",
"positive": 1,
"text": "包装很好(10)"
},
{
"view": {
"back_color": "#FDEFEE",
"label_type": 0,
"click_back_color": "#F7D7D5",
"text_color": "#58595B",
"select_text_color": "#FFFFFF",
"select_back_color": "#E02E24",
"click_text_color": "#7C7372"
},
"level": 1,
"outer_positive_count": 0,
"num": 8,
"name": "价格便宜",
"id": "8b6a694cd82e49f19774b39754c14109",
"positive": 1,
"text": "价格便宜(8)"
},
{
"view": {
"back_color": "#FDEFEE",
"label_type": 0,
"click_back_color": "#F7D7D5",
"text_color": "#58595B",
"select_text_color": "#FFFFFF",
"select_back_color": "#E02E24",
"click_text_color": "#7C7372"
},
"level": 1,
"outer_positive_count": 0,
"num": 6,
"name": "态度好",
"id": "4c4c7e277c4cca75ad39706e98e1aa55",
"positive": 1,
"text": "态度好(6)"
}
],
"default_num": 0,
"positive_review_number": 0,
"score_num": 0,
"append_iconfont": 59133,
"merge_review_with_outer_review": 0,
"append": 0
}
}
}