我正在尝试在我的数据库中使用amazon产品广告API查找产品详细信息。但是,响应始终是未定义的。我做错什么了吗?
var amazon = require('amazon-product-api');
var client = amazon.createClient({
awsId: "my aws id",
awsSecret: "my secret key",
awsTag: "my aws tag"
});
client.itemLookup({
responseGroup: 'Images,ItemAttributes,Offers,EditorialReview',
IdType: 'ASIN',
ItemId: "B00UTKTX36"
}).then(function (results){
console.log("results", results);
}).catch(function(err){
console.log(err.Error[0].Message);
});发布于 2015-08-28 13:43:07
两件事-
B00UTKTX36不再是有效的ASIN (至少到目前为止)ASIN上的http://www.amazon.com/dp/B00UTKTX36ItemLookup操作不应包含SearchIndex参数。所以在你的node_modules/amazon-product-api/lib/utils.js中注释掉这一行https://github.com/t3chnoboy/amazon-product-api/blob/master/lib/utils.js#L57就可以了。https://stackoverflow.com/questions/32227269
复制相似问题