【问题标题】:Amazon product advertising API always returning undefined as result亚马逊产品广告 API 总是返回未定义的结果
【发布时间】:2015-08-28 13:43:07
【问题描述】:

我正在尝试对我的数据库中的产品使用亚马逊产品广告 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);
});

【问题讨论】:

    标签: amazon-product-api


    【解决方案1】:

    两件事 -
    1. B00UTKTX36 不再是有效的 ASIN(至少目前为止)http://www.amazon.com/dp/B00UTKTX36
    2. ASIN 上的ItemLookup 操作不应包含SearchIndex 参数。所以在你的node_modules/amazon-product-api/lib/utils.js 中评论这行https://github.com/t3chnoboy/amazon-product-api/blob/master/lib/utils.js#L57 就可以了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-15
      • 1970-01-01
      • 1970-01-01
      • 2018-08-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多