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.

All methods in this section are private endpoints — every call requires a valid API key and secret configured on the SpotClient instance. These methods give you complete visibility into your account state: balances, open and closed orders, margin positions, ledger history, trade records, and data export management.
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});
API key permissions: Each method requires specific API key permissions. Grant only the minimum scopes needed — for read-only account inspection, enable Query permissions under Funds and Orders & Trades. Never enable withdrawal permissions unless required.

getAccountBalance(params?)

Retrieve all cash balances, net of pending withdrawals. Signature
getAccountBalance(params?: {
  rebase_multiplier?: 'rebased' | 'base';
}): Promise<SpotAPISuccessResponse<SpotAccountBalance>>
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral balances are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/Balance
Auth requiredYes
Response shapeRecord<string, string> Keys are asset identifiers (e.g. "ZUSD", "XXBT"), values are string-encoded decimal balances.
Staking and Earn asset suffixes: .B — balances in new yield-bearing products, .F — balances earning automatically via Kraken Rewards, .T — tokenized assets.
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const balances = await client.getAccountBalance();
console.log(balances.result);
// { ZUSD: '1500.00', XXBT: '0.05432100', ... }

getExtendedBalance(params?)

Retrieve all extended account balances, including credits and held amounts. Available balance is calculated as:
available_balance = balance + credit - credit_used - hold_trade
Signature
getExtendedBalance(params?: {
  rebase_multiplier?: 'rebased' | 'base';
}): Promise<SpotAPISuccessResponse<SpotExtendedBalance>>
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral balances are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/BalanceEx
Auth requiredYes
Response shapeRecord<string, SpotExtendedBalanceAsset>
FieldTypeDescription
balancestringTotal balance
creditstringAvailable credit
credit_usedstringCredit currently in use
hold_tradestringAmount held for open orders
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const extended = await client.getExtendedBalance();
for (const [asset, detail] of Object.entries(extended.result)) {
  const available =
    parseFloat(detail.balance) +
    parseFloat(detail.credit) -
    parseFloat(detail.credit_used) -
    parseFloat(detail.hold_trade);
  console.log(`${asset}: available = ${available}`);
}

getCreditLines(params?)

Retrieve all credit line details for VIPs with this functionality. Signature
getCreditLines(params?: {
  rebase_multiplier?: 'rebased' | 'base';
}): Promise<SpotAPISuccessResponse<SpotCreditLines | null>>
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral balances are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/CreditLines
Auth requiredYes
Returns null if no credit lines are available on the account.
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const creditLines = await client.getCreditLines();
if (creditLines.result) {
  console.log(creditLines.result);
} else {
  console.log('No credit lines available.');
}

getTradeBalance(params?)

Retrieve a summary of collateral balances, margin position valuations, equity and margin level. Signature
getTradeBalance(params?: {
  rebase_multiplier?: 'rebased' | 'base';
}): Promise<SpotAPISuccessResponse<SpotTradeBalance>>
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral balances are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/TradeBalance
Auth requiredYes
Response fieldsSpotTradeBalance
FieldDescription
ebEquivalent balance (combined balance of all currencies)
tbTrade balance (combined balance of all equity currencies)
mMargin amount of open positions
nUnrealized net profit/loss of open positions
cCost basis of open positions
vCurrent floating valuation of open positions
eEquity: trade_balance + unrealized_net_pnl
mfFree margin: equity - initial_margin
mlMargin level: (equity / initial_margin) × 100
uvUnexecuted value
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const tradeBalance = await client.getTradeBalance();
console.log('Equity:', tradeBalance.result.e);
console.log('Free margin:', tradeBalance.result.mf);
console.log('Margin level:', tradeBalance.result.ml);

getOpenOrders(params?)

