In [7]:
import etherscan.stats as stats
import json

Import API key from file


In [8]:
with open('../../api_key.json', mode='r') as key_file:
    key = json.loads(key_file.read())['key']

Initiate API


In [9]:
api = stats.Stats(api_key=key)

Get last price


In [10]:
api.get_ether_last_price()


Out[10]:
{'ethbtc': '0.02184',
 'ethbtc_timestamp': '1466963965',
 'ethusd': '13.82',
 'ethusd_timestamp': '1466963900'}

Get total ether supply


In [11]:
api.get_total_ether_supply()


Out[11]:
'81405568311600000000000000'

In [ ]: