TL;DR
The Kraken Exchange public API provides real-time market data for 50+ cryptocurrency trading pairs. Access ticker prices (last, high, low, volume, VWAP), order book depth with customizable levels, OHLC (Open/High/Low/Close) chart data across 9 timeframes, and recent trade history with pagination. The API returns JSON responses for pairs like XBT/USD, ETH/USD, SOL/USD, ADA/USD, and many altcoin pairs. Kraken is one of the oldest and most reputable exchanges, founded in 2011, known for its liquidity and extensive pair offerings. Public endpoints require no authentication.
Quick start: https://api.kraken.com/0/public/Ticker?pair=XBTUSD
No API key needed — just make a request!
How to Use This API
1. Get BTC/USD Ticker
https://api.kraken.com/0/public/Ticker?pair=XBTUSD
Note: Kraken uses XBT for Bitcoin, not BTC. Returns ask, bid, last, volume, VWAP, and more.
2. Get ETH/USD Ticker
https://api.kraken.com/0/public/Ticker?pair=ETHUSD
3. Get Multiple Pairs at Once
https://api.kraken.com/0/public/Ticker?pair=XBTUSD,ETHUSD,SOLUSD
4. Get Order Book (Market Depth)
https://api.kraken.com/0/public/Depth?pair=XBTUSD&count=10
count controls how many price levels to return (default 10, max 500).
5. Get OHLC Data (Candlestick)
https://api.kraken.com/0/public/OHLC?pair=XBTUSD&interval=60
interval in minutes: 1, 5, 15, 30, 60, 240, 1440, 10080, 21600.
6. Get Recent Trades
https://api.kraken.com/0/public/Trades?pair=XBTUSD
https://api.kraken.com/0/public/Trades?pair=XBTUSD&since=1718563200
since parameter provides Unix timestamp pagination.
7. List All Tradable Asset Pairs
https://api.kraken.com/0/public/AssetPairs
Returns complete list of 50+ pairs with details like min order size, price precision, and leverage.
8. Response Format
{
"error": [],
"result": {
"XXBTZUSD": {
"a": ["67200.00000", "1", "1.000"],
"b": ["67150.00000", "3", "3.000"],
"c": ["67180.00000", "0.50000000"],
"h": ["69000.00000", "69000.00000"],
"l": ["65000.00000", "65000.00000"],
"v": ["1234.56", "5678.90"],
"p": ["67800.000", "67500.000"],
"t": [12345, 67890]
}
}
}
Kraken uses arrays where: a=ask, b=bid, c=last close, h=high, l=low, v=volume, p=VWAP, t=trades. Each array: [price, whole lot volume, lot volume].
9. JavaScript — Fetch and Parse Ticker
fetch('https://api.kraken.com/0/public/Ticker?pair=XBTUSD')
.then(r => r.json())
.then(d => {
const t = d.result.XXBTZUSD;
console.log(`BTC/USD:`);
console.log(` Last: \$${parseFloat(t.c[0]).toFixed(2)}`);
console.log(` Bid: \$${parseFloat(t.b[0]).toFixed(2)}`);
console.log(` Ask: \$${parseFloat(t.a[0]).toFixed(2)}`);
console.log(` 24h High: \$${parseFloat(t.h[1]).toFixed(2)}`);
console.log(` 24h Low: \$${parseFloat(t.l[1]).toFixed(2)}`);
console.log(` Volume: ${parseFloat(t.v[1]).toFixed(2)} XBT`);
});
10. Python — Get OHLC for Charting
import requests
resp = requests.get(
'https://api.kraken.com/0/public/OHLC',
params={'pair': 'ETHUSD', 'interval': 1440}
)
data = resp.json()['result']['ETHUSD']
print("Daily OHLC for ETH/USD:")
for candle in data[-5:]:
timestamp, open_, high, low, close, vwap, volume, count = candle
print(f" Close: {close}, High: {high}, Low: {low}")
11. Python — Calculate VWAP from Ticker
import requests
resp = requests.get(
'https://api.kraken.com/0/public/Ticker?pair=XBTUSD,ETHUSD'
)
for pair, data in resp.json()['result'].items():
last = float(data['c'][0])
vwap = float(data['p'][1])
vol = float(data['v'][1])
print(f"{pair}: \${last:.2f} (VWAP: \${vwap:.2f}, Vol: {vol:.2f})")
https://api.kraken.com/0/public/Ticker?pair=XBTUSD
Frequently Asked Questions
- What trading pairs are available on Kraken?
- Use
https://api.kraken.com/0/public/AssetPairsto list all 50+ pairs. Common ones: XBTUSD (Bitcoin), ETHUSD (Ethereum), SOLUSD (Solana), ADAUSD (Cardano), DOTUSD (Polkadot), LINKUSD (Chainlink), XRPUSD (Ripple), UNIUSD (Uniswap), MATICUSD (Polygon), and DOGEUSD (Dogecoin). Note Kraken uses XBT not BTC. - What does the ticker response include?
- Ask (
a), bid (b), last close (c), volume (v) — today and last 24h, VWAP (p), number of trades (t), low (l), high (h), and opening price (o). Each field is an array with specific sub-values. - What time intervals does the OHLC endpoint support?
- 1, 5, 15, 30, 60, 240 (4h), 1440 (1d), 10080 (1w), and 21600 (15d) minutes. The
lastfield in the response provides the ID to poll for new data. - How do I get recent trade history?
- Use
/0/public/Trades?pair=XBTUSDwith optionalsinceparameter (Unix timestamp) for pagination. Each trade record contains: price, volume, timestamp, buy/sell flag, market/limit flag, and miscellaneous info. - Why does Kraken use XBT instead of BTC?
- Kraken uses XBT as the ISO 4217-compatible code for Bitcoin (similar to USD, EUR, etc.). BTC is technically not an ISO standard code. Most API responses use XBT, though some newer endpoints may accept BTC as well.
- Are there rate limits on the public API?
- Kraken's public API is rate-limited but generously so. The general limit is approximately 1 request per second per IP. For higher frequency needs, spread requests across multiple endpoints or use the WebSocket API.
What You Can Build
- Real-time crypto charting application using OHLC data across multiple timeframes
- Order book depth visualization showing support/resistance levels
- Arbitrage scanner comparing Kraken prices with other exchanges
- Backtesting engine using historical OHLC and trade data
- Multi-exchange portfolio tracker integrating Kraken with CoinBase and Gemini