Retrieve information about currently open orders. Signature
getOpenOrders(
  params?: SpotGetOpenOrdersParams
): Promise<SpotAPISuccessResponse<SpotOpenOrdersResponse>>
trades
boolean
Whether to include trades related to a position in the output. Defaults to false.
userref
number
Filter by user reference ID.
cl_ord_id
string
Filter by client order ID.
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral values are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/OpenOrders
Auth requiredYes
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const openOrders = await client.getOpenOrders();
for (const [txid, order] of Object.entries(openOrders.result.open)) {
  console.log(`${txid}: ${order.descr.order}`);
}

getClosedOrders(params?)

Retrieve information about orders that have been closed (filled or cancelled). Returns 50 results at a time, most recent first. Signature
getClosedOrders(
  params?: SpotGetClosedOrdersParams
): Promise<SpotAPISuccessResponse<SpotClosedOrdersResponse>>
trades
boolean
Whether to include related trades in the output.
userref
number
Filter by user reference ID.
cl_ord_id
string
Filter by client order ID.
start
number
Unix timestamp or order transaction ID to begin results from (inclusive).
end
number
Unix timestamp or order transaction ID to end results at (inclusive).
ofs
number
Result offset for pagination.
closetime
'open' | 'close' | 'both'
Whether to search by open time, close time, or both. Defaults to both.
consolidate_taker
boolean
Whether to consolidate trades by taker.
without_count
boolean
If true, omits the count field from the response for a minor performance improvement.
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral values are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/ClosedOrders
Auth requiredYes
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const closed = await client.getClosedOrders();
console.log('Total count:', closed.result.count);
console.log('Orders:', closed.result.closed);

getOrders(params)

Retrieve information about one or more specific orders by transaction ID. Signature
getOrders(
  params: SpotQueryOrdersParams
): Promise<SpotAPISuccessResponse<SpotQueryOrdersResponse>>
txid
string
required
Comma-delimited list of transaction IDs to query (up to 50).
trades
boolean
Whether to include related trades in output.
userref
number
Filter by user reference ID.
consolidate_taker
boolean
Whether to consolidate trades by taker.
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral values are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/QueryOrders
Auth requiredYes
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const orders = await client.getOrders({
  txid: 'OQCLML-BW3P3-BUCMWZ,OZNOZE-2DOVH-Q4DOQT',
  trades: true,
});
console.log(orders.result);

getOrderAmends(params)

Retrieves an audit trail of all amend transactions on a specific order, ordered by ascending amend timestamp. Signature
getOrderAmends(params: {
  order_id: string;
  rebase_multiplier?: 'rebased' | 'base';
}): Promise<SpotAPISuccessResponse<SpotOrderAmendsResponse>>
order_id
string
required
The Kraken transaction ID of the order to inspect.
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral values are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/OrderAmends
Auth requiredYes
Response shapeSpotOrderAmendsResponse
FieldTypeDescription
countnumberTotal number of amends
amendsSpotOrderAmend[]List of amend records
Each SpotOrderAmend includes: amend_id, amend_type ('original' \| 'user' \| 'restated'), order_qty, limit_price, trigger_price, reason, post_only, timestamp.
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const amends = await client.getOrderAmends({
  order_id: 'OQCLML-BW3P3-BUCMWZ',
});
console.log(`Total amends: ${amends.result.count}`);
amends.result.amends.forEach((a) => {
  console.log(`${a.amend_type} at ${a.timestamp}: qty=${a.order_qty} price=${a.limit_price}`);
});

getTradesHistory(params?)

Retrieve information about trades/fills. Returns 50 results at a time, most recent first. Signature
getTradesHistory(
  params?: SpotGetTradesHistoryParams
): Promise<SpotAPISuccessResponse<SpotTradesHistoryResponse>>
type
'all' | 'any position' | 'closed position' | 'closing position' | 'no position'
Type of trade to filter by. Defaults to all.
trades
boolean
Whether to include trades related to a position.
start
number
Unix timestamp or trade transaction ID to begin results from (inclusive).
end
number
Unix timestamp or trade transaction ID to end results at (inclusive).
ofs
number
Result offset for pagination.
consolidate_taker
boolean
Whether to consolidate trades by taker.
ledgers
boolean
Whether to include ledger entries associated with trades.
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral values are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/TradesHistory
Auth requiredYes
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const history = await client.getTradesHistory();
console.log(`Total trades: ${history.result.count}`);
console.log(history.result.trades);

