fbpx

Working Kraken API Python sample

(Last Updated On: December 9, 2021)

See below the working example ethusd @ limit Python for Kraken spot market

https://algotrading101.com/learn/kraken-api-guide/

https://github.com/dominiktraxl/pykrakenapi

https://github.com/veox/python3-krakenex

How to use Kraken API key

https://github.com/veox/python3-krakenex/blob/master/examples/kraken.key

sample Python code:

>>> from time import sleep

>>> import krakenex

>>> from pykrakenapi import KrakenAPI

>>> api = krakenex.API()

>>> kraken = KrakenAPI(api)

>>> api.load_key(‘KrakenPass.txt’)

>>> ETH = float((kraken.get_ticker_information(‘ETHUSD’))[‘a’][0][0]) + 2

>>> print(ETH)

1882.3

>>> response = kraken.add_standard_order(pair=’ETHUSD’, type=’buy’, ordertype=’limit’, volume=’0.007′, price=ETH, validate=False)

>>> print(response)

{‘descr’: {‘order’: ‘buy 0.00700000 ETHUSD @ limit 1882.30’}, ‘txid’: [‘xxx’]}

>>> response = kraken.add_standard_order(pair=’ETHUSD’, type=’sell’, ordertype=’limit’, volume=’0.007′, price=ETH, validate=False)

>>> print(response)

{‘descr’: {‘order’: ‘sell 0.00700000 ETHUSD @ limit 1882.30’}, ‘txid’: [xxx’]}

So the old parameter of Binance of qty is vol in Kraken. Here is the Kraken trading order log:

07/14/21

02:36:15

Trade

Ethereum

ETH

0.00700

ETH

0.00000

ETH

0.0093932000

ETH

07/14/21

02:36:15

Trade

US Dollar

USD

-13.1669

USD

0.0342

Note that the USD amount is $13 USD for minimum order of $10 USD. This is not like $75-$150 USD (or USDT) for minimum order as it used to be on Binance.

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Subscribe For Latest Updates

Sign up to best of business news, informed analysis and opinions on what matters to you.
Invalid email address
We promise not to spam you. You can unsubscribe at any time.

NOTE!

Check NEW site on stock forex and ETF analysis and automation

Scroll to Top