Skip to content

Instantly share code, notes, and snippets.

@nrese
Created June 5, 2020 00:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nrese/2a541df6ac8d5bd609ac2195bf9e4aee to your computer and use it in GitHub Desktop.
Save nrese/2a541df6ac8d5bd609ac2195bf9e4aee to your computer and use it in GitHub Desktop.
import urllib.request
url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=bitcoin"
print(urllib.request.urlopen(url).read())
b'[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://assets.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","current_price":9776.55,"market_cap":180127696282,"market_cap_rank":1,"total_volume":25178403205,"high_24h":9844.16,"low_24h":9512.73,"price_change_24h":122.44,"price_change_percentage_24h":1.26828,"market_cap_change_24h":2711215809,"market_cap_change_percentage_24h":1.52816,"circulating_supply":18394331.0,"total_supply":21000000.0,"ath":19665.39,"ath_change_percentage":-50.28552,"ath_date":"2017-12-16T00:00:00.000Z","atl":67.81,"atl_change_percentage":14317.7742,"atl_date":"2013-07-06T00:00:00.000Z","roi":null,"last_updated":"2020-06-05T00:00:37.137Z"}]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment