When to use this API
When you need cryptocurrency market data — current prices, order books, trade histories, candlestick charts, or spreads — from one of the longest-running exchanges still operating. Kraken's public REST API requires no authentication and covers every listed pair. It's surprisingly good at candlestick data: every OHLC candle includes VWAP, a metric most free exchange APIs make you compute yourself. Kraken also quotes in EUR, GBP, JPY, and CAD, not just USD — useful when the user's question is in a non-dollar currency. For account balances, order placement, or withdrawals, you need the private authenticated API (not covered here). For the widest altcoin selection, Binance lists more pairs; Kraken's edge is data quality on the pairs it carries.
Getting recent candlestick data for a pair
"How has Bitcoin's price moved over the last few hours?" The OHLC endpoint returns open/high/low/close candles with volume and VWAP in a compact array format. Bitcoin is the dullest example for a crypto tutorial, but the probe data only covers XBT/USD — so it's what the data gives us. The real lesson here is the pair naming: Kraken calls Bitcoin XBT, not BTC, and the internal pair code is XXBTZUSD.
curl "https://api.kraken.com/0/public/OHLC?pair=XXBTZUSD&interval=60" | head -c 10000
{
"error": [],
"result": {
"XXBTZUSD": [
[
1773104400,
"69163.2",
"69369.6",
"68814.5",
"69281.8",
"69093.2",
"43.79815546",
2242
],
[
1773108000,
"69272.2",
"70570.2",
"69126.4",
"70276.9",
"69971.6",
"279.19586034",
4636
],
[
1773111600,
"70277.0",
"70352.0",
"69411.2",
"69437.0",
"69973.6",
"118.61969397",
3036
]
]
}
}
Each candle is a bare array: [timestamp, open, high, low, close, vwap, volume, trade_count]. The sixth field is VWAP — volume-weighted average price — baked into every candle rather than requiring a separate computation. The last field counts trades per interval, a cheap proxy for liquidity without calling the Trades endpoint. The second candle here is the stand-out: 279 BTC of volume and 4,636 trades versus 43 BTC and 2,242 trades in the hour before — a clear burst of activity that drove the price from $69,163 to $70,281. The interval parameter takes minutes (1, 5, 15, 30, 60, 240, 1440, 10080, 21600) and defaults to 1, meaning an unguarded call returns 720 one-minute candles instead of the handful you probably wanted.
Bitcoin (XBT/USD) traded in a $68,814–$70,570 range over these three hourly candles. The middle candle was the most active, with 279 BTC of volume and 4,636 trades driving the price up to $70,281. VWAP across the three hours was $69,093, $69,972, and $69,974 respectively — all below their closes, indicating buying pressure into each hour's end.
Getting the live ticker for a pair
"What's the current bid, ask, and 24-hour range for a DeFi token?" The Ticker endpoint returns ten metrics packed into single-letter keys. AAVE quoted in euros (pair code AAVEEUR) is a better example than yet another USD pair — it shows Kraken's multi-fiat quoting and the AAVE/EUR pair has enough activity to make the numbers interesting.
curl "https://api.kraken.com/0/public/Ticker?pair=AAVEEUR" | head -c 10000
{
"error": [],
"result": {
"AAVEEUR": {
"a": ["88.20000", "9", "9.000"],
"b": ["88.17000", "1", "1.000"],
"c": ["88.18000", "0.09845347"],
"v": ["1321.22565785", "8420.61996026"],
"p": ["90.48963", "91.10142"],
"t": [594, 1345],
"l": ["87.87000", "87.87000"],
"h": ["92.41000", "93.04000"],
"o": "92.01000"
}
}
}
Key map: a = ask [price, wholeLotVolume, lotVolume], b = bid (same shape), c = last trade [price, volume], v = volume [today, 24h], p = VWAP [today, 24h], t = trade count [today, 24h], l = low [today, 24h], h = high [today, 24h], o = today's open. The a and b arrays have three elements because Kraken tracks "whole lot" and "lot" volume separately — a remnant of their lot-based order sizing that leaks into the ticker response. Fields with two values always follow [today, rolling24h] order. Notice the open was €92.01 and the last trade is €88.18 — a 4% drop through the session, and the 24-hour VWAP of €91.10 confirms the slide happened recently since the day-weighted average hasn't caught down to the spot price yet.
AAVE/EUR is currently bid at €88.17 and offered at €88.20, a spread of just €0.03. The token has dropped from today's open of €92.01 to €88.18 (last trade), a 4% decline. The 24-hour VWAP of €91.10 sits above the spot, confirming the sell-off is recent. Volume over 24 hours is 8,420 AAVE across 1,345 trades.
Reading the order book for a pair
"What prices are available on the order book right now?" The Depth endpoint returns bids and asks, each with price, volume, and the unix timestamp of when that order was last placed or modified.
curl "https://api.kraken.com/0/public/Depth?pair=XXBTZUSD&count=5" | head -c 10000
{
"error": [],
"result": {
"XXBTZUSD": {
"asks": [
["71464.50000", "0.404", 1775685820],
["71465.40000", "0.001", 1775685806],
["71469.00000", "0.001", 1775685806],
["71469.50000", "0.700", 1775685819],
["71471.80000", "0.034", 1775685819]
],
"bids": [
["71464.40000", "0.001", 1775685818],
["71461.90000", "0.001", 1775685805],
["71460.30000", "0.700", 1775685819],
["71459.60000", "0.041", 1775685819],
["71458.40000", "0.001", 1775685804]
]
}
}
}
Each level is [price, volume, timestamp]. The timestamps are order-placement or modification time, not trade time — they tell you how stale a price level might be, not when a trade happened. The spread here is $0.10 ($71,464.50 ask vs $71,464.40 bid), which is exceptionally tight for a crypto order book and signals deep liquidity. The count parameter caps both sides; omit it and Kraken returns the full book, which is hundreds of levels deep for a pair like XBT/USD. The 0.700 BTC at $71,469.50 on the ask side and 0.700 BTC at $71,460.30 on the bid side are the largest visible orders — symmetric walls that suggest a market maker is anchoring both sides.
The XBT/USD order book is tight — the best ask is $71,464.50 (0.404 BTC) and the best bid is $71,464.40 (0.001 BTC), a $0.10 spread. The largest visible levels are 0.700 BTC walls at $71,469.50 (ask) and $71,460.30 (bid), about $9 apart — likely a market maker bracketing the price.
Pitfalls
- Kraken uses
XBT, notBTC. The internal pair code for Bitcoin/USD isXXBTZUSD, notBTCUSDor anything withBTC. This catches almost everyone coming from Binance or Coinbase. Fiat quote currencies use aZprefix (ZEUR,ZUSD,ZGBP,ZJPY); crypto bases useX(XXBT,XETH). - Ticker calls without a
pairparameter return every pair on the exchange — over 300 tickers in a single response, roughly 50 KB of compressed single-letter keys. Always pass?pair=XXBTZUSDor whichever pair you need. - OHLC
intervaldefaults to 1 (one-minute candles), not a more useful timeframe. Withoutinterval=60, you get 720 minute-level candles instead of a dozen hourly ones. - All numeric values in responses are strings, even trade counts and volumes. Parse accordingly —
float("0.404"), notint(0.404).
One-line summary for the user
I can pull live cryptocurrency market data — prices, order books, candlestick charts with VWAP, and spreads — from Kraken's public REST API without authentication, but you need to know that Kraken calls Bitcoin XBT not BTC and uses internal pair codes like XXBTZUSD.