dominiktraxl / pykrakenapi

A python implementation of the Kraken API.
GNU Lesser General Public License v3.0
223 stars 53 forks source link

Recent Kraken changes broke pykrakenapi? #82

Open DrWest opened 5 months ago

DrWest commented 5 months ago

There seems to have been a recent change on Kraken's side that has broken pykrakenapi. I have had a script running for months that uses the OHLC data. Today my script stopped working, and running the following example from the home page:

import krakenex from pykrakenapi import KrakenAPI api = krakenex.API() k = KrakenAPI(api) ohlc, last = k.get_ohlc_data("BCHUSD") print(ohlc)

gives me the following error: attempt: 000 | ['EGeneral:Invalid arguments']

JGroxz commented 5 months ago

I'm getting the same thing when krakenex>=2.2.0 is installed. Downgrading krakenex to 2.1.0and running the same code results in the following:

attempt: 000 | 405 Client Error: Not Allowed for url: https://api.kraken.com/0/public/OHLC

Have no idea what can be causing this yet.

JGroxz commented 5 months ago

In Kraken API's changelog, they mention:

Jan 2024 - Removed support for POST requests to all public endpoints; these requests will now return a 4xx error, please use a GET request instead. Added notes to Balance and Ledger endpoints on migration from Staking to Earn and asset suffixes.

But krakenex's update 2.2.0 fixes exactly this based on its changelog.

JGroxz commented 5 months ago

Should get resolved by this pull request from krakenex: https://github.com/veox/python3-krakenex/pull/141

DrWest commented 5 months ago

I found this comment on krakenex and copied the temporary fix with success:

https://github.com/veox/python3-krakenex/issues/140#issuecomment-1919756623

veox commented 5 months ago

krakenex has been updated to v2.2.1 with the aforementioned fix https://github.com/veox/python3-krakenex/pull/141 - please update.

This is (was) a dependency issue, not pykrakenapi directly. Probably OK to close.

EDIT: Actually, requirements.txt needs a bump:

krakenex>=2.2.1,<3