简体   繁体   中英

Get the lowest 4 prices for a given ASIN

I found this API on Amazon web services GetLowestOffersPriceListings , I also have my Acess Key, and Secret which i am not able to use.

ASIN = ['B07CGKVJ34','B07HJRQXNY']
url = 'https://mws.amazonservices.com/ASINList.ASIN.1={}&Action=GetLowestOfferListingsForASIN&MarketplaceId=ATVPDKIKX0DER\
&Signature={}&AWSAccessKeyId={}'.format(ASIN[0], secret, key)
res = requests.get(url, headers={'User-Agent': "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"})
print(res.text)

So i think my problem is with url itself, the format is wrong or not correct order.

What i want is to get the lowest 4 prices for a list of ASIN numbers, I am sorry but i can't share key and secret.

Edit 1: this URL opens but now i get API version is missing in the message secction.

You are using Amazon Marketplace Web Service (Amazon MWS) to query the Amazon Retail Inventory, which is very different to Amazon Web Services (AWS) which is used to host your own servers and systems.

You need to prefix the url with https://

ie

https://mws.amazonservices.com/

Also, the URL you need to call is actually https://mws.amazonservices.com/Products/2011-10-01 , which includes the version. Here is an example from the Amazon MWS documentation:

https://mws.amazonservices.com/Products/2011-10-01
    ?AWSAccessKeyId=AKIAJGUVGFGHNKE2NVUA
    &Action=GetLowestOfferListingsForASIN
    &MWSAuthToken=amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE
    &SellerId=A2NK2PX936TF53
    &SignatureVersion=2
    &Timestamp=2012-02-07T01%3A22%3A39Z
    &Version=2011-10-01
    &Signature=MhSREjubAxTGSldGGWROxk4qvi3sawX1inVGF%2FepJOI%3D
    &SignatureMethod=HmacSHA256
    &MarketplaceId=ATVPDKIKX0DER
    &ASINList.ASIN.1=B002KT3XRQ
    &ASINList.ASIN.2=B002KT3XQC
    &ASINList.ASIN.3=B002KT3XQM

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM