Installing the Blockchain.info Python library
The following are the steps to install the blockchain
Python library:
- Open the command-line program on your computer.
- Run the
pip install blockchain
command to install theblockchain
library.
The following screenshot shows the installation of bitcoin:

Getting bitcoin exchange rates from Blockchain.info
The following steps shows the method for bitcoin exchange rates:
- First, import the
exchangerates
classes from theblockchain
library:
#!/usr/bin/env python # import blockchain library from blockchain import exchangerates
- Exchange rates define a
get_ticker
method, which returns the exchange rates data in a dictionary object. Call this method and save the resulting object. Theticker
dictionary object that we have has currency symbols as keys:
# get the Bitcoin rates in various currencies ticker = exchangerates.get_ticker()
- By running over these keys, data about the various rates can be pulled. For example, the latest bitcoin rates can be obtained in each...