CryptoCompare API Quick Start Guide

This is the best way to get intraday trading data for cryptocurrencies. I’ll run run through the most useful API functions to get current and historical intraday prices (OHLCV) on the hourly and minute time frames!

Last updated: August 2017

Source Code

Check out the full code in this IPython notebook. I use these packages —

import requests
import datetime
import pandas as pd
import matplotlib.pyplot as plt

Live Coin Prices

Image for post
Image for post

Daily Historical Price (OHLCV)

Using the default arguments, this function will return the entirety of the available price history. To specify a row limit, pass all_data=False and use the limit parameter.

Image for post
Image for post
Image for post
Image for post

Hourly Historical Price (OHLCV)

Image for post
Image for post
Using a bar width of 1 hour
Image for post
Image for post
Using a bin width of 24 hours

Historical Price by Minute (OHLCV)

Image for post
Image for post

Coin List

Lists out each coin (as of 2017–08 there are > 1400) and gives various details such as metrics related to the mining protocol.

Image for post
Image for post

It’s important to extract the Id for each coin to use in the following API calls.

symbol_id_dict = {symb: int(d['Id']) for symb, d in data.items()}

Live Coin Information

Image for post
Image for post

Live Social Status

Image for post
Image for post

Conclusion

It’s pretty amazing that all this data is available through an API. Wonderful work by the people at https://www.cryptocompare.com/

Thanks for reading! If anything’s changed since I last updated this, please send me a message on twitter @agalea91

Written by

Python Data Engineer, MSc. Physics

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store