-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
getVariations.js
32 lines (28 loc) · 1.1 KB
/
getVariations.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const amazonPaapi = require('amazon-paapi');
const ck = require('ckey'); // access .env variables
const commonParameters = {
'AccessKey' : ck.AWS_ACCESS_KEY,
'SecretKey' : ck.AWS_SECRET_KEY,
'PartnerTag' : ck.AWS_TAG, // yourtag-20
'PartnerType': 'Associates', // Default value is Associates.
'Marketplace': 'www.amazon.com' // Default value is US. Note: Host and Region are predetermined based on the marketplace value. There is no need for you to add Host and Region as soon as you specify the correct Marketplace value. If your region is not US or .com, please make sure you add the correct Marketplace value.
}
const requestParameters = {
'ASIN' : 'B07H65KP63',
'Resources' : [
'Images.Primary.Medium',
'ItemInfo.Title',
'Offers.Listings.Price',
'VariationSummary.VariationDimension'
]
};
/** Promise */
amazonPaapi.GetVariations(commonParameters, requestParameters)
.then(data => {
// do something with the success response.
console.log(data);
})
.catch(error => {
// catch an error.
console.log(error)
});