Apr-19-2023, 01:43 PM
(This post was last modified: Apr-19-2023, 03:27 PM by deanhystad.)
You could set breakpoints in your debugger and look at ohc_data after it is returned but before you create df.
If you are not comfortable using a debugger you could modify the code to check if olhc_data contains a result key.
If you are not comfortable using a debugger you could modify the code to check if olhc_data contains a result key.
if 'result' in olhc_data:If 'result' is not on ohlc_data, print the dictionary, or the dictionary keys and quit, otherwise process the result as before.
if 'result' not in olhc_data: print(ohlc_data) # Try one of these print(list(ohlc_data.keys()) quit()And if you don't like doing that, you can run python and enter these lines one at a time.
import krakenex api = krakenex.API() data = api.query_public('OHLC', {'pair': 'XBT/USD', 'interval': 1440}) data # will print dictionary