getTrades(params)

Retrieve information about one or more specific trades by transaction ID. Signature
getTrades(
  params: SpotQueryTradesParams
): Promise<SpotAPISuccessResponse<SpotQueryTradesResponse>>
txid
string
required
Comma-delimited list of transaction IDs to query (up to 20).
trades
boolean
Whether to include trades related to a position.
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral values are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/QueryTrades
Auth requiredYes
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const trades = await client.getTrades({
  txid: 'TI3ZBU-OGPJK-SDTMFT',
  trades: true,
});
console.log(trades.result);

getOpenPositions(params?)

Get information about open margin positions. Signature
getOpenPositions(
  params?: SpotGetOpenPositionsParams
): Promise<SpotAPISuccessResponse<SpotOpenPositionsResponse>>
txid
string
Comma-delimited list of transaction IDs to filter by.
docalcs
boolean
Whether to include profit/loss calculations. Defaults to false.
consolidation
'market'
Consolidate positions by market/pair.
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral values are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/OpenPositions
Auth requiredYes
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const positions = await client.getOpenPositions({ docalcs: true });
for (const [posId, pos] of Object.entries(positions.result)) {
  console.log(`${posId}: ${pos.pair} ${pos.type} — net=${pos.net}`);
}

getLedgersInfo(params?)

Retrieve information about ledger entries. Returns 50 results at a time, most recent first. Signature
getLedgersInfo(
  params?: SpotGetLedgersInfoParams
): Promise<SpotAPISuccessResponse<SpotLedgersInfoResponse>>
asset
string
Comma-delimited list of assets to filter by (e.g. "XBT,ETH").
aclass
string
Asset class to filter by.
type
string
Ledger entry type filter. Options: all, trade, deposit, withdrawal, transfer, margin, adjustment, rollover, credit, settled, staking, dividend, sale, nft_rebate.
start
number
Unix timestamp to begin results from (inclusive).
end
number
Unix timestamp to end results at (inclusive).
ofs
number
Result offset for pagination.
without_count
boolean
If true, omits the count field from the response.
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral values are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/Ledgers
Auth requiredYes
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const ledgers = await client.getLedgersInfo({
  asset: 'XBT',
  type: 'deposit',
});
console.log(`Total entries: ${ledgers.result.count}`);
console.log(ledgers.result.ledger);

getLedgers(params)

Retrieve information about specific ledger entries by ID. Signature
getLedgers(
  params: SpotQueryLedgersParams
): Promise<SpotAPISuccessResponse<SpotQueryLedgersResponse>>
id
string
required
Comma-delimited list of ledger entry IDs to query (up to 20).
trades
boolean
Whether to include trades related to the ledger entries.
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral values are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/QueryLedgers
Auth requiredYes
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const entries = await client.getLedgers({
  id: 'LUI2RA-CJFLB-EN5I4P,L2QE42-IGSZ3-WEVTLK',
  trades: false,
});
console.log(entries.result);

getTradingVolume(params?)

