How to get candles data for not supported timeframes? (Coinbase)
Have you ever think about that you want to get some candle data but the wanted timeframe is unsupported by the exchange API? In this post, I will show you an easy solution to this problem. First of all, we will need API documentation.
I will go for Coinbase in this blog post. That means we will need Coinbase API documentation which can be found here. Today you will learn how to get wanted data without API access tokens directly from public rest API. In this example we will get all symbols, then we will want to create a method for return ohlc, ohlcv and we also want to fetch tickers.
OHLC or OHLCV are shortcuts that represent Open, High, Low, Close, and Volume. This is nothing else than a representation of the current state of the candle. Open represents opening price, High represents high value in the given timeframe, Low represents lower value in the given timeframe and Close stays for the closing value. Volume is simply the number of shares traded in a particular stock, index or other investment over a specific period of time.
The granularity
the field must be one of the following values: {60, 300, 900, 3600, 21600, 86400}
.