All
Filter by:
How do I deposit cash into my account?
I need help with account verification
Why can't I access my account?
Are there any crypto withdrawal fees?
I need help signing into my account
Required Legal Notice: Virtual currencies, real risks. The only guarantee in crypto is risk. Read more
Required Legal Notice: Virtual currencies, real risks. The only guarantee in crypto is risk. Read more
Required Legal Notice: Virtual currencies, real risks. The only guarantee in crypto is risk. Warning: The value of your virtual currencies can rise or fall sharply, and your initial investment may be lost completely; virtual currencies are not covered by the guarantee funds that cover bank deposits; there is no legal mechanism on the virtual currencies market to prevent market manipulation or insider dealing; virtual currencies depend entirely on a specific computer technology and infrastructure, which in certain cases may be very recent and not yet adequately tested; if one loses the identification code or password giving access to the virtual wallet in which the virtual currency is stored, the currency held therein will be irretrievably lost; virtual currencies are currently accepted as a means of payment to a limited extent, and in most countries there is no legal obligation to accept them; for more information about the risks associated with an investment in virtual currencies, we advise you to read the Wikifin page What is a cryptocurrency? | Wikifin.
Required Legal Notice: Virtual currencies, real risks. The only guarantee in crypto is risk. Warning: The value of your virtual currencies can rise or fall sharply, and your initial investment may be lost completely; virtual currencies are not covered by the guarantee funds that cover bank deposits; there is no legal mechanism on the virtual currencies market to prevent market manipulation or insider dealing; virtual currencies depend entirely on a specific computer technology and infrastructure, which in certain cases may be very recent and not yet adequately tested; if one loses the identification code or password giving access to the virtual wallet in which the virtual currency is stored, the currency held therein will be irretrievably lost; virtual currencies are currently accepted as a means of payment to a limited extent, and in most countries there is no legal obligation to accept them; for more information about the risks associated with an investment in virtual currencies, we advise you to read the Wikifin page What is a cryptocurrency? | Wikifin.
Implementing a Kraken REST API interface using the Bourne Again shell (bash) and some associated commands (openssl, base64, xxd, etc.) can be a convenient and efficient solution for interacting with Kraken's markets (although it would not be the fastest implementation compared to compiled code).
Bash and the required commands are readily available (pre-installed) on most UNIX, Linux, and macOS systems, and can be easily installed on Windows and other systems, so all of the required software is available without using any additional third party API tools or libraries.
Using a plain text editor (even an old school editor such as vi) and a few lines of code, it is possible to access both public market data and private account data, and also to place/cancel orders on Kraken's markets.
The following code shows a bash code implementation for calling the REST API Balance endpoint:
#!/usr/bin/env bash
# API public/private keys copied from account management web site
api_key='gxTXpC4Ag/N0QPKlYnRhL1qVB2G/HZV1eB2drl7eOXga30dEKoB+EUMs'
api_private='62kRfRX7BI8G8T/jl7clnZ+vSfJt7YmQN23JQkJfHCE6oxecJX4fN4i2RitmRhyFzfJ4efKy2yCo4H068rfv0A=='
# API variables (URL, endpoint, nonce, etc.)
api_host='https://api.kraken.com'
api_endpoint='/0/private/Balance'
api_nonce=`date +%s`
api_post="nonce=$api_nonce"
# Authentication algorithm (SHA256 and HMAC SHA512)
api_private_hex=`echo -n $api_private base64 -d xxd -p tr -d "\n"`
echo -n $api_endpoint > kapi_bash.bin
echo -n $api_nonce$api_post openssl dgst -sha256 -binary >> kapi_bash.bin
api_sign=`cat kapi_bash.bin openssl dgst -binary -sha512 -mac HMAC -macopt hexkey:$api_private_hex base64`
# HTTP request (POST)
curl --header "API-Key: $api_key" --header "API-Sign: $api_sign" --data $api_post $api_host$api_endpoint
and the matching code can also be downloaded (as a kapi_bash.sh file).
To retrieve your own account balances, the example API key should be replaced with an API key from your own Kraken account, and additional API endpoints can be enabled simply by modifying the api_endpoint variable and the api_post variable (if needed).