Code Monkey home page Code Monkey logo

amazon-pa-api50's Introduction

ARIFUL HAQUE

Backend Engineer

Tech Stack

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.

GitHub LinkedIn Twitter Stackoverflow

My current side project is LaptopList.com. Let me know if you have any comment.

github status:

Ariful's github stats Top Langs

amazon-pa-api50's People

Contributors

arifulhb avatar iicc1 avatar kinzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

amazon-pa-api50's Issues

Module not found: Can't resolve 'ApiClient'

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.

Item Value and availability

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

Resource filters not working?

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?

Dependencies were not found

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

Unexpected token u in JSON at position 0

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:

let searchItemsResponse = ProductAdvertisingAPIv1.SearchItemsResponse.constructFromObject(data)
searchItemsResponse = JSON.parse(JSON.stringify(searchItemsResponse))

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.