Skip to main content

A well-documented Python API for the Kraken Cryptocurrency Exchange

Project description

Krakipy

PyPI version Documentation Status Downloads License: MIT

Krakipy is an easy to use Kraken API. It uses the REST-API of the Kraken.com cryptocurrency exchange.

For more information please visit the krakipy documentation

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 to install krakipy.

pip install krakipy

Usage Examples

Public Requests

Public requests dont need API keys.

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.

from krakipy import KrakenAPI

api_key = "*************************************************"
api_key_secret = "*************************************************"

# Create a validated session
kr = KrakenAPI(api_key, api_key_secret)


# Create a Limit order to buy 1.5 Bitcoin under 100,000.0 EUR/BTC
kr.add_standard_order("XXBTZEUR", "buy", "limit", volume = 1.5, price = 100000.0)
->
{'descr': {'order': 'buy 1.50000000 XBTEUR @ limit 100000.0'},
 'txid': ['OHPCQQ-HRJTQ-ZBDGSE']}


# Check your account balance
kr.get_account_balance()

# Withdraw 1.0 Bitcoin to myBTCWallet
kr.withdraw("XBT", "myBTCWallet", 1.0)

# Unstake 300.0 Polkadot
kr.unstake_asset("DOT", 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-2023 Hubertus Wilisch

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

krakipy-0.1.9-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file krakipy-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: krakipy-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.31.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for krakipy-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 89687f7c1fa8b16259767078cac2c2b65f96feaddd25dad65626dd819ce67d8d
MD5 7a2be80c2e840ce42621c12feae8eed9
BLAKE2b-256 f480219fe26f7c162023d1387b9c4d7ada6343a67fc952eca7cb1da860e6f469

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page