Loading...

Free Python

Download Coinbase API Data via Python

Download Coinbase API Data via Python

This is a short tutorial article that explains and gives example for how to use Python to download historical OHLC (Open, High, Low, Close) data with the Coinbase API. (*Please note that the Coinbase API is intended to be used for personal usage - refer to their market data terms). In the below Python script, we will use Pandas, requests, and json libraries to create a simple function that will ultimately write a CSV file with the filename "Coinbase_PAIR_dailydata.csv".. So if we want BTC/USD, the resulting filename will be: Coinbase_BTCUSD_dailydata.csv - Go ahead and give it a try!

This script is extremely simple, and can be greatly enhanced or fitted to meet your personal needs. It can easily be modified to save the data into a database, or pull different time frames or pairs... If you have a custom data need and would like help setting up the proper code, feel free to reach out to us



If you find this useful, you may also like to view our much more extensive article for Download Coinbase OHLC for any Timeframe, Symbol or Interval
Live codebase Python