|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > KRAKEN API - Cryptocurrency Trading |
The KRAKEN.* commands provide access to the Kraken cryptocurrency exchange API, one of the oldest and most secure Bitcoin exchanges.
Feature |
Value |
API Base URL |
https://api.kraken.com |
Authentication |
HMAC-SHA512 Signature |
Default Pair |
XXBTZUSD (Kraken uses X-prefixed asset codes) |
Asset Pair Notation
Kraken uses unique asset codes with X/Z prefixes:
XXBT = Bitcoin (XBT)XETH = EthereumZUSD = US DollarZEUR = EuroXXBTZUSD = BTC/USD pairXETHZEUR = ETH/EUR pair
Available Commands
Command |
Purpose |
API Key Required |
Initialize the API |
No |
|
Set your API Key |
N/A |
|
Set your API Private Key |
N/A |
|
Get current price for a pair |
No |
|
Get account balance (JSON) |
Yes |
|
Place a buy/sell order |
Yes |
|
Cancel an open order |
Yes |
|
Get list of open orders |
Yes |
Quick Start Example
; Initialize Kraken API
KRAKEN.Init
; Set your API credentials
KRAKEN.SetKey|your_api_key_here
KRAKEN.SetSecret|your_private_key_base64_here
; Get current Bitcoin price in USD
KRAKEN.GetPrice|XXBTZUSD|btcPriceJson
; Parse JSON to extract price using PSJ commands...
Security Notes
Never commit API keys to version control.The Kraken private key is base64 encoded - copy it directly from the Kraken website.Consider using a demo/sub-account for testing.Never enable withdrawal permissions for API keys used by scripts.
See Also
BINANCE API - Alternative exchangePSJ.Parse - Parse JSON responses