Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sieblyio/kraken-api/llms.txt

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

The SpotClient exposes a suite of public market data methods that require no authentication. You can call these endpoints immediately after constructing a client — no API key or secret is needed. These methods cover everything from system health checks to real-time order book snapshots, giving you all the market context required to build trading strategies, dashboards, and data pipelines.
import { SpotClient } from '@siebly/kraken-api';

// Public methods work without credentials
const client = new SpotClient();

getServerTime()

Get the current server time. Signature
getServerTime(): Promise<SpotAPISuccessResponse<{ unixtime: number; rfc1123: string }>>
none
This method takes no parameters.
PropertyValue
HTTP methodGET
Endpoint0/public/Time
Auth requiredNo
Response shape
FieldTypeDescription
unixtimenumberCurrent Unix timestamp (seconds)
rfc1123stringCurrent time in RFC 1123 format
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient();

const time = await client.getServerTime();
console.log('Unix time:', time.result.unixtime);
console.log('RFC 1123:', time.result.rfc1123);

getSystemStatus()

Get the current system status or trading mode. Signature
getSystemStatus(): Promise<SpotAPISuccessResponse<SpotSystemStatus>>
none
This method takes no parameters.
PropertyValue
HTTP methodGET
Endpoint0/public/SystemStatus
Auth requiredNo
Response shape
FieldTypeDescription
status'online' | 'maintenance' | 'cancel_only' | 'post_only'Current trading mode
timestampstringISO 8601 timestamp
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient();

const status = await client.getSystemStatus();
console.log(status.result.status);     // e.g. 'online'
console.log(status.result.timestamp);  // e.g. '2024-01-15T10:30:00Z'
Check status before placing orders. The exchange may be in cancel_only (no new orders) or post_only (only maker orders) mode during degraded conditions.

getAssetInfo(params?)

Get information about the assets that are available for deposit, withdrawal, trading, and earn. Signature
getAssetInfo(params?: {
  asset?: string;
  aclass?: 'currency' | 'tokenized_asset';
}): Promise<SpotAPISuccessResponse<Record<string, SpotAssetInfo>>>
asset
string
Comma-delimited list of assets to filter by (e.g. "XBT,ETH"). Omit to return all assets.
aclass
'currency' | 'tokenized_asset'
Asset class filter. Defaults to currency.
PropertyValue
HTTP methodGET
Endpoint0/public/Assets
Auth requiredNo
Response shapeRecord<string, SpotAssetInfo> Each key is an asset identifier (e.g. "XXBT"), and the value contains:
FieldTypeDescription
aclassstringAsset class
altnamestringAlternate asset name
decimalsnumberScaling decimal places for record keeping
display_decimalsnumberScaling decimal places for display purposes
collateral_valuenumber?Collateral value used in margin
statusstring?Asset status
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient();

// Return all available assets
const allAssets = await client.getAssetInfo();
console.log(allAssets.result);

getAssetPairs(params?)

Get tradable asset pairs and their detailed specifications including fees, precision, and leverage settings. Signature
getAssetPairs(
  params?: SpotGetAssetPairsParams
): Promise<SpotAPISuccessResponse<Record<string, SpotAssetPair>>>
pair
string
Comma-delimited list of asset pairs to query (e.g. "XBTUSD,ETHUSD"). Omit to return all pairs.
info
'info' | 'leverage' | 'fees' | 'margin'
Info to retrieve. Defaults to info (full pair data).
aclass_base
'currency' | 'tokenized_asset'
Filter pairs by base asset class.
country_code
string
Two-letter country code to filter pairs available in that region.
execution_venue
string
Filter by execution venue.
PropertyValue
HTTP methodGET
Endpoint0/public/AssetPairs
Auth requiredNo
Key response fieldsRecord<string, SpotAssetPair>
FieldTypeDescription
altnamestringAlternate pair name
wsnamestring?WebSocket pair name
basestringBase asset
quotestringQuote asset
pair_decimalsnumberDecimal places for pair
lot_decimalsnumberDecimal places for volume
orderminstringMinimum order size
costminstring?Minimum order cost
tick_sizestring?Minimum price increment
feesnumber[][]?Taker fee schedule [volume, percent_fee]
fees_makernumber[][]?Maker fee schedule
leverage_buynumber[]?Available buy leverage
leverage_sellnumber[]?Available sell leverage
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient();

