paapi5-product-lookup
This package creates a wrapper around paapi5-amazon-sdk for the GetItems, SearchItems, GetBrowseNodes and GetVariations request.
Installation
npm install paapi5-product-lookup
Table of Content
- Basic Implementation of all method
- Creating a Lookup object
- Get Items details from ASIN
- Search Item using keywords
Basic Implementation of all method
Check all allowed operations in PAAPI5 - https://webservices.amazon.com/paapi5/documentation/operations.html
const ProductLookup = ; let args = 'AccessKey': 'Your Access Key' 'SecretKey': 'Your Secret Key' 'PartnerType': 'Associates' 'PartnerTag': 'Your Partner Tag or Storeid' 'Host': 'webservices.amazon.in' 'Region': 'eu-west-1' //Resources:['ItemInfo.Title', 'Offers.Listings.Price'] const Lookup = args; Lookup; Lookup; Lookup; Lookup
Create a Lookup object
const ProductLookup = ; let args = 'AccessKey': 'Your Access Key' 'SecretKey': 'Your Secret Key' 'PartnerType': 'Associates' 'PartnerTag': 'Your Partner Tag or Storeid' 'Host': 'webservices.amazon.in' 'Region': 'eu-west-1' //Resources:['Value1','Value2'] can be pass at the time of object creation. It'll act as a default Resources for all future requests.const Lookup = args;
Find your PAAPI Host and Region by clicking here.
Get Items details from ASIN
Getting Items details by passing ASIN, Resources and other params to getItems
method.
var requestParams = ItemIds: 'B07H6NJX5F''B07H6NJX5Z' Resources: 'ItemInfo.Title' 'Offers.Listings.Price' //Condition: default - Any //OfferCount: default - 1 Lookup;
Output:
"Items": "B07H6NJX5F": "ASIN": "B07H6NJX5F" "DetailPageURL": "https://www.amazon.in/dp/B07H6NJX5F?tag=mysm-21&linkCode=ogi&th=1&psc=1" "ItemInfo": "Title": "DisplayValue": "Poco F1 by Xiaomi (Armored Edition, 8GB RAM, 256GB Storage) - Extra 2,000 Off on Exchange & Upto 6 Months No Cost EMI" "Label": "Title" "Locale": "en_IN" "Offers": "Listings": "Id": "qNft0S0qJgBKa7yu58xs%2BPvEjk4iln5WlWd9zeo9qPEELTaANW1ykrZqfaopS4S%2FDv46%2BlrOMgayEGHCcrG6vcea%2BkVPtSmPTSPXF6G%2FxU68W0mKxWtEyQsl69YPgLp1" "Price": "Amount": 16999 "Currency": "INR" "DisplayAmount": "₹ 16,999.00" "Savings": "Amount": 14000 "Currency": "INR" "DisplayAmount": "₹ 14,000.00 (45%)" "Percentage": 45 "ViolatesMAP": false "Errors": "Code": "InvalidParameterValue" "Message": "The ItemId B07H6NJX5Z provided in the request is invalid."
Search Item using keywords
- Check categories of SearchIndex
- Check for all the Request Parameters
- SearchItems Resource parameters
var requestParams = "Keywords": 'iphone 6S' "SearchIndex": 'Electronics' "ItemCount": 3//default:10 "SortBy": "Relevance"//default:None "Availability":"IncludeOutOfStock"//default:Available "Condition": "New" //default:Any "Resources": 'ItemInfo.Title'; Lookup
Output:
"Items": "B016QBU4S4": "ASIN": "B016QBU4S4" "DetailPageURL": "https://www.amazon.in/dp/B016QBU4S4?tag=mysm-21&linkCode=osi&th=1&psc=1" "ItemInfo": "Title": "DisplayValue": "Apple iPhone 6s (128GB) - Gold" "Label": "Title" "Locale": "en_IN" "B01LXF3SP9": "ASIN": "B01LXF3SP9" "DetailPageURL": "https://www.amazon.in/dp/B01LXF3SP9?tag=mysm-21&linkCode=osi&th=1&psc=1" "ItemInfo": "Title": "DisplayValue": "Apple iPhone 6s (32GB) - Rose Gold" "Label": "Title" "Locale": "en_IN" "B016QBTYIK": "ASIN": "B016QBTYIK" "DetailPageURL": "https://www.amazon.in/dp/B016QBTYIK?tag=mysm-21&linkCode=osi&th=1&psc=1" "ItemInfo": "Title": "DisplayValue": "Apple iPhone 6s (128GB) - Space Grey" "Label": "Title" "Locale": "en_IN"