Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,917 changes: 2,917 additions & 0 deletions SDK/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions SDK/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "paapi5-nodejs-sdk",
"version": "1.0.0",
"version": "1.1.0",
"description": "ProductAdvertisingAPI 5.0 NodeJS SDK",
"license": "Apache-2.0",
"main": "src/index.js",
Expand All @@ -26,10 +26,10 @@
"crypto-js": "^3.1.9-1"
},
"devDependencies": {
"mocha": "~2.3.4",
"sinon": "1.17.3",
"eslint": "^5.8.0",
"expect.js": "~0.3.1",
"eslint": "^5.8.0"
"mocha": "^10.0.0",
"sinon": "1.17.3"
},
"keywords": [
"amazon",
Expand Down
18 changes: 10 additions & 8 deletions SDK/sampleGetItemsApi.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down Expand Up @@ -47,15 +47,15 @@ getItemsRequest['PartnerTag'] = '<YOUR PARTNER TAG>';
getItemsRequest['PartnerType'] = 'Associates';

/** Enter the Item IDs for which item information is desired */
getItemsRequest['ItemIds'] = ['059035342X', 'B00X4WHP5E', 'B00ZV9RDKK'];
getItemsRequest['ItemIds'] = ['B09BWFX1L6', 'B0CFPJYX7P'];

getItemsRequest['Condition'] = 'New';

/**
* Choose resources you want from GetItemsResource enum
* For more details, refer: https://webservices.amazon.com/paapi5/documentation/get-items.html#resources-parameter
*/
getItemsRequest['Resources'] = ['Images.Primary.Medium', 'ItemInfo.Title', 'Offers.Listings.Price'];
getItemsRequest['Resources'] = ['Images.Primary.Medium', 'ItemInfo.Title', 'OffersV2.Listings.Price'];

/**
* Function to parse GetItemsResponse into an object with key as ASIN
Expand Down Expand Up @@ -98,12 +98,14 @@ function onSuccess(data) {
console.log('Title: ' + item['ItemInfo']['Title']['DisplayValue']);
}
if (
item['Offers'] !== undefined &&
item['Offers']['Listings'] !== undefined &&
item['Offers']['Listings'][0]['Price'] !== undefined &&
item['Offers']['Listings'][0]['Price']['DisplayAmount'] !== undefined
item['OffersV2'] !== undefined &&
item['OffersV2']['Listings'] !== undefined &&
item['OffersV2']['Listings'][0] !== undefined &&
item['OffersV2']['Listings'][0]['Price'] !== undefined &&
item['OffersV2']['Listings'][0]['Price']['Money'] !== undefined &&
item['OffersV2']['Listings'][0]['Price']['Money']['DisplayAmount'] !== undefined
) {
console.log('Buying Price: ' + item['Offers']['Listings'][0]['Price']['DisplayAmount']);
console.log('Buying Price: ' + item['OffersV2']['Listings'][0]['Price']['Money']['DisplayAmount']);
}
}
} else {
Expand Down
11 changes: 9 additions & 2 deletions SDK/src/ApiClient.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,6 +13,13 @@
* permissions and limitations under the License.
*/

/**
* Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
*/


/**
* ProductAdvertisingAPI
* https://webservices.amazon.com/paapi5/documentation/index.html
Expand Down Expand Up @@ -132,7 +139,7 @@ var awsv4 = require('./auth/SignHelper');
* Allow user to override superagent agent
*/
this.requestAgent = {
'User-Agent': 'paapi5-nodejs-sdk/1.0.0'
'User-Agent': 'paapi5-nodejs-sdk/1.2.1'
};
};

Expand Down
9 changes: 8 additions & 1 deletion SDK/src/api/DefaultApi.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -13,6 +13,13 @@
* permissions and limitations under the License.
*/

/**
* Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
*/


/**
* ProductAdvertisingAPI
* https://webservices.amazon.com/paapi5/documentation/index.html
Expand Down
17 changes: 16 additions & 1 deletion SDK/src/auth/SignHelper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
/**
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

/**
* Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
Loading