Quick answer
Kraken’s spot REST API has public endpoints (OHLC, order book, trades) and private ones signed with HMAC-SHA512 over the URI path and SHA-256 of nonce + body, sent as API-Key and API-Sign headers with an always-increasing nonce. Rate limits differ by API family, endpoint and account tier; there is no spot testnet, but validate=true checks an order without placing it.
Kraken API at a glance
- Pricing
- Free API; trading fees apply
- Availability
- Most countries including most US states
- Paper trading
- No sandbox
- Integration type
- REST + API key
- In AlgoGP
- Built in: broker and data adapter (Pro)
- REST base
https://api.kraken.com/0/public/…and/0/private/…- Auth
API-Keyheader +API-Sign(HMAC-SHA512) + increasingnonce- Candles
GET /0/public/OHLC, last 720 bars per interval- Paper trading
- No spot sandbox;
validate=truechecks an order without placing it
Public OHLC data
GET /0/public/OHLC?pair=XBTUSD&interval=1440 returns [time, open, high, low, close, vwap, volume, count] rows. interval is in minutes: 1, 5, 15, 30, 60, 240, 1440, 10080, 21600. Kraken only returns the most recent 720 bars of each interval, so long daily histories need another source, while the last 720 hourly bars (30 days) are plenty for live warm-up.
How private requests are signed
- 1
Build the POST body
URL-encode the parameters including a
noncethat always increases (milliseconds since the epoch works). - 2
Hash it
SHA-256 of
nonce + body. - 3
Sign it
HMAC-SHA512 of
uri_path + sha256_digest, keyed with the base64-decoded private key; base64-encode the result. - 4
Send it
Headers
API-Key: <public key>andAPI-Sign: <signature>.
A nonce lower than the last one used by the same key fails with EAPI:Invalid nonce, which is why two bots should never share a key.
Testing without a sandbox
Kraken has no spot testnet. Its AddOrder endpoint accepts validate=true, which runs every check (pair, size, funds, permissions) and returns a description without placing the order. AlgoGP’s sandbox mode for Kraken uses exactly that, so you can prove the integration before any real order is sent.
Use Kraken in AlgoGP
Open a project, go to the APIs & keys tab and, under Platforms, pick Kraken as the market data source (market_data.py) and the broker (brokers.py). The choice is saved to config.json as a new strategy version:
{
"platforms": {
"data": "kraken",
"broker": "kraken"
}
}backtest.py and live.py connect to when you run the exported code.| Key | What it is |
|---|---|
KRAKEN_API_KEY | Kraken API key (Settings → API), with Query Funds and Create & Modify Orders. |
KRAKEN_API_SECRET | Kraken private key (base64); shown once when the key is created. |
.env.TRADING_MODE=paper(default): simulated fills on your machine; the broker is never contacted.TRADING_MODE=sandbox: orders go to Kraken in validate-only mode, which checks each order without placing it.TRADING_MODE=live: real orders, and only onceLIVE_TRADING_ACKNOWLEDGED=yesis set.
New to Kraken? Follow the step-by-step Kraken API key guide.
Kraken API: frequently asked questions
Is the Kraken API available in the US?
Kraken serves most US states; a few have restrictions on some products. Check Kraken’s availability page for your state.
Does Kraken have a paper trading account?
Not for spot. Use validate=true orders to check integrations, and a simulated paper broker to measure a strategy.
How far back does Kraken OHLC data go?
The REST OHLC endpoint returns only the latest 720 bars per interval. Full trade history is available as downloadable files.
Build a Kraken trading bot in minutes
Describe the strategy in plain English, backtest it on years of data, then export Python that already talks to Kraken: paper, sandbox and live modes, keys handled for you.
- Generated adapter for Kraken orders and balances
- Backtests with costs, slippage and walk-forward checks
- Paper first; live trading only after you opt in
Free plan, no card required. Kraken is included with Pro.
Kraken alternatives
- Coinbase Advanced Trade API GuideCoinbase’s trading API for spot and eligible derivatives, authenticated with CDP keys that sign a JWT per request.
- Binance API Built into AlgoGPThe largest crypto exchange by volume, with a deep public market-data API and a free spot testnet.
- OKX API Built into AlgoGPMajor crypto exchange with a V5 REST and WebSocket API for spot, perpetuals, futures and options, plus demo trading.
- Bybit API Built into AlgoGPGlobal crypto exchange with a unified V5 API for spot, derivatives and options, and a Demo Trading environment.
Independent guide. AlgoGP is not affiliated with Kraken. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.