Skip to main content

Documentation Index

Fetch the complete documentation index at: https://kraken-sandbox.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through the complete setup from creating your API key to placing your first order programmatically.
1

Create a Kraken account

If you don’t have one, sign up at kraken.com. You’ll need to complete identity verification before accessing trading APIs.
Spot trading requires a verified account. Futures trading requires additional activation — see your account settings.
2

Generate an API key

Go to Settings → API and click Add key.For this quickstart, enable these permissions:
  • Query Funds — read balances
  • Query Open Orders & Trades — read order status
  • Create & Modify Orders — place orders
Copy your API key and private key. The private key is only shown once.
Store your private key securely. Never commit it to version control or share it. For production use, restrict the key to specific IP addresses.
3

Verify connectivity

Check that the API is reachable and your system clock is correct. The Time endpoint requires no authentication:
curl https://api.kraken.com/0/public/Time
Expected response:
{
  "error": [],
  "result": {
    "unixtime": 1700000000,
    "rfc1123": "Thu,  1 Jan 2026 00:00:00 +0000"
  }
}
Your system clock must be within a few seconds of real time. An incorrect clock is the most common cause of EAPI:Invalid nonce errors.
4

Check your balances

Your first authenticated request. The nonce must be a strictly increasing integer — using the current timestamp in milliseconds works well.
API_KEY="your_api_key"
API_SECRET="your_private_key"
NONCE=$(date +%s%3N)
DATA="nonce=$NONCE"
API_PATH="/0/private/Balance"

SIGNATURE=$(echo -n "${NONCE}${DATA}" | \
  openssl dgst -sha256 -binary | \
  cat <(echo -n "$API_PATH") - | \
  openssl dgst -sha512 -binary -hmac "$(echo "$API_SECRET" | base64 -d)" | \
  base64)

curl -X POST "https://api.kraken.com${API_PATH}" \
  -H "API-Key: $API_KEY" \
  -H "API-Sign: $SIGNATURE" \
  -d "$DATA"
5

Test in a UAT environment

Both Spot and Futures provide UAT environments for validating your integration before going live.Spot UAT is available on request — contact your Account Manager. Once provisioned, it uses a separate base URL and isolated API keys but mirrors the full production trading stack.Futures sandbox is self-service at https://demo-futures.kraken.com. Generate a separate API key on the demo platform to get started immediately.
# Futures sandbox — get available instruments
curl https://demo-futures.kraken.com/derivatives/api/v3/instruments

# Place a limit order (buy 1 BTC perpetual at $90,000)
curl -X POST https://demo-futures.kraken.com/derivatives/api/v3/sendorder \
  -H "APIKey: your_sandbox_api_key" \
  -H "Authent: your_signature" \
  -d "orderType=lmt&symbol=PF_XBTUSD&side=buy&size=1&limitPrice=90000"
The Futures demo environment resets periodically. It is intended for integration validation, not persistent backtesting.

Next steps

API key permissions

Understand which permissions to enable for each use case

Authentication

Deep dive into nonce management and signature generation

Rate limits

Understand trading rate limits and how to stay within them

WebSocket

Switch to WebSocket for real-time order updates and market data

Error reference

Common errors and how to fix them

API comparison

Choose between REST, WebSocket, and FIX for your use case