https://github.com/aionoso/krakipy
Python Kraken API
https://github.com/aionoso/krakipy
bitcoin cryptocurrency cryptocurrency-exchanges kraken kraken-exchange-api rest-api
Last synced: 10 months ago
JSON representation
Python Kraken API
- Host: GitHub
- URL: https://github.com/aionoso/krakipy
- Owner: Aionoso
- License: mit
- Created: 2020-10-15T23:29:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-06-20T07:37:00.000Z (about 1 year ago)
- Last Synced: 2025-08-19T10:53:24.098Z (10 months ago)
- Topics: bitcoin, cryptocurrency, cryptocurrency-exchanges, kraken, kraken-exchange-api, rest-api
- Language: Python
- Homepage:
- Size: 6.62 MB
- Stars: 3
- Watchers: 1
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
# Krakipy
[](https://badge.fury.io/py/krakipy)
[](https://krakipy.readthedocs.io/en/latest/?badge=latest)
[](https://pepy.tech/project/krakipy)
[](https://github.com/Aionoso/Krakipy/blob/master/LICENSE)
Krakipy is an easy to use Kraken API.
It uses the [REST-API](https://docs.kraken.com/api/docs/rest-api/get-server-time) of the [Kraken.com](https://www.kraken.com) cryptocurrency exchange.
For more information please visit the [krakipy documentation](https://krakipy.readthedocs.io/en/latest/)
08.03.2025 - Updated krakipy to include get_order_amends and get_withdrawal_methods and fixed bugs
29.10.2023 - Updated krakipy to include new functions and fixed bugs
31.07.2021 - Updated krakipy to support staking and unstaking
### Features
- All methods of the Kraken Rest API are included (Krakipy documentation also updated)
- Easy and fast to use
- Two factor authentification support (static and OTP)
- Tor support
## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install krakipy.
```bash
pip install krakipy
```
## Usage Examples
### Public Requests
Public requests dont need API keys.
```python
from krakipy import KrakenAPI
# Create a session
kr = KrakenAPI()
# Get Ticker for Bitcoin/EUR
kr.get_ticker_information("XXBTZEUR")
# Get OHLC for Doge/Tether
kr.get_ohlc_data("XDGUSDT")
# Get Spreads for Ether/USD
kr.get_recent_spreads("XETHZUSD")
# Check the Kraken API system status
kr.get_system_status()
```
### Private Requests
Private requests need a valid API key pair to your Kraken account for validation.
```python
from krakipy import KrakenAPI
api_key = "*************************************************"
api_key_secret = "*************************************************"
# Create a validated session
with KrakenAPI(api_key, api_key_secret) as kr:
# Create a limit order to buy 1.5 Bitcoin at 100,000.0 EUR/BTC
kr.add_standard_order("XXBTZEUR", "buy", "limit", volume = 1.5, price = 100000.0)
# Check your account balance
kr.get_account_balance()
# Withdraw 1.0 Bitcoin to myBTCWallet
kr.withdraw("XBT", "myBTCWallet", 1.0)
# Unstake 300.0 Solana
kr.unstake_asset("SOL", 300.0)
# Download and save an export report to kraken_reports/
kr.retrieve_export_report(report_id, dir="kraken_reports/")
```
## License
The krakipy code is licensed under the MIT LICENSE.
This program comes with ABSOLUTELY NO WARRANTY
Krakipy Copyright (C) 2020-2025 Hubertus Wilisch