![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
amazon-pa-api50
Advanced tools
This Nodejs package use Amazon's NodeJS SDK to make the development simpler, in less time and use the power of NPM.
Learn more about Product Advertising API v5.
git clone git@github.com:arifulhb/amazon-pa-api50.git
npm install amazon-pa-api50 --save
Import the Config
module and Api
client.
const Api = require('amazon-pa-api50')
const Config = require('amazon-pa-api50/lib/config')
Optional loading of modules All of these are optional. Depends on what you want to search or fetch.
const resources = require('amazon-pa-api50/lib/options').Resources // Optional for different resources
const condition = require('amazon-pa-api50/lib/options').Condition // for product condition
const country = require('amazon-pa-api50/lib/options').Country // Optional for different country
const searchIndex = require('amazon-pa-api50/lib/options').SearchIndex // for Search Index
Create Config
instance
// By Default all resources and will connect to United States
let myConfig = new Config();
// if you want other country then united states.
let myConfig = new Config(undefined, country.UnitedKingdom);
// if you want custom resources.
// this custom `resources.Offers` will be set default to all of your search. You can customize the resources in your search specific function also.
let myConfig = new Config(resources.Offers);
// if you want custom resources with different country
let myConfig = new Config(resources.ItemInfo, country.Canada);
Configure the Config class
/**
* Add your Credentials Here
*/
myConfig.accessKey = '<ACCESS_KEY>'
myConfig.secretKey = '<SECRET_KEY>'
myConfig.partnerTag = '<PARTNER_TAG>'
After adding the credentials in myConfig
, Create Api
instance
const api = new Api(myConfig)
If all of your credentials are valid, you must be able to serach in Amazon now.
console.log(' ===== find by Item ids =====')
let resourceList = resources.getItemInfo
resourceList = resourceList
.concat(resources.getImagesPrimary)
api.getItemById(['B079JD7F7G'], {
parameters: resourceList,
condition: condition.Any
}).then((response) => {
console.log('data', response.data)
}, (error) => {
console.log('Error: ', error)
})
api
have four main functions to fetch data from amazon. Each function has 2 parameters and return promise
.
api.getItemById(['asin1', 'asin2'], {})
api.search('keyword', {})
api.getVariations('asin1', {})
api.getBrowseNodes(['nodeid1', 'nodeid2'], {})
Inside then
, block of the promise, response
object contain response.data
and response.response
as full faw response from Amazon.
Sample tutorial for how to use this library is given in ./demo/index.js
file.
console.log(' ===== find by Item ids =====')
let resourceList = parameters.getItemInfo
resourceList = resourceList
.concat(parameters.getImagesPrimary)
api.getItemById(['B079JD7F7G'], {
parameters: resourceList,
condition: condition.Any
}).then((response) => {
console.log('data', response.data)
}, (error) => {
console.log('Error: ', error)
})
console.log(' ===== search result =====')
let resourceList = parameters.getItemInfo
resourceList = resourceList
.concat(parameters.getImagesPrimary)
api.search("Cowin E8", {
parameters: resourceList,
searchIndex: searchIndex.Electronics
}).then((response) => {
console.log('data', response.data)
}, (error) => {
console.log('Error: ', error)
})
Inside then
, response
object contain response.data
and response.response
as full faw response from Amazon.
console.log(' ===== search result =====')
const resourceList = parameters.getVariationSummary
api.getVariations("B079JD7F7G", {
parameters: resourceList,
condition: condition.Any
}).then((response) => {
console.log('data', response.data)
}, (error) => {
console.log('Error: ', error)
})
console.log(' ===== getBrowserNode =====')
const resourceList = parameters.getBrowserNodes
api.getBrowseNodes(['284507'], {
parameters: resourceList
}).then((response) => {
console.log('data', response.data)
}, (error) => {
console.log('Error: ', error)
})
We'd love to have your helping hand on amazon-pa-api50! We are preparing the contributing guideline and todo list. Meanwhile, please install, test and use this to find bugs or any creative ideas.
amazon-pa-api50 is an open source library licensed as MIT.
FAQs
Amazon Product Advertising API v5.0 for JavasScript & NodeJs
The npm package amazon-pa-api50 receives a total of 119 weekly downloads. As such, amazon-pa-api50 popularity was classified as not popular.
We found that amazon-pa-api50 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.