const pairs = await client.getAssetPairs({
  pair: 'XBTUSD,ETHUSD',
});
console.log(pairs.result);
Use getAssetPairs() to verify ordermin, costmin, and tick_size before submitting orders. Order validation errors are often caused by violating these constraints.

getTicker(params?)

Get ticker information for all or requested markets. Today’s prices start at midnight UTC. Signature
getTicker(params?: {
  pair?: string;
  asset_class?: 'tokenized_asset' | 'forex';
}): Promise<SpotAPISuccessResponse<Record<string, SpotAssetTickerInfo>>>
pair
string
Asset pair to get ticker for (e.g. "XBTUSD"). Leaving this blank returns tickers for all tradeable assets on Kraken.
asset_class
'tokenized_asset' | 'forex'
Filter by asset class.
PropertyValue
HTTP methodGET
Endpoint0/public/Ticker
Auth requiredNo
Response shapeRecord<string, SpotAssetTickerInfo>
FieldTypeDescription
astring[]Ask [price, whole lot volume, lot volume]
bstring[]Bid [price, whole lot volume, lot volume]
cstring[]Last trade closed [price, lot volume]
vstring[]Volume [today, last 24 hours]
pstring[]Volume weighted average price [today, last 24 hours]
tnumber[]Number of trades [today, last 24 hours]
lstring[]Low [today, last 24 hours]
hstring[]High [today, last 24 hours]
ostringToday’s opening price
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient();

const ticker = await client.getTicker({ pair: 'XBTUSD' });
const xbtUsd = ticker.result['XXBTZUSD'];

console.log('Last price:', xbtUsd.c[0]);
console.log('24h high:',  xbtUsd.h[1]);
console.log('24h volume:', xbtUsd.v[1]);

getCandles(params)

Retrieve OHLC (Open/High/Low/Close) candlestick data. Returns up to 720 of the most recent entries. The last entry in the array represents the current, not-yet-committed timeframe and is always present. Signature
getCandles(
  params: SpotGetOHLCParams
): Promise<SpotAPISuccessResponse<SpotOHLCResponse>>
pair
string
required
Asset pair to get OHLC data for (e.g. "XBTUSD").
interval
1 | 5 | 15 | 30 | 60 | 240 | 1440 | 10080 | 21600
Time frame interval in minutes. Defaults to 1.
ValueLabel
11 minute
55 minutes
1515 minutes
3030 minutes
601 hour
2404 hours
14401 day
100801 week
2160015 days
since
number
Unix timestamp to get OHLC data from. Note: this does not filter results — it controls which cached dataset is used as the starting point.
asset_class
'tokenized_asset'
Asset class filter.
PropertyValue
HTTP methodGET
Endpoint0/public/OHLC
Auth requiredNo
Response shapeSpotOHLCResponse Each OHLC entry is a tuple: [time, open, high, low, close, vwap, volume, count]
IndexTypeDescription
0numberUnix timestamp
1stringOpen price
2stringHigh price
3stringLow price
4stringClose price
5stringVolume weighted average price
6stringVolume
7numberTrade count
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient();

const candles = await client.getCandles({
  pair: 'XBTUSD',
  interval: 60, // 1-hour candles
});

const ohlcData = candles.result['XXBTZUSD'];
console.log('Last candle:', ohlcData[ohlcData.length - 1]);
// [time, open, high, low, close, vwap, volume, count]

getOrderBook(params)

Returns the Level 2 (L2) order book, showing individual price levels with aggregated order quantities. Signature
getOrderBook(
  params: SpotGetOrderBookParams
): Promise<SpotAPISuccessResponse<SpotOrderBookResponse>>
pair
string
required
Asset pair to get order book for (e.g. "XBTUSD").
count
number
Maximum number of asks/bids to return. Range: 1–500. Defaults to 100.
asset_class
'tokenized_asset'
Asset class filter.
PropertyValue
HTTP methodGET
Endpoint0/public/Depth
Auth requiredNo
Response shapeSpotOrderBookResponse Each book entry is a tuple: [price, volume, timestamp]
interface SpotOrderBook {
  asks: [string, string, number][]; // [price, volume, timestamp]
  bids: [string, string, number][]; // [price, volume, timestamp]
}
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient();

const book = await client.getOrderBook({
  pair: 'XBTUSD',
  count: 10,
});

