def get_historical_candles(self, symbol, interval):
data = dict()
data['symbol'] = symbol
data['interval'] = interval
data['limit'] = 1000
response = requests.get('https://api.binance.com/api/V3/kline', data)
raw_candles = response.json()
candles = []
if raw_candles is not None:
for c in raw_candles:
candles.append([c[0], float(c[1]), float(c[2]), float(c[3]), float(c[4]), float(c[5])])
print(candles)
How can i avoid the error mentioned in the title?
I have tried
Fetch Candlestick/Kline data from Binance API using Python (preferably requests) to get JSON Dat
and it works well.
However, i need to find out a solution for this approach
response = requests.get('https://api.binance.com/api/V3/kline', data)