Requesting multiple Krakenex API pairs

I am trying to use the Krakenex python library to query the order book for multiple currency pairs at the same time. When I do this for a single currency, it works, for example:

con = krakenex.API()
con.load_key('kraken.key')
con.query_public('Depth', {'pair':'GNOETH'})

      

However, if I do this:

con = krakenex.API()
con.load_key('kraken.key')
con.query_public('Depth', {'pair':['GNOETH', 'GNOEUR']})

      

I receive {'error': ['EQuery:Unknown asset pair']}

. I am assuming the syntax is wrong, but cannot figure out the correct one. This is the first time I use the API and the example provided does not cover enough information.

+3


source to share


2 answers


Unfortunately, you cannot request Depth

multiple asset pairs with a single request. I had the same question for Kraken support: their reason for not allowing this is the high computational cost.



In contrast, a query, for example, AssetPairs

works the same.

+2


source


Spent a lot of time trying to play different combos, finally figured it out.



try it con.query_public('Depth', {'pair':'GNOETH, GNOEUR'})

0


source







All Articles