coinforcast


In [1]:
import requests

In [2]:
allcoin = requests.get('https://coinbin.org/coins')

In [3]:
allc = allcoin.json()

In [4]:
allcoina = (allc['coins'])

In [ ]:
dcoi =  (allcoina.keys())

In [ ]:
for dc in dcoi:
    #print(dc)
    ethfor = requests.get('https://coinbin.org/{}/forecast'.format(dc))
    ethjs = ethfor.json()
    efore = (ethjs['forecast']) 
    lefor = len(efore)
    pricelis = list()
    for etj in range(0, lefor):
        #print(efore[etj])
        pricelis.append(efore[etj]['usd'])

In [ ]:
ethfor = requests.get('https://coinbin.org/btc/forecast')

In [ ]:
ethjs = ethfor.json()

In [ ]:
efore = (ethjs['forecast'])

In [ ]:
lefor = len(efore)

In [ ]:
pricelis = list()

sort dict base on value of certain key


In [ ]:
for etj in range(0, lefor):
    print(efore[etj])
    pricelis.append(efore[etj]['usd'])

In [ ]:
sorted(pricelis)

In [ ]:


In [ ]: