[英]Amazon Product API not respecting ResponseGroups
I'm trying to get all products priced between 12.50 and 11.50. 我正在尝试使所有产品的价格都在12.50和11.50之间。 I'm using Node-APAC for my requests to the Amazon Product API. 我正在使用Node-APAC来发送对Amazon Product API的请求。 Here's my code for a request: 这是我的请求代码:
exports.search = function(req, res){
OperationHelper = require('apac').OperationHelper;
var opHelper = new OperationHelper({
awsId: process.env.AMZ_ACCESS_KEY_CODE,
awsSecret: process.env.AMZ_SECRET_ACCESS_KEY,
assocId: process.env.AMZ_ASSOCIATE_ID
});
opHelper.execute('ItemSearch', {
'SearchIndex': 'All',
'Keywords': ' ',
'MaximumPrice': 12.50,
'MinimumPrice': 11.50,
'ResponseGroup': 'Medium'
}, function(error, results) {
res.send(results);
});
};
The response does not limit the results to a Medium ResponseGroup . 响应并不将结果限制为Medium ResponseGroup 。 You can see some of the full response here (It's huge). 您可以在此处看到一些完整的响应(非常大)。 Here's the structure: 结构如下:
{
ItemSearchResponse: {
$: {...},
OperationRequest: [...],
Items: [
{
Request: [...],
TotalResults: [...],
TotalPages: [...],
MoreSearchResultsUrl: [...],
Item: [
{
ASIN: [...],
DetailPageURL: [...],
ItemLinks: [...],
SmallImage: [...],
MediumImage: [...],
LargeImage: [...],
ImageSets: [...],
ItemAttributes: [...],
OfferSummary: [...]
},
{...},
{...},
{...},
{...}
]
}
]
}
}
It is not returning what the documentation says should be included in the Medium ResponseGroup. 它没有返回文档所说的应该包含在Medium ResponseGroup中的内容。 It's returning a bunch of other stuff which is unnecessary. 它返回了很多不必要的东西。 Any help is appreciated! 任何帮助表示赞赏!
Note: It's also returning products that don't fit the price range. 注意:它还会退回不符合价格范围的产品。 These problems may be related. 这些问题可能是相关的。 Any tips there would be helpful. 那里的任何提示都会有所帮助。
As per the Amazon Product Advertising doc for the ItemSearch operation , MinimumPrice (resp. MaximumPrice) "specifies the minimum (resp. maximum) price of the items to return. Prices are in terms of the lowest currency denomination, for example, pennies, for example, 3241 represents $32.41.". 根据ItemSearch操作的Amazon Product Advertising文档 ,MinimumPrice(resp.MaximumPrice)“指定要退货的商品的最低(最高)价格。价格以最低货币单位表示,例如,便士,例如,3241代表$ 32.41。”。
So if you change the values for the following two parameters: 因此,如果您更改以下两个参数的值:
'MaximumPrice': 12.50,
'MinimumPrice': 11.50,
with 同
'MaximumPrice': 1250,
'MinimumPrice': 1150,
the price filtering should work. 价格过滤应该起作用。 As for the ResponseGroup, I would suggest you to pass "Small,OfferSummary" (as per my answer to your question "How to specify what Amazon Product API returns" ). 至于ResponseGroup,我建议您传递“ Small,OfferSummary”(根据我对问题“如何指定Amazon Product API返回的信息”的回答)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.