速卖通(AliExpress)是一个全球性的在线B2C电商平台,为卖家和买家提供了一个交易的平台。其中,速卖通提供了多种API接口供开发者使用,以实现与平台的数据交互。aliexpress.item_question_answer_info
API 通常用于获取商品的问答信息。
以下是对 aliexpress.item_question_answer_info
API 返回值的一个深度解析:
返回值概述
当你调用 aliexpress.item_question_answer_info
API 并成功获取响应后,通常会得到一个包含商品问答信息的JSON结构。这个JSON结构可能包含多个字段,每个字段都提供了与问答相关的不同数据。
返回值字段详解
以下是一些可能的返回值字段及其含义:
-
request_id:请求的唯一标识符,用于追踪和调试。
-
success:表示请求是否成功的布尔值。
-
error_code 和 error_msg:如果请求失败,这两个字段将包含错误代码和详细的错误消息。
-
question_list:一个包含多个问答对的列表。每个问答对可能包含以下字段:
- question_id:问题的唯一标识符。
- question_content:问题的内容。
- question_time:问题的提问时间。
- answer_list:一个包含多个回答的列表。每个回答可能包含以下字段:
- answer_id:回答的唯一标识符。
- answer_content:回答的内容。
- answer_time:回答的时间。
- answer_user_id:回答者的用户ID(如果可用)。
- is_helpful:一个表示回答是否有用的布尔值或投票数(取决于API的实现)。
- is_verified:一个表示问题或回答是否经过验证的布尔值(取决于API的实现)。
- other_fields:其他可能存在的字段,具体取决于API的版本和实现。
-
total_count:问题或问答对的总数(取决于API的实现和请求的参数)。
-
page_info:如果API支持分页,这个字段可能包含有关当前页、总页数、每页项目数等信息。
aliexpress.item_question_answer_info
公共参数
请求地址:
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
key | String | 是 | 调用key(必须以GET方式拼接在URL中) |
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版本 |
请求参数
请求参数:url=https://ja.aliexpress.com/&country=JP¤cy=USD&lang=ja_JP&page=1&num_iid=1005005958833204
参数说明:num_iid:aliexpress商品ID
country:地区(地区和域名必须对应)
currency:货币
lang:语言
page:页码
url:域名
响应参数
Version: Date:2024-05-07
名称 | 类型 | 必须 | 示例值 | 描述 |
---|---|---|---|---|
item | Mix | 1 | 获得商品问答信息 |
响应示例
"alsoAsk": 0,
"answers": [
{
"cnty": "US",
"content": "Some popular elements of it include a solid pattern and a platform fashion element.",
"contentLang": "",
"gmtCreate": 1710384637000,
"id": 110000069945717,
"lang": "en",
"owner": -2,
"refId": 110000069945716,
"serialNumber": 110000034087370,
"targetId": 1005005958833204,
"translateContent": "それのいくつかの人気のある要素は、固体パターンとプラットフォームのファッション要素を含みます。"
}
],
"cnty": "US",
"content": "What are some popular elements of it?",
"contentLang": "",
"gmtCreate": 1710384637000,
"id": 110000069945716,
"lang": "en",
"owner": -1,
"serialNumber": 110000034087370,
"targetId": 1005005958833204,
"totalAnswer": 1,
"totalAsk": 6,
"translateContent": "それのいくつかの人気のある要素は何ですか?"
},
{
"alsoAsk": 0,
"answers": [
{
"cnty": "US",
"content": "Some distinctive features of it are its low heel height, adhesive sole technology, and PVC upper material.",
"contentLang": "",
"gmtCreate": 1710364802000,
"id": 110000068039864,
"lang": "en",
"owner": -2,
"refId": 110000068039862,
"serialNumber": 110000033403941,
"targetId": 1005005958833204,
"translateContent": "それのいくつかの特徴は、その低いヒールの高さ、粘着ソール技術、およびPVCアッパー素材です。"
}
],
"cnty": "US",
"content": "What are some distinctive features of it?",
"contentLang": "",
"gmtCreate": 1710364802000,
"id": 110000068039862,
"lang": "en",
"owner": -1,
"serialNumber": 110000033403941,
"targetId": 1005005958833204,
"totalAnswer": 1,
"totalAsk": 6,
"translateContent": "それのいくつかの特徴は何ですか?"
},
{
"alsoAsk": 0,
"answers": [
{
"cnty": "US",
"content": "It falls under the category of one word drag.",
"contentLang": "",
"gmtCreate": 1710364802000,
"id": 110000068039870,
"lang": "en",
"owner": -2,
"refId": 110000068039867,
"serialNumber": 110000033403944,
"targetId": 1005005958833204,
"translateContent": "1ワードドラッグのカテゴリに分類されます。"
}
],
"cnty": "US",
"content": "Under which category does it fall?",
"contentLang": "",
"gmtCreate": 1710364802000,
"id": 110000068039867,
"lang": "en",
"owner": -1,
"serialNumber": 110000033403944,
"targetId": 1005005958833204,
"totalAnswer": 1,
"totalAsk": 6,
"translateContent": "どのカテゴリに該当しますか?"
},
{
"alsoAsk": 0,
"answers": [
{
"cnty": "US",
"content": "It is a pair of bathroom slippers.",
"contentLang": "",
"gmtCreate": 1710364802000,
"id": 110000068039876,
"lang": "en",
"owner": -2,
"refId": 110000068039873,
"serialNumber": 110000033403947,
"targetId": 1005005958833204,
"translateContent": "それはバスルームのスリッパのペアです。"
}
],
"cnty": "US",
"content": "What is the functionality of it?",
"contentLang": "",
"gmtCreate": 1710364802000,
"id": 110000068039873,
"lang": "en",
"owner": -1,
"serialNumber": 110000033403947,
"targetId": 1005005958833204,
"totalAnswer": 1,
"totalAsk": 6,
"translateContent": "それの機能は何ですか?"
},
{
"alsoAsk": 0,
"answers": [
{
"cnty": "US",
"content": "The benefits of using it include comfort, style, and suitability for summer season.",
"contentLang": "",
"gmtCreate": 1710364802000,
"id": 110000068039878,
"lang": "en",
"owner": -2,
"refId": 110000068039877,
"serialNumber": 110000033403948,
"targetId": 1005005958833204,
"translateContent": "それを使用する利点には、快適さ、スタイル、および夏のシーズンへの適合性が含まれます。"
}
],
"cnty": "US",
"content": "What are the benefits of using it?",
"contentLang": "",
"gmtCreate": 1710364802000,
"id": 110000068039877,
"lang": "en",
"owner": -1,
"serialNumber": 110000033403948,
"targetId": 1005005958833204,
"totalAnswer": 1,
"totalAsk": 6,
"translateContent": "それを使用する利点は何ですか?"
},
{
"alsoAsk": 0,
"answers": [],
"cnty": "BR",
"content": "gostaria do produto mais estou com medo do tamanho eu calço 41/42 qual seria o tamanho ideal pra minha numeração?",
"contentLang": "",
"gmtCreate": 1708735536000,
"id": 120000012354856,
"lang": "pt",
"owner": 2981648609,
"serialNumber": 120000010078783,
"targetId": 1005005958833204,
"totalAnswer": 0,
"totalAsk": 6,
"translateContent": "製品のようにもっと私は41/42を噛むサイズを恐れています私の番号付けのための理想的なサイズは何でしょうか?"
}
],
"_ddf": "alex",
"error": "",
"reason": "",
"error_code": "0000",
"cache": 0,
"api_info": "today:6 max:500 all[7=6+1+0];expires:2024-05-10",
"execution_time": "7.541",
"server_time": "Beijing/2024-05-07 17:18:21",
"client_ip": "106.6.35.173",
"call_args": [],
"api_type": "aliexpress",
"translate_language": "zh-CN",
"translate_engine": "Hcw",
"server_memory": "4.11MB",
"request_id": "gw-2.6639f1d594f3b",
"last_id": "2908276794"
异常示例
"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": "aliexpress",
"request_id": "15ee0ffc041242"}
错误码解释
状态代码(error_code) | 状态信息 | 详细描述 | 是否收费 |
---|---|---|---|
0000 | success | 接口调用成功并返回相关数据 | 是 |
2000 | Search success but no result | 接口访问成功,但是搜索没有结果 | 是 |
4000 | Server internal error | 服务器内部错误 | 否 |
4001 | Network error | 网络错误 | 否 |
4002 | Target server error | 目标服务器错误 | 否 |
4003 | Param error | 用户输入参数错误 | 忽略 |
4004 | Account not found | 用户帐号不存在 | 忽略 |
4005 | Invalid authentication credentials | 授权失败 | 忽略 |
4006 | API stopped | 您的当前API已停用 | 忽略 |
4007 | Account stopped | 您的账户已停用 | 忽略 |
4008 | API rate limit exceeded | 并发已达上限 | 忽略 |
4009 | API maintenance | API维护中 | 忽略 |
4010 | API not found with these values | API不存在 | 忽略 |
4012 | Please add api first | 请先添加api | 忽略 |
4013 | Number of calls exceeded | 调用次数超限 | 忽略 |
4014 | Missing url param | 参数缺失 | 忽略 |
4015 | Wrong pageToken | 参数pageToken有误 | 忽略 |
4016 | Insufficient balance | 余额不足 | 忽略 |
4017 | timeout error | 请求超时 | 否 |
5000 | unknown error | 未知错误 | 否 |
注意事项
- 不同的API版本和不同的调用方式可能导致返回值的字段和结构有所不同。因此,在实际使用时,应参考官方文档或API的Swagger定义来获取准确的返回值信息。
- 在处理返回值时,应注意检查
success
字段以确定请求是否成功,并根据需要处理error_code
和error_msg
字段中的错误信息。 - 如果API支持分页,应注意处理分页信息,以确保能够获取到所有需要的数据。
- 在使用API时,应遵守速卖通平台的开发规范和API使用条款,以确保合法合规地获取和使用数据。