Returns 30-day USD trading volume and resulting fee schedule for any asset pair(s) provided. Also use this endpoint (with a Spot API key) to determine Futures fee rates. Signature
getTradingVolume(params?: {
  pair?: string;
  rebase_multiplier?: 'rebased' | 'base';
}): Promise<SpotAPISuccessResponse<SpotTradeVolume>>
pair
string
Comma-delimited list of pairs to return fee info for (e.g. "XBTUSD,ETHUSD").
rebase_multiplier
'rebased' | 'base'
Controls how multi-collateral values are reported.
PropertyValue
HTTP methodPOST
Endpoint0/private/TradeVolume
Auth requiredYes
Response fieldsSpotTradeVolume
FieldTypeDescription
currencystringVolume currency (USD)
volumestringCurrent 30-day trading volume
feesRecord<string, SpotFeeTierInfo>?Taker fee schedule by pair
fees_makerRecord<string, SpotFeeTierInfo>?Maker fee schedule by pair
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const volume = await client.getTradingVolume({ pair: 'XBTUSD,ETHUSD' });
console.log('30-day volume:', volume.result.volume, volume.result.currency);
console.log('XBTUSD taker fee:', volume.result.fees?.['XXBTZUSD']?.fee);
console.log('XBTUSD maker fee:', volume.result.fees_maker?.['XXBTZUSD']?.fee);

requestLedgersExport(params)

Request an export of trades or ledger data as a CSV or TSV file. Signature
requestLedgersExport(
  params: SpotRequestExportReportParams
): Promise<SpotAPISuccessResponse<SpotRequestExportReportResponse>>
report
'trades' | 'ledgers'
required
Type of data to export.
description
string
required
Description/label for the export.
format
'CSV' | 'TSV'
Export file format. Defaults to CSV.
fields
string
Comma-delimited list of fields to include in the export.
starttm
number
Start time for data range (Unix timestamp).
endtm
number
End time for data range (Unix timestamp).
PropertyValue
HTTP methodPOST
Endpoint0/private/AddExport
Auth requiredYes
Returns { id: string } — the export ID used to check status and retrieve the file.

getLedgersExportStatus(params)

Get the status of previously requested data exports. Signature
getLedgersExportStatus(params: {
  report: 'trades' | 'ledgers';
}): Promise<SpotAPISuccessResponse<SpotExportReportStatus[]>>
report
'trades' | 'ledgers'
required
The type of report to check status for.
PropertyValue
HTTP methodPOST
Endpoint0/private/ExportStatus
Auth requiredYes
Each SpotExportReportStatus includes: id, descr, format, report, status ('Queued' \| 'Processing' \| 'Processed'), createdtm, completedtm.

getLedgersExport(params)

Retrieve (download) a processed data export as a binary zip archive. Signature
getLedgersExport(params: { id: string }): Promise<any>
id
string
required
The export ID returned by requestLedgersExport().
PropertyValue
HTTP methodPOST
Endpoint0/private/RetrieveExport
Auth requiredYes
Only call this after getLedgersExportStatus() confirms the export status is "Processed".

deleteLedgersExport(params)

Delete or cancel an exported trades/ledgers report. Signature
deleteLedgersExport(params: {
  id: string;
  type: 'cancel' | 'delete';
}): Promise<SpotAPISuccessResponse<SpotDeleteExportReportResponse>>
id
string
required
The export ID to act on.
type
'cancel' | 'delete'
required
Use cancel for queued/processing exports; use delete for completed exports.
PropertyValue
HTTP methodPOST
Endpoint0/private/RemoveExport
Auth requiredYes
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

// 1. Request the export
const request = await client.requestLedgersExport({
  report: 'ledgers',
  description: 'Monthly ledger export',
  format: 'CSV',
});
const exportId = request.result.id;
console.log('Export requested:', exportId);

// 2. Poll until processed
let processed = false;
while (!processed) {
  await new Promise((r) => setTimeout(r, 5000)); // wait 5s
  const statuses = await client.getLedgersExportStatus({ report: 'ledgers' });
  const mine = statuses.result.find((s) => s.id === exportId);
  if (mine?.status === 'Processed') processed = true;
  console.log('Status:', mine?.status);
}

// 3. Download
const data = await client.getLedgersExport({ id: exportId });

// 4. Clean up
await client.deleteLedgersExport({ id: exportId, type: 'delete' });

getWebSocketsToken()

