-1

new to python here. Been trying this for quite a while now; would really appreciate some help.

I thought to try my hand at pulling data from an api, and what i got is a very long dictionary ( or at least i think its an dictionary )

response = requests.get('https://api.coingecko.com/api/v3/finance_products')
print(response.content)

can anyone give me any pointers on how to manipulate the results ?

I can't call the dictionary.

First few characters of it :

b'[{"platform":"Binance Savings","identifier":"CCOCOS30DAYSS001","supply_rate_percentage":"6.0","borrow_rate_percentage":null,"number_duration":null,"length_duration":null,"start_at":0,"end_at":0,"value_at":0,"redeem_at":0},{"platform":"DDEX Lending","identifier": etc etc

i'm not sure why there is a b' at the front.

Sorry if this isn't a clear question.

Chris Maes
  • 35,025
  • 12
  • 111
  • 136

1 Answers1

2

You can use

response.json()

which decodes it immediatly to a json object. Documentation here

Chris Maes
  • 35,025
  • 12
  • 111
  • 136