import requests
def get_prices():
name = ["SeedifyFund"]
crypto_data = requests.get(
"https://api.pancakeswap.info/api/tokens".format(",".join(name))).json()["RAW"]
data = {}
for i in crypto_data:
data[i] = {
"coin": i,
"priceusd": crypto_data[i]["USD"]["PRICE"],
"pricebnb": crypto_data[i]["BNB"]["PRICEBNB"],
}
return data
if __name__ == "__main__":
print(get_prices())
Hi all I'm a bit of a noob at coding with python. I started about a year ago and stopped during lockdown. Got back to it now and decided to build a price bot for a crypto currency. I want to extract data from this website: "https://api.pancakeswap.info/api/tokens" and have that data saved in "priceusd" and "pricebnb"
I hope I explained that well enough.
I would like to extract the data from the website however the code that I have used doesn't seem to be working. It give me a "RAW" error each time.
All help will be greatly appreciated. Thanks!