t3chnoboy / amazon-product-api

:credit_card: Amazon Product Advertising API client
366 stars 104 forks source link

Added the merchant id to the query options #10

Closed d1b1 closed 9 years ago

d1b1 commented 9 years ago

Added the merchant ID to allow and additional query.

client.itemSearch({ keywords: req.query.keywords, ItemPage: 5, MerchantId: 'Amazon', searchIndex: 'HealthPersonalCare', responseGroup: 'ItemAttributes,Offers,Images' }, function(err, results) { if (err) { res.send(err.Error) } else { var data = results;

  if (showRaw == 'no') {
    var data = _.map(results, function(v) {
      return pluckItem(v);
    });
  }

  res.send(data);
}

});

t3chnoboy commented 9 years ago

Very nice! Thank you! Can you please fix the issue with the default value (see the comment) and update README?

FdezRomero commented 9 years ago

@d1b1 It would be awesome if you can give this PR the finishing touches (change one letter in the attribute name and add a line to the Readme). It's almost there!

d1b1 commented 9 years ago

Ok it tonight

Stephan Smith617-953-7847

On Wed, Aug 26, 2015 at 6:43 PM, Rodrigo Fernández Romero notifications@github.com wrote:

@d1b1 It would be awesome if you can give this PR the finishing touches (change one letter in the attribute name and add a line to the Readme). It's almost there!

Reply to this email directly or view it on GitHub: https://github.com/t3chnoboy/amazon-product-api/pull/10#issuecomment-135198090

masterT commented 9 years ago

@d1b1 @FdezRomero This PR is no longer necessary, since version 0.3.0 you can use all the param available for the methods, which includes the MerchantId.

FdezRomero commented 9 years ago

@masterT I just tried an ItemLookup with both merchantId: 'Amazon'and MerchantId: 'Amazon' for ASIN B00WT78QZS and it didn't work, it showed an offer with a merchant name that wasn't Amazon.

I checked the code and couldn't find why it's not working. Any help? Should I open an issue?

Forgot to say that is working fine from the PAAPI Scratchpad, so it's not the API.

masterT commented 9 years ago

@FdezRomero can you show me your query and the value of the variable params at line 97 in the file lib/utils.js (just log it in the console).

FdezRomero commented 9 years ago

@masterT I didn't have line 97 in my lib/utils.js and noticed that packages.json had version 0.2.4. For some reason neither npm update --save nor npm install amazon-product-api --save were upgrading to version 0.3.1. I had to do npm install amazon-product-api@0.3.1 --save to make it work.

Anyway, it's working now so thanks a lot! I agree this PR is no longer needed.

masterT commented 9 years ago

Awesome :+1:!

lukezona commented 6 years ago

Sorry to bother you but after two years but I noticed that the MerchantId parameter is not available anymore.

How can I add it again? Am I just missing something?