im new into coding and im starting off with my first project, i was trying to write an amazon script which will be able to scrape asin. Im using the scraping api from sellermagnet which is offering an endpoint which is giving me all needed amazon information like title, rating, stock etc.
This is my script
import requests, json
scrapingAsin = "B07TC2BK1X"
print("Scraping asin" + str(scrapingAsin) + "...")
sellerMagnetResponse = requests.get("https://api.sellermagnet.com/amazon-product?apiKey=x&asin" + scrapingAsin)
if sellerMagnetResponse.status_code == 200:
scrapingData = json.loads(sellerMagnetResponse.text)
Im getting this error:
Traceback (most recent call last): AppDataLocalProgramsPythonPython39libjsondecoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
First time using an third party service for scraping amazon information
2
Answers
Looks like you’re missing an ‘=’ in your API request URL right after ‘asin’. It should be
...&asin= + scrapingAsin
. Also, ensure your API key (‘x’) is correct. Double-check the API docs to verify you’re using the endpoint correctly. If the issue persists, the problem might be with the API response itself or your API key might not have the correct permissions.Looks like your request URL is missing a = after asin. Try updating your URL to
https://api.sellermagnet.com/amazon-product?apiKey=x&asin= + scrapingAsin
. This way, you properly concatenate the ASIN to your request. If the error persists, ensure your API key is correct and active. Sometimes, simple typos or an expired API key can cause unexpected errors.