t3chnoboy / amazon-product-api

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

locale settings #80

Open anandujjwal13 opened 7 years ago

anandujjwal13 commented 7 years ago

there are no options to enter the locale information lets say 'IN' for 'INDIA' because of which there is no response from the server.. :(

OptumCS commented 7 years ago

Take a look at the utils.js file (line 97):

var domain = query.domain || 'webservices.amazon.com';

In other words, you can use the 'domain' property of the query to set the particular amazon store.
Also, if you look carefully at the README.md "Query params:" under the heading, "ItemLookup", the last bullet point, "VariationPages" is not formatted properly. At the end of the line, you will see the additional parameter "domain" (ahh, it was hidden!)

For example, set the 'domain' parameter to "webservices.amazon.co.uk" to access the UK store. However, you must have an affiliate ID for each store that you wish to query (you probably already knew that part). I tested a few (US, UK, CA) and it works well:

let oAmazonItemInfo = AmazonClient.itemLookupSync(
    {
        domain: 'webservices.amazon.ca',
        idType: 'ASIN',
        itemId: 'B01IUFGDW0',
        responseGroup: 'ItemAttributes, Offers'
    }
);

Now, you can turn your frown upside-down. :)

akshayupadhya commented 7 years ago

it works , thanks

mangione77 commented 5 years ago

I'm having an issue when performing a itemSearch on 'webservices.amazon.es'. My code is just like the one in the example, the only change is the 'domain' property:

client.itemSearch({ domain: 'webservices.amazon.es', director: 'Quentin Tarantino', actor: 'Samuel L. Jackson', searchIndex: 'DVD', audienceRating: 'R', responseGroup: 'ItemAttributes,Offers,Images' }).then(function(results){ console.log(results); }).catch(function(err){ console.log(err.Error); })

I'm getting The AWS Access Key Id you provided does not exist in our records even though I'm registered in both Spanish and US marketplaces (and tried with webservices.amazon.com aswell). I also did some tests with the Sketchpad and works just fine for the Spanish marketplace and not the US one, which leads me to think I'm having an issue knowing were to add the locale.

Thanks!