I have been working with two APIs to fetch data from amazon.com. Using first API I am getting a series of ASINs (string) and now need to pass first 10 ASINs to second API URL to fetch "Product Description".
I am getting ASINs from first API in below format. All strings
B07BJL8CL2
B00CA6X50Y
B01LI4IDQO
B000HTENO8
B00XKXNGT6
Second API URL querystring_lookupProduct = {"url":"https://www.amazon.com/dp/B09BVQPNWZ"}
I have to dynamically replace the end part B09BVQPNWZ with ASINs I am getting from first API. Would really appreciate your help.
One is to convert ASIN in list but as I try to do this I get the response like this
['B', '0', '7', 'B', 'J', 'L', '8', 'C', 'L', '2']
['B', '0', '0', 'C', 'A', '6', 'X', '5', '0', 'Y']
['B', '0', '0', 'X', 'K', 'X', 'N', 'G', 'T', '6']
['B', '0', '1', 'L', 'I', '4', 'I', 'D', 'Q', 'O']
asin_to_fetch), then 2) iterate over this list:for asin in asin_to_fetch: ...and 3) use string formatting to build the desired URL:url="https://www.amazon.com/dp/{}".format(asin)