Request a WebSocket authentication token. Required for subscribing to private WebSocket channels. The token must be used within 15 minutes of creation. Signature
getWebSocketsToken(): Promise<SpotAPISuccessResponse<SpotWebSocketsTokenResponse>>
PropertyValue
HTTP methodPOST
Endpoint0/private/GetWebSocketsToken
Auth requiredYes
Response fieldsSpotWebSocketsTokenResponse
FieldTypeDescription
tokenstringThe WebSocket auth token
expiresnumberToken lifetime in seconds (900)
import { SpotClient } from '@siebly/kraken-api';

const client = new SpotClient({
  apiKey: process.env.API_SPOT_KEY,
  apiSecret: process.env.API_SPOT_SECRET,
});

const wsAuth = await client.getWebSocketsToken();
const token = wsAuth.result.token;
// Pass token to your WebSocket client for private channel subscriptions
console.log('WS Token:', token);
console.log('Expires in:', wsAuth.result.expires, 'seconds');

OAuth Methods

The following OAuth methods allow programmatic management of OAuth2 access tokens and Fast API keys. These are used in OAuth2-based integrations where users authorize access via Kraken’s OAuth flow. See reference/spot/funding.mdx for full parameter details and usage examples.

getOAuthAccessToken(params)

Retrieve an OAuth2 access token using an authorization code or refresh token flow. Signature
getOAuthAccessToken(
  params: OauthGetAccessTokenParams
): Promise<OauthGetAccessTokenResponse>
grant_type
'authorization_code' | 'refresh_token'
required
OAuth2 grant type.
code
string
Authorization code. Required when grant_type is authorization_code.
redirect_uri
string
Redirect URI. Required when grant_type is authorization_code.
refresh_token
string
Refresh token. Required when grant_type is refresh_token.
PropertyValue
HTTP methodPOST
Endpointoauth/token
Auth requiredBasic auth (base64-encoded client credentials)

getOAuthUserInfo()

Returns the email address and IBAN of the authenticated user. Requires OAuth2 Bearer token with scope account.info:basic. Signature
getOAuthUserInfo(): Promise<OauthGetUserInfoResponse>
PropertyValue
HTTP methodGET
Endpointoauth/userinfo
Auth requiredYes (OAuth2 Bearer)

createOAuthFastApiKey(params)

Creates a Fast API key with specified permissions and IP allowlist. Requires OAuth2 Bearer token with scope account.fast-api-key:write. Signature
createOAuthFastApiKey(
  params: OauthCreateFastApiKeyParams
): Promise<OauthCreateFastApiKeyResponse>
PropertyValue
HTTP methodPOST
Endpointoauth/fast-api-key
Auth requiredYes (OAuth2 Bearer)

listOAuthFastApiKeys()

List all Fast API keys associated with the OAuth client. Requires OAuth2 Bearer token with scope account.fast-api-key:read. Signature
listOAuthFastApiKeys(): Promise<{ result: OauthFastApiKey[] }>
PropertyValue
HTTP methodGET
Endpointoauth/fast-api-keys
Auth requiredYes (OAuth2 Bearer)

updateOAuthFastApiKey(params)

Updates an existing Fast API key. Requires OAuth2 Bearer token with scope account.fast-api-key:write. Signature
updateOAuthFastApiKey(params: OauthUpdateFastApiKeyParams): Promise<{ result: boolean }>
PropertyValue
HTTP methodPUT
Endpointoauth/fast-api-key
Auth requiredYes (OAuth2 Bearer)

deleteOAuthFastApiKey(params)

Deletes a Fast API key. Requires OAuth2 Bearer token with scope account.fast-api-key:write. Signature
deleteOAuthFastApiKey(params: { api_key_name: string }): Promise<{ result: boolean }>
api_key_name
string
required
Name of the key to delete (max 32 characters).
PropertyValue
HTTP methodDELETE
Endpointoauth/fast-api-key
Auth requiredYes (OAuth2 Bearer)

Build docs developers (and LLMs) love