This problem exists in pykrakenapi version 0.1.8, but is fixed in 0.1.9
When using Kraken's REST API together with pykrakenapi
, some trading pairs (such as the very popular XBTUSD
) produce a KeyError, even though the pair exists in Kraken's Asset Pair endpoint.
For example, the following code
import krakenex
from pykrakenapi import KrakenAPI
timestamp = 1546300800000000000
pair = 'XBTUSD'
trades = k.get_recent_trades(pair=pair, since=timestamp, ascending=True)
results in the following error:
File "C:\Users\TimStack\PycharmProjects\Kraken\lib\site-packages\pykrakenapi\pykrakenapi.py", line 704, in get_recent_trades
trades = pd.DataFrame(res['result'][pair])
KeyError: 'XBTUSD'
The XBTUSD pair does show up in the AssetPairs endpoint, however: