Kotlin, Java, Spring Boot, PHP, Symfony, Laravel, MySQL
Docker, Github, AWS [EC2, S3, ECS, ALB, SQS, VCS, CloudFront, CloudWatch, RDS].
Let's connect and grow.
My current side project is LaptopList.com. Let me know if you have any comment.
Amazon Product Advertising API v5.0 for JavaScript and NodeJs
Home Page: https://www.npmjs.com/package/amazon-pa-api50
License: MIT License
Kotlin, Java, Spring Boot, PHP, Symfony, Laravel, MySQL
Docker, Github, AWS [EC2, S3, ECS, ALB, SQS, VCS, CloudFront, CloudWatch, RDS].
Let's connect and grow.
My current side project is LaptopList.com. Let me know if you have any comment.
Add return statement for smoot execution in promise.
I'm getting the following issue using Node v16.14.2 on Ubuntu 20.04. I didn't change anything to the code, that happened right away.
Any ideas?
Module not found: Can't resolve 'ApiClient' in '/%project_root%/node_modules/amazon-pa-api50/sdk/src'
Did you mean './ApiClient'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
Line 152 in d089c45
With current implementation it is not possible to add custom search params from official documentation for paapi5 https://webservices.amazon.com/paapi5/documentation/search-items.html#ItemLookup-rp
Proposal: Merge by Object.assign
second argument params
with getSearchItemsRequest
. Same approach can be applied for all methods: getItemById
, search
, getVariations
, getBrowseNodes
.
Best regards
Hi good day
I am trying to search for products on Amazon and I tried to add the parameter "availability" but it doesn't work because it brings products out of stock, I would like to know if I'm doing it right
let resourceList = resources.getAll; let word = "Shoes";
api.search(word, { parameters: resourceList, condition: condition.New, itemCount: 1, OfferCount: 1, availability: 'available' }).then(response => { let data= response.data console.log(JSON.stringify(data)) }).catch(error => { console.log(error) })
On the other hand
Is there a way to bring the price of the product?
I've tried different ways but still can't get it. Thank you very much for your attention and collaboration
Howdy,
No matter what I set for the resources, I always seem to get the same response back for any ASIN.
Try B000Y854WC on the UK site, eg below:
api.getItemById(['B000Y854WC'], {
// resources: resourceList,
resources: ["ItemInfo.ExternalIds", "ItemInfo.ProductInfo"],
// condition: condition.Any
})
The response is always the same, regardless of what resource value is set.
console.log('data', response.data)
console.log('data', response.data.ItemsResult)
console.log('data', response.data.ItemsResult.Items[0].ItemInfo)
data { ItemsResult: { Items: [ [Object] ] } }
data { Items:
[ { ASIN: 'B000Y854WC',
DetailPageURL: 'https://www.amazon.co.uk/dp/B000Y854WC?tag=chromeapp02-21&linkCode=ogi&th=1&psc=1',
ItemInfo: [Object] } ] }
data { Title:
{ DisplayValue: 'Campingaz Camp Bistro 2 Camping Stove, 1 Flame Portable Gas Cartridge Cooker, Runs on Campingaz CP 250 Cartridges, 2200 WW',
Label: 'Title',
Locale: 'en_GB' } }
Am I doing something wrong here @arifulhb?
First of all, thanks for providing this easy solution. Official SDK config is a mess.
I have been trying official sdk earlier with my VueJS application and during compile in serve mode, i was getting dependencies were not found error. So i just tried amazon-pa-api50
but i have the same issue during compile process.
It works fine if i try to node amazon.js
in console and i'm getting proper response (same for official sdk)
But when i including it inside .vue file then it won't work.
Failed to compile with 88 errors
These dependencies were not found:
* ApiClient in ./node_modules/amazon-pa-api50/sdk/src/index.js
* api/DefaultApi in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/Availability in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/BrowseNode in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/BrowseNodeAncestor in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/BrowseNodeChild in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/BrowseNodeChildren in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/BrowseNodeInfo in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/BrowseNodesResult in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ByLineInfo in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/Classifications in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/Condition in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ContentInfo in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ContentRating in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/Contributor in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/DeliveryFlag in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/DimensionBasedAttribute in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/DurationPrice in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ErrorData in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ExternalIds in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/GetBrowseNodesRequest in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/GetBrowseNodesResource in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/GetBrowseNodesResponse in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/GetItemsRequest in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/GetItemsResource in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/GetItemsResponse in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/GetVariationsRequest in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/GetVariationsResource in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/GetVariationsResponse in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ImageSize in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ImageType in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/Images in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/Item in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ItemIdType in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ItemInfo in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ItemsResult in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/LanguageType in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/Languages in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ManufactureInfo in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/MaxPrice in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/Merchant in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/MinPrice in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/MinReviewsRating in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/MinSavingPercent in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/MultiValuedAttribute in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferAvailability in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferCondition in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferCount in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferDeliveryInfo in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferListing in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferLoyaltyPoints in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferMerchantInfo in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferPrice in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferProgramEligibility in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferPromotion in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferSavings in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferShippingCharge in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferSubCondition in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/OfferSummary in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/Offers in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/PartnerType in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/Price in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ProductAdvertisingAPIClientException in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ProductAdvertisingAPIServiceException in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/ProductInfo in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/Properties in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/Refinement in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/RefinementBin in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/RentalOfferListing in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/RentalOffers in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/SearchItemsRequest in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/SearchItemsResource in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/SearchItemsResponse in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/SearchRefinements in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/SearchResult in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/SingleBooleanValuedAttribute in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/SingleIntegerValuedAttribute in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/SingleStringValuedAttribute in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/SortBy in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/TechnicalInfo in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/TradeInInfo in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/TradeInPrice in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/UnitBasedAttribute in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/VariationAttribute in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/VariationDimension in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/VariationSummary in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/VariationsResult in ./node_modules/amazon-pa-api50/sdk/src/index.js
* model/WebsiteSalesRank in ./node_modules/amazon-pa-api50/sdk/src/index.js
To install them, you can run: npm install --save ApiClient api/DefaultApi model/Availability model/BrowseNode model/BrowseNodeAncestor model/BrowseNodeChild model/BrowseNodeChildren model/BrowseNodeInfo model/BrowseNodesResult model/ByLineInfo model/Classifications model/Condition model/ContentInfo model/ContentRating model/Contributor model/DeliveryFlag model/DimensionBasedAttribute model/DurationPrice model/ErrorData model/ExternalIds model/GetBrowseNodesRequest model/GetBrowseNodesResource model/GetBrowseNodesResponse model/GetItemsRequest model/GetItemsResource model/GetItemsResponse model/GetVariationsRequest model/GetVariationsResource model/GetVariationsResponse model/ImageSize model/ImageType model/Images model/Item model/ItemIdType model/ItemInfo model/ItemsResult model/LanguageType model/Languages model/ManufactureInfo model/MaxPrice model/Merchant model/MinPrice model/MinReviewsRating model/MinSavingPercent model/MultiValuedAttribute model/OfferAvailability model/OfferCondition model/OfferCount model/OfferDeliveryInfo model/OfferListing model/OfferLoyaltyPoints model/OfferMerchantInfo model/OfferPrice model/OfferProgramEligibility model/OfferPromotion model/OfferSavings model/OfferShippingCharge model/OfferSubCondition model/OfferSummary model/Offers model/PartnerType model/Price model/ProductAdvertisingAPIClientException model/ProductAdvertisingAPIServiceException model/ProductInfo model/Properties model/Refinement model/RefinementBin model/RentalOfferListing model/RentalOffers model/SearchItemsRequest model/SearchItemsResource model/SearchItemsResponse model/SearchRefinements model/SearchResult model/SingleBooleanValuedAttribute model/SingleIntegerValuedAttribute model/SingleStringValuedAttribute model/SortBy model/TechnicalInfo model/TradeInInfo model/TradeInPrice model/UnitBasedAttribute model/VariationAttribute model/VariationDimension model/VariationSummary model/VariationsResult model/WebsiteSalesRank
Also VSCode is showing this message on require. http://prntscr.com/qt023x
Any suggestion?
Thanks
In lib/references/country.js
Italy region is not: ''
It is: 'eu-west-1'
I'm not 100% when this happens but it's probably on an empty or faulty response from the API:
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse (<anonymous>)
at /app/node_modules/amazon-pa-api50/src/index.js:181:38
at /app/node_modules/amazon-pa-api50/sdk/src/ApiClient.js:504:9
It happens in those lines when searchItemsResponse
is undefined:
Lines 180 to 181 in d089c45
So I guess it's either checking if searchItemsResponse
actually is a JSON object or making sure ProductAdvertisingAPIv1.SearchItemsResponse.constructFromObject(data)
does not return anything else.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.