Last active
September 16, 2018 05:10
-
-
Save Lvl4Sword/452b15c0a1cfb6ded3e419073a3ed59b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
get_this = requests.get('https://api.coinmarketcap.com/v1/ticker/?convert=USD&limit=2000') | |
all_dict = {} | |
for each in get_this.json(): | |
ticker = each['symbol'] | |
all_dict[ticker] = {} | |
all_dict[ticker]['rank'] = each['rank'] | |
all_dict[ticker]['price'] = each['price_usd'] | |
all_dict[ticker]['volume'] = each['24h_volume_usd'] | |
all_dict[ticker]['market_cap'] = each['market_cap_usd'] | |
all_dict[ticker]['1h_change'] = each['percent_change_1h'] | |
all_dict[ticker]['24h_change'] = each['percent_change_24h'] | |
all_dict[ticker]['7d_change'] = each['percent_change_7d'] | |
all_dict[ticker]['name'] = each['name'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment