How to get historical cryptocurrency data

Downloading minute resolution OHLC data via exchange APIs

Carsten Klein
Coinmonks
Published in
6 min readDec 30, 2018

--

UPDATE:

Because of the general interest in this matter I created a dataset including all OHLC data from the Bitfinex exchange API and uploaded it as a public dataset on Kaggle.

Introduction

Algorithmic trading is a popular way to tackle the fast-paced and volatile environment of cryptocurrency markets. However implementing an automated trading strategy is challenging and requires a lot of backtesting, which in turn requires a lot of historical data. While there are several sources available that provide historical cryptocurrency data most of them have drawbacks. Either they are expensive, provide only low temporal resolution data (daily) or cover limited time periods of a limited amount of currency pairs. Here we will see that obtaining historical open, high, low, close data (OHLC) at a 1-minute resolution is actually not a magical task and can be done in a few lines of Python code for free.

Also read: Best Crypto APIs for Developers

Connecting to the exchange

In this tutorial, we will use the Bitfinex exchange API to retrieve historical data. However, the approach…

--

--

Carsten Klein
Coinmonks

PhD in neuroscience interested in data analysis and artificial intelligence