const xbtBook = book.result['XXBTZUSD'];
console.log('Best ask:', xbtBook.asks[0]); // [price, volume, timestamp]
console.log('Best bid:', xbtBook.bids[0]); // [price, volume, timestamp]

getRecentTrades(params)

Returns recent trades. By default, returns the last 1000 trades. Signature
getRecentTrades(
  params: SpotGetRecentTradesParams
): Promise<SpotAPISuccessResponse<SpotRecentTradesResponse>>
pair
string
required
Asset pair to get recent trades for (e.g. "XBTUSD").
since
string
Return trades after this trade ID (from a previous response’s last field).
count
number
Maximum number of trades to return. Range: 1–1000. Defaults to 1000.
asset_class
'tokenized_asset'
Asset class filter.
PropertyValue
HTTP methodGET
Endpoint0/public/Trades
Auth requiredNo
Response shapeSpotRecentTradesResponse Each trade entry is a tuple: [price, volume, time, buy/sell, market/limit, miscellaneous, trade_id]
IndexTypeDescription
0stringPrice
1stringVolume
2numberTimestamp
3string"b" (buy) or "s" (sell)
4string"m" (market) or "l" (limit)
5stringMiscellaneous flags
6numberTrade ID
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient();

const trades = await client.getRecentTrades({
  pair: 'XBTUSD',
  count: 10,
});

const tradeList = trades.result['XXBTZUSD'];
console.log('Last 10 trades:', tradeList);
console.log('Last trade ID:', trades.result.last);

getRecentSpreads(params)

Returns the last ~200 top-of-book bid/ask spreads for a given pair. Signature
getRecentSpreads(
  params: SpotGetRecentSpreadsParams
): Promise<SpotAPISuccessResponse<SpotRecentSpreadsResponse>>
pair
string
required
Asset pair to get spread data for (e.g. "XBTUSD").
since
number
Unix timestamp to return spreads from. Used for incremental data fetches.
asset_class
'tokenized_asset'
Asset class filter.
PropertyValue
HTTP methodGET
Endpoint0/public/Spread
Auth requiredNo
Response shapeSpotRecentSpreadsResponse Each spread entry is a tuple: [time, bid, ask]
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient();

const spreads = await client.getRecentSpreads({ pair: 'XBTUSD' });
const spreadData = spreads.result['XXBTZUSD'] as [number, string, string][];

const latest = spreadData[spreadData.length - 1];
console.log('Time:', latest[0]);
console.log('Bid:', latest[1]);
console.log('Ask:', latest[2]);

// Use result.last for incremental fetches
console.log('Last timestamp:', spreads.result.last);
Store the last timestamp from each response and pass it as since in your next call to receive only new spread entries — ideal for efficient polling.

getPreTradeData(params)

Returns the top 10 price levels in the order book with aggregated order quantities at each level, for a given trading pair. This is a public transparency endpoint with no authentication required. Signature
getPreTradeData(params: {
  symbol: string;
}): Promise<SpotAPISuccessResponse<SpotPreTradeData>>
symbol
string
required
Trading pair symbol to retrieve pre-trade data for (e.g. "XBTUSD").
PropertyValue
HTTP methodGET
Endpoint0/public/PreTrade
Auth requiredNo
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient();

const preTrade = await client.getPreTradeData({ symbol: 'XBTUSD' });
console.log(preTrade.result);

getPostTradeData(params?)

Returns a list of recent trades on the spot exchange. If no filter parameters are specified, the last 1000 trades for all pairs are returned. This is a public transparency endpoint with no authentication required. Signature
getPostTradeData(
  params?: SpotGetPostTradeDataParams
): Promise<SpotAPISuccessResponse<SpotPostTradeDataResponse>>
symbol
string
Filter trades by trading pair symbol (e.g. "XBTUSD").
from_ts
string
ISO 8601 timestamp — return trades on or after this time.
to_ts
string
ISO 8601 timestamp — return trades on or before this time.
count
number
Maximum number of trades to return. Defaults to 1000.
PropertyValue
HTTP methodGET
Endpoint0/public/PostTrade
Auth requiredNo
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient();

const postTrade = await client.getPostTradeData({
  symbol: 'XBTUSD',
  count: 100,
});
console.log(postTrade.result);

Build docs developers (and LLMs) love