REST API (1.1.0)

Download OpenAPI specification:Download

General Usage

This document details use of Kraken's REST API for our Spot exchange. The Spot exchange Websockets API and the Kraken Futures APIs are documented separately. Our REST API is organised into publicly accessible endpoints (market data, exchange status, etc.), and private authenticated endpoints (trading, funding, user data) which require requests to be signed.

Your use of the Kraken REST API is subject to the Kraken Terms & Conditions, Privacy Notice, as well as all other applicable terms and disclosures made available on www.kraken.com.

You must seek our prior permission for any non personal commercial use of the Kraken REST API, this includes, but is not limited to, any non personal commercial use of market data, exchange status, etc. available via the publicly available endpoints. You may seek such permission by contacting marketdata@kraken.com.

Support

Further information and FAQs may be found on the API section of our support pages. If you have trouble making any standard requests that our system permits, please send us a ticket with a full copy of the request(s) that you're attempting, including your IP address and all headers, so that we may investigate further.

Requests, Responses and Errors

Requests

Request payloads are form-encoded (Content-Type: application/x-www-form-urlencoded), and all requests must specify a User-Agent in their headers.

Responses

Responses are JSON encoded and contain one or two top-level keys (result and error for successful requests or those with warnings, or only error for failed or rejected requests)

Example Successful Response

{
  "error": [],
  "result": {
    "status": "online",
    "timestamp": "2021-03-22T17:18:03Z"
  }
}

GET https://api.kraken.com/0/public/SystemStatus

Example Rejection

{
  "error": [
    "EGeneral:Invalid arguments:ordertype"
  ]
}

Error Details

HTTP status codes are generally not used by our API to convey information about the state of requests -- any errors or warnings are denoted in the error field of the response as described above. Status codes other than 200 indicate that there was an issue with the request reaching our servers.

error messages follow the general format <severity><category>:<error msg>[:add'l text]

  • severity can be either E for error or W for warning
  • category can be one of General, Auth, API, Query, Order, Trade, Funding, or Service
  • error msg can be any text string that describes the reason for the error

Some Common Examples

Error Additional Info
EGeneral:Invalid arguments The request payload is malformed, incorrect or ambiguous
EGeneral:Invalid arguments:Index unavailable Index pricing is unavailable for stop/profit orders on this pair
EGeneral:Temporary lockout Too many sequential EAPI:Invalid key errors
EService:Unavailable The matching engine or API is offline
EService:Market in cancel_only mode Request can't be made at this time (See SystemStatus endpoint)
EService:Market in post_only mode Request can't be made at this time (See SystemStatus endpoint)
EService:Deadline elapsed The request timed out according to the default or specified deadline
EAPI:Invalid key An invalid API-Key header was supplied (see Authentication section)
EAPI:Invalid signature An invalid API-Sign header was supplied (see Authentication section)
EAPI:Invalid nonce An invalid nonce was supplied (see Authentication section)
EGeneral:Permission denied API key doesn't have permission to make this request
EOrder:Cannot open position User/tier is ineligible for margin trading
EOrder:Margin allowance exceeded User has exceeded their margin allowance
EOrder:Margin level too low Client has insufficient equity or collateral
EOrder:Margin position size exceeded Client would exceed the maximum position size for this pair
EOrder:Insufficient margin Exchange does not have available funds for this margin trade
EOrder:Insufficient funds Client does not have the necessary funds
EOrder:Order minimum not met Order size does not meet ordermin (See AssetPairs endpoint)
EOrder:Cost minimum not met Cost (price * volume) does not meet costmin (See AssetPairs endpoint)
EOrder:Tick size check failed Price submitted is not a valid multiple of the pair's tick_size (See AssetPairs endpoint)
EOrder:Orders limit exceeded (See Rate Limits section)
EOrder:Rate limit exceeded (See Rate Limits section)
EOrder:Domain rate limit exceeded (See Rate Limits section)
EOrder:Positions limit exceeded
EOrder:Unknown position
EBM:limit exceeded:CAL Exceeded Canadian Acquisition Limits (CAL)
EFunding:Max fee exceeded Processed fee exceeds max_fee set in Withdraw request

Additional information can be found on our support center.

Authentication

Authenticated requests must include both API-Key and API-Sign HTTP headers, and nonce in the request payload. otp is also required in the payload if two-factor authentication (2FA) is enabled.

Nonce and 2FA

nonce

Nonce must be an always increasing, unsigned 64-bit integer, for each request that is made with a particular API key. While a simple counter would provide a valid nonce, a more usual method of generating a valid nonce is to use e.g. a UNIX timestamp in milliseconds.

Note: There is no way to reset the nonce for an API key to a lower value, so be sure to use a nonce generation method that won't produce numbers less than the previous nonce. Too many requests with invalid nonces (EAPI:Invalid nonce) can result in temporary bans. Problems can arise from requests arriving out of order due to API keys being shared across processes, or from system clock drift/recalibration. An optional "nonce window" can be configured to specify a tolerance between nonce values. Additional info can be found in our support pages.

otp

If two-factor authentication (2FA) is enabled for the API key and action in question, the one time password must be specified in the payload's otp value.

Headers and Signature

All responses will include the x-trace-id header. This uniquely identifies your request. When contacting support, please include a trace-id where possible.

API-Key

The "API-Key" header should contain your API key.

Security Scheme Type: API Key
Header parameter name: API-Key

API-Sign

Authenticated requests should be signed with the "API-Sign" header, using a signature generated with your private key, nonce, encoded payload, and URI path according to:

HMAC-SHA512 of (URI path + SHA256(nonce + POST data)) and base64 decoded secret API key

Example Signature

The following is a specific example of a signature generated with a particular private key, nonce, and payload corresponding to a new limit order (buy 1.25 XBTUSD at $37,500). If your code is generating a different signature ("API-Sign") for this example, then there is likely an issue with your application of the above methodology. Code snippets for generating the signature in Python, Golang and Node.js follow below.

Field Value
Private Key kQH5HW/8p1uGOVjbgWA7FunAmGO8lsSUXNsu3eow76sz84Q18fWxnyRzBHCd3pd5nE9qa99HAZtuZuj6F1huXg==
Nonce 1616492376594
Encoded Payload nonce=1616492376594&ordertype=limit&pair=XBTUSD&price=37500&type=buy&volume=1.25
URI Path /0/private/AddOrder
API-Sign 4/dpxb3iT4tp/ZCVEwSnEsLxx0bqyhLpdfOpc6fn7OR8+UClSV5n9E6aSS8MPtnRfp32bAb0nmbRn6H8ndwLUQ==

Code Examples

Python

import urllib.parse
import hashlib
import hmac
import base64

def get_kraken_signature(urlpath, data, secret):

    postdata = urllib.parse.urlencode(data)
    encoded = (str(data['nonce']) + postdata).encode()
    message = urlpath.encode() + hashlib.sha256(encoded).digest()

    mac = hmac.new(base64.b64decode(secret), message, hashlib.sha512)
    sigdigest = base64.b64encode(mac.digest())
    return sigdigest.decode()

api_sec = "kQH5HW/8p1uGOVjbgWA7FunAmGO8lsSUXNsu3eow76sz84Q18fWxnyRzBHCd3pd5nE9qa99HAZtuZuj6F1huXg=="

data = {
    "nonce": "1616492376594",
    "ordertype": "limit",
    "pair": "XBTUSD",
    "price": 37500,
    "type": "buy",
    "volume": 1.25
}

signature = get_kraken_signature("/0/private/AddOrder", data, api_sec)
print("API-Sign: {}".format(signature))
package main

import (
  "crypto/hmac"
  "crypto/sha256"
  "crypto/sha512"
  "encoding/base64"
  "net/url"
  "fmt"
)

func getKrakenSignature(url_path string, values url.Values, secret []byte) string {

  sha := sha256.New()
  sha.Write([]byte(values.Get("nonce") + values.Encode()))
  shasum := sha.Sum(nil)

  mac := hmac.New(sha512.New, secret)
  mac.Write(append([]byte(url_path), shasum...))
  macsum := mac.Sum(nil)
  return base64.StdEncoding.EncodeToString(macsum)
}

func main() {

  apiSecret := "kQH5HW/8p1uGOVjbgWA7FunAmGO8lsSUXNsu3eow76sz84Q18fWxnyRzBHCd3pd5nE9qa99HAZtuZuj6F1huXg=="

  payload := url.Values{}
  payload.Add("pair","XBTUSD")
  payload.Add("type","buy")
  payload.Add("ordertype","limit")
  payload.Add("price","37500")
  payload.Add("volume","1.25")
  payload.Add("nonce","1616492376594")

  b64DecodedSecret, _ := base64.StdEncoding.DecodeString(apiSecret)

  signature := getKrakenSignature("/0/private/AddOrder", payload, b64DecodedSecret)
  fmt.Printf("API-Sign: " + signature +"\n")
}

Node JS

const crypto = require('crypto');
const qs     = require('qs');

const getMessageSignature = (path, request, secret, nonce) => {
    const message       = qs.stringify(request);
    const secret_buffer = new Buffer(secret, 'base64');
    const hash          = new crypto.createHash('sha256');
    const hmac          = new crypto.createHmac('sha512', secret_buffer);
    const hash_digest   = hash.update(nonce + message).digest('binary');
    const hmac_digest   = hmac.update(path + hash_digest, 'binary').digest('base64');

    return hmac_digest;
};
Security Scheme Type: API Key
Header parameter name: API-Sign

Rate Limits

We have various safeguards in place to protect against system abuse, order book manipulation, DDoS attacks, etc. For REST API requests, these are broadly organised into rate limits specific to the REST API, and rate limits which apply to any trading requests.

Note: For clients with performance sensitive applications, we strongly recommend the use of our Websockets API for minimising request latency and receiving real-time information, reducing or eliminating the need to frequently poll REST endpoints.

REST API Rate Limits

Limits

Every REST API user has a "call counter" which starts at 0. Ledger/trade history calls increase the counter by 2. All other API calls increase this counter by 1 (except AddOrder, CancelOrder which operate on a different limiter detailed further below).

Tier Max API Counter API Counter Decay
Starter 15 -0.33/sec
Intermediate 20 -0.5/sec
Pro 20 -1/sec

The user's counter is reduced every couple of seconds depending on their verification tier. Each API key's counter is separate, and if the counter exceeds the maximum value, subsequent calls using that API key would be rate limited. If the rate limits are reached, additional calls will be restricted for a few seconds (or possibly longer if calls continue to be made while the rate limits are active).

Note: Master accounts and subaccounts will share the same default trading rate limits as determined by the master account's tier.

Errors

  • "EAPI:Rate limit exceeded" if the REST API counter exceeds the user's maximum.
  • "EService: Throttled: [UNIX timestamp]" if there are too many concurrent requests. Try again after [timestamp].

Additional information can be found on our support center.

Matching Engine Rate Limits

Limits

Separate limits apply to the number of orders clients may have open in each pair at a time, and the speed with which they may add and cancel orders in each pair. These limits vary by the account verification tier:

Tier Max Num Orders Max Ratecount Ratecount Decay
Starter 60 60 -1/sec
Intermediate 80 125 -2.34/sec
Pro 225 180 -3.75/sec

Penalties

The speed is controlled by a ratecounter for each (client, pair) which starts at zero, is incremented when penalties are applied, and decremented according to the decay rates above. A penalty is added to the ratecounter for each new order placed (AddOrder) or cancelled (CancelOrder, CancelAll, CancelAllOrdersAfter) on the pair. The cancellation penalty varies according to the lifetime of the order.

Action <5sec <10sec <15sec <45sec <90sec <300s >300s
Add Order +1
AddOrderBatch*** +(n/2)
Edit Order +6 +5 +4 +2 +1 0 0
Cancel Order +8 +6 +5 +4 +2 +1 0
CancelOrderBatch** +8 +6 +5 +4 +2 +1 0

*** n is number of orders in batch

** Rate limits penalty for CancelOrderBatch will be cumulative sum of individual orders penalty, accumulated upto max ratecount. In case, the cumulative penalty in the batch exceeds max ratecount, cancel requests in batch are still accepted.

Note: A client's exact ratecounter values can be monitored via the Websockets openOrders feed.

Errors

  • "EOrder:Orders limit exceeded" if the number of open orders in a given pair is exceeded
  • "EOrder:Rate limit exceeded" if the user's max ratecount is exceeded for a given pair

Additional information can be found on our support center.

Changelog

  • Mar 2024 - Removed Staking section, deprecated and no longer supported.
  • Feb 2024 - Added maker and ledgers fields to TradesHistory and QueryTrades. Added NFT Market Data and Trading documentation.
  • Jan 2024 - Removed support for POST requests to all public endpoints; these requests will now return a 4xx error, please use a GET request instead. Added notes to Balance and Ledger endpoints on migration from Staking to Earn and asset suffixes.
  • Dec 2023 - Added support for trailing-stop and trailing-stop-limit order types.
  • Nov 2023 - Added WithdrawMethods and WithdrawAddresses endpoints, and start, end, cursor, and limit parameters to WithdrawStatus.
  • Oct 2023 - Added max_fee parameter to Withdraw and minimum field in response for DepositMethods.
  • Sep 2023 - Added start, end, cursor, and limit parameters to DepositStatus.
  • Aug 2023 - Added Earn service documentation.
  • July 2023 - Added private BalanceEx documentation.
  • June 2023 - Added amount parameter to DepositAddresses, required for Bitcoin Lightning deposits. Added count parameter to Trades.
  • May 2023 - Added address parameter to Withdraw. Added since parameter to Spread.
  • Mar 2023 - Added originators paramater to DepositStatus.
  • Feb 2023 - Added long and short margin position limits to AssetPairs.
  • Feb 2023 - Specified minimum and maximum number of txids and userrefs for CancelOrderBatch.
  • Feb 2023 - Specified maximum number of responses for DepositStatus and WithdrawStatus.
  • Feb 2023 - Noted to use %2b instead of + for URL encoding in AddOrder starttm and expiretm parameters.
  • Jan 2023 - Removed requirement for asset in DepositStatus and WithdrawalStatus.
  • Jan 2023 - Documented reduce_only parameter in AddOrder and AddOrderBatch.
  • Jan 2023 - Added consolidate_taker to TradesHistory, ClosedOrders, and QueryOrders.
  • Jan 2023 - Added Subaccounts section with CreateSubaccount and AccountTransfer endpoints.
  • Jan 2023 - Added trade_id to private TradesHistory.
  • Dec 2022 - Fixed pair parameter restriction on TradeVolume.
  • Dec 2022 - EditOrder allowed on margin orders.
  • Nov 2022 - Added tick_size and status parameters to AssetPairs, status and collateral_value to Assets, and trade_id to public Trades.
  • Oct 2022 - Documented uv (unexecuted value) field in TradeBalance.
  • Oct 2022 - Added costmin trading parameter to AssetPairs.
  • Oct 2022 - Ticker wildcard support - pair no longer required, no pair parameter returns tickers for all tradeable exchange assets.
  • Sep 2022 - AddOrder/EditOrder/AddOrderBatch now support icebergs.
  • July 2022 - Added support for restricting API keys to specified IP address(es)/range.
  • June 2022 - Added custom self trade prevention options.
  • May 2022 - Added new REST AddOrderBatch endpoint to send multiple new orders and CancelOrderBatch endpoint to cancel multiple open orders.
  • Mar 2022 - Added new REST EditOrder endpoint to edit volume and price on open orders.
  • Dec 2021 - Added REST AddOrder support for optional parameter trigger and values last (last traded price) and index.

Note: Most changes affecting our APIs or trading engine behaviour are currently being tracked on our Websockets changelog, until these documents are combined.

Example API Clients

In order to achieve maximum performance, security and flexibility for your particular needs, we strongly encourage the implementation of this API with your own code, and to minimise reliance on third party software.

That being said, in order to aid with rapid development and prototyping, we're in the process of producing 'official' API clients in Python and Golang that will be actively maintained, coincident with the release of newer versions of both our Websockets and REST APIs. In the meantime, our Client Engagement team has compiled a number of code snippets, examples and Postman collections that many find useful.

Third Party Software

Below are other third party API client code libraries that may be used when writing your own API client. Please keep in mind that Payward nor the third party authors are responsible for losses due to bugs or improper use of the APIs. Payward has performed an initial review of the safety of the third party code before listing them but cannot vouch for any changes added since then, or for those that may be stale. If you have concerns, please contact support.

Language Link
C++ https://github.com/voidloop/krakenapi
Golang https://github.com/Beldur/kraken-go-api-client
Python 3 https://github.com/veox/python3-krakenex

Other

Spot Market Data

Note: As of 31st Jan 2024, the undocumented use of POST requests to /0/public/* endpoints will be deprecated to improve the performance of our systems and experience for consumers of the API. The endpoints will now return a 4xx error when accessed with a POST request instead of a GET.

Get Server Time

Get the server's time.

Note: Despite working previously, POST requests to this endpoint will now return a 4xx error. Please use a GET request instead.

Responses

Response Schema: application/json
object (ServerTime)
error
Array of strings (error)

Request samples

curl "https://api.kraken.com/0/public/Time"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "unixtime": 1688669448,
    • "rfc1123": "Thu, 06 Jul 23 18:50:48 +0000"
    }
}

Get System Status

Get the current system status or trading mode.

Note: Despite working previously, POST requests to this endpoint will now return a 4xx error. Please use a GET request instead.

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

curl "https://api.kraken.com/0/public/SystemStatus"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "status": "online",
    • "timestamp": "2023-07-06T18:52:00Z"
    }
}

Get Asset Info

Get information about the assets that are available for deposit, withdrawal, trading and earn.

Note: Despite working previously, POST requests to this endpoint will now return a 4xx error. Please use a GET request instead.

query Parameters
asset
string
Example: asset=XBT,ETH

Comma delimited list of assets to get info on (optional, default all available assets)

aclass
string
Example: aclass=currency

Asset class (optional, default: currency)

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

curl "https://api.kraken.com/0/public/Assets"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "XXBT": {
      • "aclass": "currency",
      • "altname": "XBT",
      • "decimals": 10,
      • "display_decimals": 5,
      • "collateral_value": 1,
      • "status": "enabled"
      },
    • "ZEUR": {
      • "aclass": "currency",
      • "altname": "EUR",
      • "decimals": 4,
      • "display_decimals": 2,
      • "collateral_value": 1,
      • "status": "enabled"
      },
    • "ZUSD": {
      • "aclass": "currency",
      • "altname": "USD",
      • "decimals": 4,
      • "display_decimals": 2,
      • "collateral_value": 1,
      • "status": "enabled"
      }
    }
}

Get Tradable Asset Pairs

Get tradable asset pairs.

Note: Despite working previously, POST requests to this endpoint will now return a 4xx error. Please use a GET request instead.

query Parameters
pair
string
Example: pair=BTC/USD,ETH/BTC

Asset pairs to get data for

info
string
Default: "info"
Enum: "info" "leverage" "fees" "margin"

Info to retrieve (optional)

  • info = all info
  • leverage = leverage info
  • fees = fees schedule
  • margin = margin info

Responses

Response Schema: application/json
object

Pair names and their info

error
Array of strings (error)

Request samples

curl "https://api.kraken.com/0/public/AssetPairs?pair=XXBTZUSD,XETHXXBT"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "XETHXXBT": {
      • "altname": "ETHXBT",
      • "wsname": "ETH/XBT",
      • "aclass_base": "currency",
      • "base": "XETH",
      • "aclass_quote": "currency",
      • "quote": "XXBT",
      • "lot": "unit",
      • "cost_decimals": 6,
      • "pair_decimals": 5,
      • "lot_decimals": 8,
      • "lot_multiplier": 1,
      • "leverage_buy": [
        ],
      • "leverage_sell": [
        ],
      • "fees": [
        ],
      • "fees_maker": [
        ],
      • "fee_volume_currency": "ZUSD",
      • "margin_call": 80,
      • "margin_stop": 40,
      • "ordermin": "0.01",
      • "costmin": "0.00002",
      • "tick_size": "0.00001",
      • "status": "online",
      • "long_position_limit": 1100,
      • "short_position_limit": 400
      },
    • "XXBTZUSD": {
      • "altname": "XBTUSD",
      • "wsname": "XBT/USD",
      • "aclass_base": "currency",
      • "base": "XXBT",
      • "aclass_quote": "currency",
      • "quote": "ZUSD",
      • "lot": "unit",
      • "cost_decimals": 5,
      • "pair_decimals": 1,
      • "lot_decimals": 8,
      • "lot_multiplier": 1,
      • "leverage_buy": [
        ],
      • "leverage_sell": [
        ],
      • "fees": [
        ],
      • "fees_maker": [
        ],
      • "fee_volume_currency": "ZUSD",
      • "margin_call": 80,
      • "margin_stop": 40,
      • "ordermin": "0.0001",
      • "costmin": "0.5",
      • "tick_size": "0.1",
      • "status": "online",
      • "long_position_limit": 250,
      • "short_position_limit": 200
      }
    }
}

Get Ticker Information

Get ticker information for all or requested markets. To clarify usage, note that:

  • Today's prices start at midnight UTC
  • Leaving the pair parameter blank will return tickers for all tradeable assets on Kraken

Note: Despite working previously, POST requests to this endpoint will now return a 4xx error. Please use a GET request instead.

query Parameters
pair
string
Example: pair=XBTUSD

Asset pair to get data for (optional, default: all tradeable exchange pairs)

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

curl "https://api.kraken.com/0/public/Ticker?pair=XBTUSD"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "XXBTZUSD": {
      • "a": [
        ],
      • "b": [
        ],
      • "c": [
        ],
      • "v": [
        ],
      • "p": [
        ],
      • "t": [
        ],
      • "l": [
        ],
      • "h": [
        ],
      • "o": "30502.80000"
      }
    }
}

Get OHLC Data

Get OHLC (open/high/low/close, otherwise known as candle) data for a given market. Note that the last entry in the OHLC array is for the current, not-yet-committed frame and will always be present, regardless of the value of since.

Note: Despite working previously, POST requests to this endpoint will now return a 4xx error. Please use a GET request instead.

query Parameters
pair
required
string
Example: pair=XBTUSD

Asset pair to get data for

interval
integer
Default: 1
Enum: 1 5 15 30 60 240 1440 10080 21600
Example: interval=60

Time frame interval in minutes

since
integer
Example: since=1548111600

Return up to 720 OHLC data points since given timestamp

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

curl "https://api.kraken.com/0/public/OHLC?pair=XBTUSD"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "XXBTZUSD": [
      • [
        ],
      • [
        ],
      • [
        ],
      • [
        ]
      ],
    • "last": 1688672160
    }
}

Get Order Book

Get current order book details.

Note: Despite working previously, POST requests to this endpoint will now return a 4xx error. Please use a GET request instead.

query Parameters
pair
required
string
Example: pair=XBTUSD

Asset pair to get data for

count
integer [ 1 .. 500 ]
Default: 100
Example: count=2

Maximum number of asks/bids

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

curl "https://api.kraken.com/0/public/Depth?pair=XBTUSD"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "XXBTZUSD": {
      • "asks": [
        ],
      • "bids": [
        ]
      }
    }
}

Get Recent Trades

Returns the last 1000 trades by default.

Note: Despite working previously, POST requests to this endpoint will now return a 4xx error. Please use a GET request instead.

query Parameters
pair
required
string
Example: pair=XBTUSD

Asset pair to get data for

since
string
Example: since=1616663618

Return trade data since given timestamp

count
integer [ 1 .. 1000 ]
Default: 1000
Example: count=2

Return specific number of trades, up to 1000

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

curl "https://api.kraken.com/0/public/Trades?pair=XBTUSD"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "XXBTZUSD": [
      • [
        ],
      • [
        ],
      • [
        ]
      ],
    • "last": "1688671969993150842"
    }
}

Get Recent Spreads

Returns the last ~200 top-of-book spreads for a given pair.

Note: Despite working previously, POST requests to this endpoint will now return a 4xx error. Please use a GET request instead.

query Parameters
pair
required
string
Example: pair=XBTUSD

Asset pair to get data for

since
integer
Example: since=1678219570

Returns spread data since given timestamp. Optional, intended for incremental updates within available dataset (does not contain all historical spreads).

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

curl "https://api.kraken.com/0/public/Spread?pair=XBTUSD"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "XXBTZUSD": [
      • [
        ],
      • [
        ],
      • [
        ]
      ],
    • "last": 1688672106
    }
}

NFT Market Data

Get NFT

Operation GetNft returns an NFT object by its identifier where identifier is a kraken internal identifier

Request Body schema: application/x-www-form-urlencoded
currency
string or null

Fiat currency used for converting crypto prices

nft_id
required
string

Identifier of the NFT

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl "https://api.kraken.com/0/public/Nft?nft_id=NT4GUCU-SIJE2-YSQQG2"

Response samples

Content type
application/json
{}

List NFTs

Returns a list of NFTs with support for sorting and filtration.

Request Body schema: application/x-www-form-urlencoded
currency
string or null

Fiat currency used for converting crypto prices.

cursor
string or null

Cursor token. Pass tokens obtained from successful responses.

object or null

Filters to apply. Note: if filters are present, they are required to be passed for an initial request and omitted for subsequent ones.

page_size
required
integer <uint16> >= 0

Maximum number of items to be returned by a single request.

sort
string or null
Enum: "MostRelevant" "RecentlyAdded" "RecentlyVerified" "RecentlySold" "EndingSoon" "PriceLowToHigh" "PriceHighToLow" "HighestLastSell" "RarityRankLowToHigh" "RarityRankHighToLow"

Sorting to apply. Note: sort parameter is required to be passed for an initial request and omitted for subsequent ones.

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Batch of paginated items from list APIs.

Request samples

curl "https://api.kraken.com/0/public/Nfts?filter%5Bcollection_id%5D=NCQNABO-XYCA7-JMMSDF&page_size=10"

Response samples

Content type
application/json
{}

getNftProvenance

Operation GetNftProvenance returns history of NFT ownership for a particular nft ID.

Request Body schema: application/x-www-form-urlencoded
currency
string or null

Fiat currency used for converting crypto prices

nft_id
required
string
page
integer <uint16> [ 1 .. 65536 ]
Default: 1

Page number with query results starting from one

per_page
integer <uint16> [ 1 .. 1000 ]
Default: 5

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl "https://api.kraken.com/0/public/NftProvenance?nft_id=NT7EYX2-D7QVC-S7JDLE"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "items": [
      • {
        },
      • {
        }
      ],
    • "total": 2
    }
}

getCollection

Returns a NFT Collection object by its identifier where identifier is a kraken internal identifier

Request Body schema: application/x-www-form-urlencoded
collection_id
required
string

ID of the collection

currency
string or null

Fiat currency used for converting crypto prices

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl "https://api.kraken.com/0/public/NftCollection?collection_id=NCQNABO-XYCA7-JMMSDF"

Response samples

Content type
application/json
{}

listCollections

Returns a list of NFTs with support for sorting and filtration.

Request Body schema: application/x-www-form-urlencoded
currency
string or null

Fiat currency used for converting crypto prices.

cursor
string or null

Cursor token. Pass tokens obtained from successful responses.

object or null

Filters to apply. Note: if filters are present, they are required to be passed for an initial request and omitted for subsequent ones.

page_size
required
integer <uint16> >= 0

Maximum number of items to be returned by a single request.

sort
string or null
Enum: "RecentlyAdded" "RecentlyVerified" "PriceLowToHigh" "PriceHighToLow" "NameAsc" "NameDesc" "TotalVolumeAsc" "TotalVolumeDesc" "SevenDayVolumeAsc" "SevenDayVolumeDesc" "SevenDayAveragePriceAsc" "SevenDayAveragePriceDesc" "OwnerCountAsc" "OwnerCountDesc" "MostRelevant" "ByAllTimeKrakenVolumeAsc" "ByAllTimeKrakenVolumeDesc" "By30DaysKrakenVolumeAsc" "By30DaysKrakenVolumeDesc" "By7DaysKrakenVolumeAsc" "By7DaysKrakenVolumeDesc" "By24HoursKrakenVolumeAsc" "By24HoursKrakenVolumeDesc"

Sorting to apply. Note: sort parameter is required to be passed for an initial request and omitted for subsequent ones.

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Batch of paginated items from list APIs.

Request samples

curl  "https://api.kraken.com/0/public/NftCollections?page_size=10&filter%5Bsearch%5D=Williams"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "total_items": {
      • "relation": "eq",
      • "value": 2
      },
    • "items": [
      • {
        },
      • {
        }
      ]
    }
}

getCreator

Returns a NFT Collection object by its identifier where identifier is a kraken internal identifier

Request Body schema: application/x-www-form-urlencoded
creator_id
required
string

Identifier of the Creator.

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl "https://api.kraken.com/0/public/NftCreator?creator_id=NA7NELE-FOQFZ-ODWOTV"

Response samples

Content type
application/json
{}

listCreators

Returns a list of NFTs with support for sorting and filtration.

Request Body schema: application/x-www-form-urlencoded
currency
string or null

Fiat currency used for converting crypto prices.

cursor
string or null

Cursor token. Pass tokens obtained from successful responses.

object or null

Filters to apply. Note: if filters are present, they are required to be passed for an initial request and omitted for subsequent ones.

page_size
required
integer <uint16> >= 0

Maximum number of items to be returned by a single request.

sort
string or null
Enum: "RecentlyAdded" "RecentlyVerified" "MostRelevant"

Sorting to apply. Note: sort parameter is required to be passed for an initial request and omitted for subsequent ones.

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Batch of paginated items from list APIs.

Request samples

curl "https://api.kraken.com/0/public/NftCreators?filter%5Bcollection_search%5D=Williams&page_size=10"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "total_items": {
      • "relation": "eq",
      • "value": 1
      },
    • "items": [
      • {
        }
      ]
    }
}

listBlockchains

Returns a list of supported blockchains and associated currencies.

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl -X "GET" "https://api.kraken.com/0/public/NftBlockchains"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "items": [
      • {
        },
      • {
        },
      • {
        }
      ],
    • "total": 3
    }
}

getAuctions

Get NFT auctions. Returns information about a specific auction. The auction can be retrieved by either the auction identifier or the NFT identifier.

Responses

Response Schema: application/json
error
required
Array of strings (error)
Array of objects or null

Request samples

curl -X "GET" "https://api.kraken.com/0/public/NftAuctions?status=open&nft_id[]=NTN63WS-PBAV3-FQDQDG"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": [
    • {
      • "auction_id": "AJ4ZEP-7BC2W-AAK2P6",
      • "quote_currency": "SOL",
      • "user": "utility-oyster-kiwi",
      • "type": "fixed",
      • "bids": [ ],
      • "status": "open",
      • "start_time": 0,
      • "expiry_time": 0,
      • "extension_time": 0,
      • "reserve_price": "0.0000000000",
      • "buyout_price": "6.9500000000",
      • "nft_ids": [
        ],
      • "root_id": "",
      • "status_detail": "OPEN"
      }
    ]
}

getOffers

Get NFT offers. Gets the offers placed for a specific NFT.

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl "https://api.kraken.com/0/public/NftOffers?nft_id=NT4GUCU-SIJE2-YSQQG2"

Response samples

Content type
application/json
{
  • "result": {
    • "offers": [
      • {
        }
      ]
    },
  • "error": [ ]
}

getNftQuotes

Get NFT quotes. Creates a new quote for an NFT. This method accepts the quote details (or an array of multiple quotes). In the response, the method returns the identifier of the quotes.

Responses

Response Schema: application/json
error
required
Array of strings (error)
result
object or null

Request samples

curl "https://api.kraken.com/0/public/NftQuotes?nft_id%5B0%5D=NT4GUCU-SIJE2-YSQQG2&count=2"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "NT4EFBO-OWGI5-QLO7AG": [
      • {
        }
      ]
    }
}

Account Data

Get Account Balance

Retrieve all cash balances, net of pending withdrawals.

Note on Staking/Earn assets: We have begun to migrate assets from our legacy Staking system over to a new Earn system. As such, the following assets may appear in your balances and ledger. Please see our Support article for more details.

  • .B, which represents balances in new yield-bearing products, similar to .S (staked) and .M (opt-in rewards) balances
  • .F, which represents balances earning automatically in Kraken Rewards

API Key Permissions Required: Funds permissions - Query

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

Responses

Response Schema: application/json
object (AccountBalance)

Account Balance

error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/Balance" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "ZUSD": "171288.6158",
    • "ZEUR": "504861.8946",
    • "XXBT": "1011.1908877900",
    • "XETH": "818.5500000000",
    • "USDT": "500000.00000000",
    • "DAI": "9999.9999999999",
    • "DOT": "2.5000000000",
    • "ETH2.S": "198.3970800000",
    • "ETH2": "2.5885574330",
    • "USD.M": "1213029.2780"
    }
}

Get Extended Balance

Retrieve all extended account balances, including credits and held amounts. Balance available for trading is calculated as: available balance = balance + credit - credit_used - hold_trade

Note on Staking/Earn assets: We have begun to migrate assets from our legacy Staking system over to a new Earn system. As such, the following assets may appear in your balances and ledger. Please see our Support article for more details.

  • .B, which represents balances in new yield-bearing products, similar to .S (staked) and .M (opt-in rewards) balances
  • .F, which represents balances earning automatically in Kraken Rewards

API Key Permissions Required: Funds permissions - Query

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

Responses

Response Schema: application/json
object (ExtendedBalance)

Extended Balance

error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/BalanceEx" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "ZUSD": {
      • "balance": 25435.21,
      • "hold_trade": 8249.76
      },
    • "XXBT": {
      • "balance": 1.2435,
      • "hold_trade": 0.8423
      }
    }
}

Get Trade Balance

Retrieve a summary of collateral balances, margin position valuations, equity and margin level.

API Key Permissions Required: Orders and trades - Query open orders & trades

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
string
Default: "ZUSD"

Base asset used to determine balance

Responses

Response Schema: application/json
object (AccountBalance)

Account Balance

error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/TradeBalance" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>&asset=ZUSD"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "eb": "1101.3425",
    • "tb": "392.2264",
    • "m": "7.0354",
    • "n": "-10.0232",
    • "c": "21.1063",
    • "v": "31.1297",
    • "e": "382.2032",
    • "mf": "375.1678",
    • "ml": "5432.57"
    }
}

Get Open Orders

Retrieve information about currently open orders.

API Key Permissions Required: Orders and trades - Query open orders & trades

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

trades
boolean
Default: false

Whether or not to include trades related to position in output

userref
integer <int32>

Restrict results to given user reference id

Responses

Response Schema: application/json
object (OpenOrders)

Open Orders

error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/OpenOrders" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>&trades=true"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "open": {
      • "OQCLML-BW3P3-BUCMWZ": {
        },
      • "OB5VMB-B4U2U-DK2WRW": {
        }
      }
    }
}

Get Closed Orders

Retrieve information about orders that have been closed (filled or cancelled). 50 results are returned at a time, the most recent by default.

Note: If an order's tx ID is given for start or end time, the order's opening time (opentm) is used

API Key Permissions Required: Orders and trades - Query closed orders & trades

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

trades
boolean
Default: false

Whether or not to include trades related to position in output

userref
integer <int32>

Restrict results to given user reference id

start
integer

Starting unix timestamp or order tx ID of results (exclusive)

end
integer

Ending unix timestamp or order tx ID of results (inclusive)

ofs
integer

Result offset for pagination

closetime
string
Default: "both"
Enum: "open" "close" "both"

Which time to use to search

consolidate_taker
boolean
Default: true

Whether or not to consolidate trades by individual taker trades

Responses

Response Schema: application/json
object (ClosedOrders)

Closed Orders

error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/ClosedOrders" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>&trades=true"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "closed": {
      • "O37652-RJWRT-IMO74O": {
        },
      • "O6YDQ5-LOMWU-37YKEE": {
        }
      },
    • "count": 2
    }
}

Query Orders Info

Retrieve information about specific orders.

API Key Permissions Required: Orders and trades - Query open orders & trades or Orders and trades - Query closed orders & trades, depending on status of order

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

trades
boolean
Default: false

Whether or not to include trades related to position in output

userref
integer <int32>

Restrict results to given user reference id

txid
required
string

Comma delimited list of transaction IDs to query info about (50 maximum)

consolidate_taker
boolean
Default: true

Whether or not to consolidate trades by individual taker trades

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/QueryOrders" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>&trades=true"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "OBCMZD-JIEE7-77TH3F": {
      • "refid": "None",
      • "userref": 0,
      • "status": "closed",
      • "reason": null,
      • "opentm": 1688665496.7808,
      • "closetm": 1688665499.1922,
      • "starttm": 0,
      • "expiretm": 0,
      • "descr": {
        },
      • "vol": "1.25000000",
      • "vol_exec": "1.25000000",
      • "cost": "27526.2",
      • "fee": "26.2",
      • "price": "27500.0",
      • "stopprice": "0.00000",
      • "limitprice": "0.00000",
      • "misc": "",
      • "oflags": "fciq",
      • "trigger": "index",
      • "trades": [
        ]
      },
    • "OMMDB2-FSB6Z-7W3HPO": {
      • "refid": "None",
      • "userref": 0,
      • "status": "closed",
      • "reason": null,
      • "opentm": 1688592012.2317,
      • "closetm": 1688592012.2335,
      • "starttm": 0,
      • "expiretm": 0,
      • "descr": {
        },
      • "vol": "0.25000000",
      • "vol_exec": "0.25000000",
      • "cost": "7500.0",
      • "fee": "7.5",
      • "price": "30000.0",
      • "stopprice": "0.00000",
      • "limitprice": "0.00000",
      • "misc": "",
      • "oflags": "fcib",
      • "trades": [
        ]
      }
    }
}

Get Trades History

Retrieve information about trades/fills. 50 results are returned at a time, the most recent by default.

  • Unless otherwise stated, costs, fees, prices, and volumes are specified with the precision for the asset pair (pair_decimals and lot_decimals), not the individual assets' precision (decimals).

API Key Permissions Required: Orders and trades - Query closed orders & trades

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

type
string
Default: "all"
Enum: "all" "any position" "closed position" "closing position" "no position"

Type of trade

trades
boolean
Default: false

Whether or not to include trades related to position in output

start
integer

Starting unix timestamp or trade tx ID of results (exclusive)

end
integer

Ending unix timestamp or trade tx ID of results (inclusive)

ofs
integer

Result offset for pagination

consolidate_taker
boolean
Default: true

Whether or not to consolidate trades by individual taker trades

ledgers
boolean
Default: false

Whether or not to include related ledger ids for given trade
Note that setting this to true will slow request performance

Responses

Response Schema: application/json
object (TradeHistory)

Trade History

error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/TradesHistory" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>&trades=true"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "trades": {
      • "THVRQM-33VKH-UCI7BS": {
        },
      • "TCWJEG-FL4SZ-3FKGH6": {
        }
      }
    }
}

Query Trades Info

Retrieve information about specific trades/fills.

API Key Permissions Required: Orders and trades - Query closed orders & trades

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

txid
required
string

Comma delimited list of transaction IDs to query info about (20 maximum)

trades
boolean
Default: false

Whether or not to include trades related to position in output

Responses

Response Schema: application/json
object

Trade info

error
Array of strings (error) [ items ]

Request samples

curl -X "POST" "https://api.kraken.com/0/private/QueryTrades" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>&txid=TRWCIF-3MJWU-5DYJG5,TNGJFU-5CD67-ZV3AEO"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "THVRQM-33VKH-UCI7BS": {
      • "ordertxid": "OQCLML-BW3P3-BUCMWZ",
      • "postxid": "TKH2SE-M7IF5-CFI7LT",
      • "pair": "XXBTZUSD",
      • "time": 1688667796.8802,
      • "type": "buy",
      • "ordertype": "limit",
      • "price": "30010.00000",
      • "cost": "600.20000",
      • "fee": "0.00000",
      • "vol": "0.02000000",
      • "margin": "0.00000",
      • "misc": "",
      • "trade_id": 93748276,
      • "maker": true
      },
    • "TTEUX3-HDAAA-RC2RUO": {
      • "ordertxid": "OH76VO-UKWAD-PSBDX6",
      • "postxid": "TKH2SE-M7IF5-CFI7LT",
      • "pair": "XXBTZEUR",
      • "time": 1688082549.3138,
      • "type": "buy",
      • "ordertype": "limit",
      • "price": "27732.00000",
      • "cost": "0.20020",
      • "fee": "0.00000",
      • "vol": "0.00020000",
      • "margin": "0.00000",
      • "misc": "",
      • "trade_id": 74625834,
      • "maker": true
      }
    }
}

Get Open Positions

Get information about open margin positions.

API Key Permissions Required: Orders and trades - Query open orders & trades

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

txid
string

Comma delimited list of txids to limit output to

docalcs
boolean
Default: false

Whether to include P&L calculations

consolidation
string
Value: "market"

Consolidate positions by market/pair

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

import time
import os
import requests

# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
api_key = os.environ['API_KEY_KRAKEN']
api_sec = os.environ['API_SEC_KRAKEN']

# Attaches auth headers and returns results of a POST request
def kraken_request(uri_path, data, api_key, api_sec):
    headers = {}
    headers['API-Key'] = api_key
    # get_kraken_signature() as defined in the 'Authentication' section
    headers['API-Sign'] = get_kraken_signature(uri_path, data, api_sec)
    req = requests.post((api_url + uri_path), headers=headers, data=data)
    return req

# Construct the request and print the result
resp = kraken_request('/0/private/OpenPositions', {
    "nonce": str(int(1000*time.time())),
    "docalcs": True
}, api_key, api_sec)

print(resp.json())

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "TF5GVO-T7ZZ2-6NBKBI": {
      • "ordertxid": "OLWNFG-LLH4R-D6SFFP",
      • "posstatus": "open",
      • "pair": "XXBTZUSD",
      • "time": 1605280097.8294,
      • "type": "buy",
      • "ordertype": "limit",
      • "cost": "104610.52842",
      • "fee": "289.06565",
      • "vol": "8.82412861",
      • "vol_closed": "0.20200000",
      • "margin": "20922.10568",
      • "value": "258797.5",
      • "net": "+154186.9728",
      • "terms": "0.0100% per 4 hours",
      • "rollovertm": "1616672637",
      • "misc": "",
      • "oflags": ""
      },
    • "T24DOR-TAFLM-ID3NYP": {
      • "ordertxid": "OIVYGZ-M5EHU-ZRUQXX",
      • "posstatus": "open",
      • "pair": "XXBTZUSD",
      • "time": 1607943827.3172,
      • "type": "buy",
      • "ordertype": "limit",
      • "cost": "145756.76856",
      • "fee": "335.24057",
      • "vol": "8.00000000",
      • "vol_closed": "0.00000000",
      • "margin": "29151.35371",
      • "value": "240124.0",
      • "net": "+94367.2314",
      • "terms": "0.0100% per 4 hours",
      • "rollovertm": "1616672637",
      • "misc": "",
      • "oflags": ""
      },
    • "TYMRFG-URRG5-2ZTQSD": {
      • "ordertxid": "OF5WFH-V57DP-QANDAC",
      • "posstatus": "open",
      • "pair": "XXBTZUSD",
      • "time": 1610448039.8374,
      • "type": "buy",
      • "ordertype": "limit",
      • "cost": "0.00240",
      • "fee": "0.00000",
      • "vol": "0.00000010",
      • "vol_closed": "0.00000000",
      • "margin": "0.00048",
      • "value": "0",
      • "net": "+0.0006",
      • "terms": "0.0100% per 4 hours",
      • "rollovertm": "1616672637",
      • "misc": "",
      • "oflags": ""
      },
    • "TAFGBN-TZNFC-7CCYIM": {
      • "ordertxid": "OF5WFH-V57DP-QANDAC",
      • "posstatus": "open",
      • "pair": "XXBTZUSD",
      • "time": 1610448039.8448,
      • "type": "buy",
      • "ordertype": "limit",
      • "cost": "2.40000",
      • "fee": "0.00264",
      • "vol": "0.00010000",
      • "vol_closed": "0.00000000",
      • "margin": "0.48000",
      • "value": "3.0",
      • "net": "+0.6015",
      • "terms": "0.0100% per 4 hours",
      • "rollovertm": "1616672637",
      • "misc": "",
      • "oflags": ""
      },
    • "T4O5L3-4VGS4-IRU2UL": {
      • "ordertxid": "OF5WFH-V57DP-QANDAC",
      • "posstatus": "open",
      • "pair": "XXBTZUSD",
      • "time": 1610448040.7722,
      • "type": "buy",
      • "ordertype": "limit",
      • "cost": "21.59760",
      • "fee": "0.02376",
      • "vol": "0.00089990",
      • "vol_closed": "0.00000000",
      • "margin": "4.31952",
      • "value": "27.0",
      • "net": "+5.4133",
      • "terms": "0.0100% per 4 hours",
      • "rollovertm": "1616672637",
      • "misc": "",
      • "oflags": ""
      }
    }
}

Get Ledgers Info

Retrieve information about ledger entries. 50 results are returned at a time, the most recent by default.

Note on Staking/Earn assets: We have begun to migrate assets from our legacy Staking system over to a new Earn system. As such, the following assets may appear in your balances and ledger. Please see our Support article for more details.

  • .B, which represents balances in new yield-bearing products, similar to .S (staked) and .M (opt-in rewards) balances
  • .F, which represents balances earning automatically in Kraken Rewards

API Key Permissions Required: Data - Query ledger entries

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
string
Default: "all"

Filter output by asset or comma delimited list of assets

aclass
string
Default: "currency"

Filter output by asset class

type
string
Default: "all"
Enum: "all" "trade" "deposit" "withdrawal" "transfer" "margin" "adjustment" "rollover" "credit" "settled" "staking" "dividend" "sale" "nft_rebate"

Type of ledger to retrieve

start
integer

Starting unix timestamp or ledger ID of results (exclusive)

end
integer

Ending unix timestamp or ledger ID of results (inclusive)

ofs
integer

Result offset for pagination

without_count
boolean
Default: false

If true, does not retrieve count of ledger entries. Request can be noticeably faster for users with many ledger entries as this avoids an extra database query.

Responses

Response Schema: application/json
object (LedgersInfo)

Ledgers Info

error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/Ledgers" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "ledger": {
      • "L4UESK-KG3EQ-UFO4T5": {
        },
      • "LMKZCZ-Z3GVL-CXKK4H": {
        }
      },
    • "count": 2
    }
}

Query Ledgers

Retrieve information about specific ledger entries.

Note on Staking/Earn assets: We have begun to migrate assets from our legacy Staking system over to a new Earn system. As such, the following assets may appear in your balances and ledger. Please see our Support article for more details.

  • .B, which represents balances in new yield-bearing products, similar to .S (staked) and .M (opt-in rewards) balances
  • .F, which represents balances earning automatically in Kraken Rewards

API Key Permissions Required: Data - Query ledger entries

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

id
required
string

Comma delimited list of ledger IDs to query info about (20 maximum)

trades
boolean
Default: false

Whether or not to include trades related to position in output

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/QueryLedgers" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>&id=LGBRJU-SQZ4L-5HLS3C,L3S26P-BHIOV-TTWYYI"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "L4UESK-KG3EQ-UFO4T5": {
      • "refid": "TJKLXF-PGMUI-4NTLXU",
      • "time": 1688464484.1787,
      • "type": "trade",
      • "subtype": "",
      • "aclass": "currency",
      • "asset": "ZGBP",
      • "amount": "-24.5000",
      • "fee": "0.0490",
      • "balance": "459567.9171"
      }
    }
}

Get Trade Volume

Returns 30 day USD trading volume and resulting fee schedule for any asset pair(s) provided. Fees will not be included if pair is not specified as Kraken fees differ by asset pair. Note: If an asset pair is on a maker/taker fee schedule, the taker side is given in fees and maker side in fees_maker. For pairs not on maker/taker, they will only be given in fees.

API Key Permissions Required: Funds permissions - Query

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

pair
string

Comma delimited list of asset pairs to get fee info on (optional, but required if any fee info is desired)

Responses

Response Schema: application/json
object (TradeVolume)

Trade Volume

error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/TradeVolume" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>&pair=XETCXETH"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "currency": "ZUSD",
    • "volume": "200709587.4223",
    • "fees": {
      • "XXBTZUSD": {
        }
      },
    • "fees_maker": {
      • "XXBTZUSD": {
        }
      }
    }
}

Request Export Report

Request export of trades or ledgers.

API Key Permissions Required: Data - Export data

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

report
required
string
Enum: "trades" "ledgers"

Type of data to export

format
string
Default: "CSV"
Enum: "CSV" "TSV"

File format to export

description
required
string

Description for the export

fields
string
Default: "all"

Comma-delimited list of fields to include

  • trades: ordertxid, time, ordertype, price, cost, fee, vol, margin, misc, ledgers
  • ledgers: refid, time, type, aclass, asset, amount, fee, balance
starttm
integer

UNIX timestamp for report start time (default 1st of the current month)

endtm
integer

UNIX timestamp for report end time (default now)

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

import time
import os
import requests

# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
api_key = os.environ['API_KEY_KRAKEN']
api_sec = os.environ['API_SEC_KRAKEN']

# Attaches auth headers and returns results of a POST request
def kraken_request(uri_path, data, api_key, api_sec):
    headers = {}
    headers['API-Key'] = api_key
    # get_kraken_signature() as defined in the 'Authentication' section
    headers['API-Sign'] = get_kraken_signature(uri_path, data, api_sec)
    req = requests.post((api_url + uri_path), headers=headers, data=data)
    return req

# Construct the request and print the result
resp = kraken_request('/0/private/AddExport', {
    "nonce": str(int(1000*time.time())),
    "description":"my_trades_1",
    "format":"CSV",
    "report":"trades"
}, api_key, api_sec)

print(resp.json())

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "id": "TCJA"
    }
}

Get Export Report Status

Get status of requested data exports.

API Key Permissions Required: Data - Export data

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

report
required
string
Enum: "trades" "ledgers"

Type of reports to inquire about

Responses

Response Schema: application/json
Array of objects
error
Array of strings (error)

Request samples

import time
import os
import requests

# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
api_key = os.environ['API_KEY_KRAKEN']
api_sec = os.environ['API_SEC_KRAKEN']

# Attaches auth headers and returns results of a POST request
def kraken_request(uri_path, data, api_key, api_sec):
    headers = {}
    headers['API-Key'] = api_key
    # get_kraken_signature() as defined in the 'Authentication' section
    headers['API-Sign'] = get_kraken_signature(uri_path, data, api_sec)
    req = requests.post((api_url + uri_path), headers=headers, data=data)
    return req

# Construct the request and print the result
resp = kraken_request('/0/private/ExportStatus', {
    "nonce": str(int(1000*time.time())),
    "report":"trades"
}, api_key, api_sec)

print(resp.json())

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": [
    • {
      • "id": "VSKC",
      • "descr": "my_trades_1",
      • "format": "CSV",
      • "report": "trades",
      • "subtype": "all",
      • "status": "Processed",
      • "flags": "0",
      • "fields": "all",
      • "createdtm": "1688669085",
      • "expiretm": "1688878685",
      • "starttm": "1688669093",
      • "completedtm": "1688669093",
      • "datastarttm": "1683556800",
      • "dataendtm": "1688669085",
      • "aclass": "forex",
      • "asset": "all"
      },
    • {
      • "id": "TCJA",
      • "descr": "my_trades_1",
      • "format": "CSV",
      • "report": "trades",
      • "subtype": "all",
      • "status": "Processed",
      • "flags": "0",
      • "fields": "all",
      • "createdtm": "1688363637",
      • "expiretm": "1688573237",
      • "starttm": "1688363664",
      • "completedtm": "1688363664",
      • "datastarttm": "1683235200",
      • "dataendtm": "1688363637",
      • "aclass": "forex",
      • "asset": "all"
      }
    ]
}

Retrieve Data Export

Retrieve a processed data export

API Key Permissions Required: Data - Export data

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

id
required
string

Report ID to retrieve

Responses

Response Schema: application/octet-stream
report
string <binary>

Binary zip archive containing the report

Request samples

import time
import os
import requests

# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
api_key = os.environ['API_KEY_KRAKEN']
api_sec = os.environ['API_SEC_KRAKEN']

# Attaches auth headers and returns results of a POST request
def kraken_request(uri_path, data, api_key, api_sec):
    headers = {}
    headers['API-Key'] = api_key
    # get_kraken_signature() as defined in the 'Authentication' section
    headers['API-Sign'] = get_kraken_signature(uri_path, data, api_sec)
    req = requests.post((api_url + uri_path), headers=headers, data=data)
    return req

# Construct the request and print the result
resp = kraken_request('/0/private/RetrieveExport', {
    "nonce": str(int(1000*time.time())),
    "id":"TCJA"
}, api_key, api_sec)

# Write export to a new file 'myexport.zip'
target_path = 'myexport.zip'
handle = open(target_path, "wb")
for chunk in resp.iter_content(chunk_size=512):
    if chunk:  # filter out keep-alive new chunks
        handle.write(chunk)
handle.close()

Delete Export Report

Delete exported trades/ledgers report

API Key Permissions Required: Data - Export data

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

id
required
string

ID of report to delete or cancel

type
required
string
Enum: "cancel" "delete"

delete can only be used for reports that have already been processed. Use cancel for queued or processing reports.

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

import time
import os
import requests

# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
api_key = os.environ['API_KEY_KRAKEN']
api_sec = os.environ['API_SEC_KRAKEN']

# Attaches auth headers and returns results of a POST request
def kraken_request(uri_path, data, api_key, api_sec):
    headers = {}
    headers['API-Key'] = api_key
    # get_kraken_signature() as defined in the 'Authentication' section
    headers['API-Sign'] = get_kraken_signature(uri_path, data, api_sec)
    req = requests.post((api_url + uri_path), headers=headers, data=data)
    return req

# Construct the request and print the result
resp = kraken_request('/0/private/RemoveExport', {
    "nonce": str(int(1000*time.time())),
    "id":"TCJA",
    "type":"delete"
}, api_key, api_sec)

print(resp.json())

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "delete": true
    }
}

Spot Trading

Add Order

Place a new order.

Note: See the AssetPairs endpoint for details on the available trading pairs, their price and quantity precisions, order minimums, available leverage, etc.

API Key Permissions Required: Orders and trades - Create & modify orders

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

userref
integer <int32>

User reference id

userref is an optional user-specified integer id that can be associated with any number of orders. Many clients choose a userref corresponding to a unique integer id generated by their systems (e.g. a timestamp). However, because we don't enforce uniqueness on our side, it can also be used to easily group orders by pair, side, strategy, etc. This allows clients to more readily cancel or query information about orders in a particular group, with fewer API calls by using userref instead of our txid, where supported.

ordertype
required
string (ordertype)
Enum: "market" "limit" "stop-loss" "take-profit" "stop-loss-limit" "take-profit-limit" "trailing-stop" "trailing-stop-limit" "settle-position"

Order type

type
required
string
Enum: "buy" "sell"

Order direction (buy/sell)

volume
required
string

Order quantity in terms of the base asset

Note: Volume can be specified as 0 for closing margin orders to automatically fill the requisite quantity.

displayvol
string

Used to create an iceberg order, this is the visible order quantity in terms of the base asset. The rest of the order will be hidden, although the full volume can be filled at any time by any order of that size or larger that matches in the order book. displayvol can only be used with the limit order type, must be greater than 0, and less than volume.

pair
required
string

Asset pair id or altname

price
string

Price:

  • Limit price for limit orders
  • Trigger price for stop-loss, stop-loss-limit, take-profit, take-profit-limit, trailing-stop and trailing-stop-limit orders

Notes:

  • Relative Prices: Either price or price2 can be preceded by +, -, or # to specify the order price as an offset relative to the last traded price. + adds the amount to, and - subtracts the amount from the last traded price. # will either add or subtract the amount to the last traded price, depending on the direction and order type used. Prices can also be suffixed with a % to signify the relative amount as a percentage, rather than an absolute price difference.
  • Trailing Stops: Must use a relative price for this field, namely the + prefix, from which the direction will be automatic based on if the original order is a buy or sell (no need to use - or #). The % suffix also works for these order types to use a relative percentage price.
price2
string

Secondary Price:

  • Limit price for stop-loss-limit, take-profit-limit and trailing-stop-limit orders Note:
  • Trailing Stops: Must use a relative price for this field, namely one of the + or - prefixes. This will provide the offset from the trigger price to the limit price, i.e. +0 would set the limit price equal to the trigger price. The % suffix also works for this field to use a relative percentage limit price.
trigger
string
Default: "last"
Enum: "index" "last"

Price signal used to trigger stop-loss, stop-loss-limit, take-profit, take-profit-limit, trailing-stop and trailing-stop-limit orders Notes:

  • This trigger type will also be used for any associated conditional close orders.
  • To keep triggers serviceable, the last price will be used as fallback reference price during connectivity issues with external index feeds.
leverage
string

Amount of leverage desired (default: none)

reduce_only
boolean
Default: false

If true, order will only reduce a currently open position, not increase it or open a new position.

stptype
string
Default: "cancel-newest"
Enum: "cancel-newest" "cancel-oldest" "cancel-both"

Self trade prevention behavior definition:

  • cancel-newest - if self trade is triggered, arriving order will be canceled
  • cancel-oldest - if self trade is triggered, resting order will be canceled
  • cancel-both - if self trade is triggered, both arriving and resting orders will be canceled
oflags
string (oflags)

Comma delimited list of order flags

  • post post-only order (available when ordertype = limit)
  • fcib prefer fee in base currency (default if selling)
  • fciq prefer fee in quote currency (default if buying, mutually exclusive with fcib)
  • nompp disable market price protection for market orders
  • viqc order volume expressed in quote currency. This is supported only for market orders.
timeinforce
string
Default: "GTC"
Enum: "GTC" "IOC" "GTD"

Time-in-force of the order to specify how long it should remain in the order book before being cancelled. GTC (Good-'til-cancelled) is default if the parameter is omitted. IOC (immediate-or-cancel) will immediately execute the amount possible and cancel any remaining balance rather than resting in the book. GTD (good-'til-date), if specified, must coincide with a desired expiretm.

starttm
string

Scheduled start time, can be specified as an absolute timestamp or as a number of seconds in the future:

  • 0 now (default)
  • <n> = unix timestamp of start time
  • +<n> = schedule start time <n> seconds from now
    • Note that URL encoding of the + character changes it to a space, so please use %2b followed by the number of seconds instead of +
expiretm
string

Expiration time, also can be specified as an absolute timestamp or as a number of seconds in the future:

  • 0 no expiration (default)
  • <n> = unix timestamp of expiration time
  • +<n> = expire <n> seconds from now, minimum 5 seconds
    • Note that URL encoding of the + character changes it to a space, so please use %2b followed by the number of seconds instead of +
close[ordertype]
string
Enum: "limit" "stop-loss" "take-profit" "stop-loss-limit" "take-profit-limit" "trailing-stop" "trailing-stop-limit"

Conditional close order type

Note: Conditional close orders are triggered by execution of the primary order in the same quantity and opposite direction, but once triggered are independent orders that may reduce or increase net position

close[price]
string

Conditional close order price

close[price2]
string

Conditional close order price2

deadline
string

RFC3339 timestamp (e.g. 2021-04-01T00:18:45Z) after which the matching engine should reject the new order request, in presence of latency or order queueing: min now() + 2 seconds, max now() + 60 seconds.

validate
boolean
Default: false

Validate inputs only. Do not submit order.

Responses

Response Schema: application/json
object (OrderAdded)
error
Array of strings (error) [ items ]

Request samples

// buy 2.1234 XBTUSD @ limit $45,000.1
// with 2:1 leverage, with a follow up stop loss

curl -X "POST" "https://api.kraken.com/0/private/AddOrder" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>"
     --data-urlencode "pair=XXBTZUSD" \
     --data-urlencode "type=buy" \
     --data-urlencode "ordertype=limit" \
     --data-urlencode "price=45000.1" \
     --data-urlencode "volume=2.1234" \
     --data-urlencode "leverage=2:1" \
     --data-urlencode "close[ordertype]=stop-loss-limit" \
     --data-urlencode "close[price]=38000" \
     --data-urlencode "close[price2]=36000"

Response samples

Content type
application/json
Example
{
  • "error": [ ],
  • "result": {
    • "descr": {
      • "order": "buy 1.25000000 XBTUSD @ limit 27500.0"
      },
    • "txid": [
      • "OU22CG-KLAF2-FWUDD7"
      ]
    }
}

Add Order Batch

Send an array of orders (max: 15). Any orders rejected due to order validations, will be dropped and the rest of the batch is processed. All orders in batch should be limited to a single pair. The order of returned txid's in the response array is the same as the order of the order list sent in request.

Note: See the AssetPairs endpoint for details on the available trading pairs, their price and quantity precisions, order minimums, available leverage, etc.

API Key Permissions Required: Orders and trades - Create & modify orders

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

required
Array of objects
pair
required
string

Asset pair id or altname

deadline
string

RFC3339 timestamp (e.g. 2021-04-01T00:18:45Z) after which the matching engine should reject the new order request, in presence of latency or order queueing. min now() + 2 seconds, max now() + 60 seconds.

validate
boolean
Default: false

Validate inputs only. Do not submit order.

Responses

Response Schema: application/json
object (Result)
error
Array of strings (error) [ items ]

Request samples

// Send buy and sell BTC/USD 


curl -X "POST" "https://api.kraken.com/0/private/AddOrderBatch" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/json' \
     {
       "deadline": "2022-05-24T14:15:22Z",
       "nonce": "<YOUR-NOUNCE>",
       "orders": [
         {
           "close": {"ordertype": "stop-loss-limit",
                     "price": "37000",
                     "price2": "36000"},
           "ordertype": "limit",
           "price": "40000",
           "price2": "string",
           "timeinforce": "GTC",
           "type": "buy",
           "userref": "345",
           "volume": "1.2"
          },
          {
           "ordertype": "limit",
           "price": "42000",
           "starttm": "string",
           "timeinforce": "GTC",
           "type": "sell",
           "userref": "123",
           "volume": "1.2"
        }
       ],
      
       "pair": "BTC/USD",
       "validate": "false"
      }

Response samples

Content type
application/json
Example
{
  • "error": [ ],
  • "result": {
    • "orders": [
      • {
        },
      • {
        }
      ]
    }
}

Edit Order

Edit volume and price on open orders. Uneditable orders include triggered stop/profit orders, orders with conditional close terms attached, those already cancelled or filled, and those where the executed volume is greater than the newly supplied volume. post-only flag is not retained from original order after successful edit. post-only needs to be explicitly set on edit request.

Note: See the AssetPairs endpoint for details on the available trading pairs, their price and quantity precisions, order minimums, available leverage, etc.

API Key Permissions Required: Orders and trades - Create & modify orders

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

userref
integer <int32>

User reference id

userref is an optional user-specified integer id associated with edit request.

Note: userref from parent order will not be retained on the new order after edit.

required
string (string) or integer (integer)

Original Order ID or User Reference Id (userref) which is user-specified integer id used with the original order. If userref is not unique and was used with multiple order, edit request is denied with an error.

volume
string

Order quantity in terms of the base asset.

displayvol
string

Used to edit an iceberg order, this is the visible order quantity in terms of the base asset. The rest of the order will be hidden, although the full volume can be filled at any time by any order of that size or larger that matches in the order book. displayvol can only be used with the limit order type, must be greater than 0, and less than volume.

pair
required
string

Asset pair id or altname

price
string

Price:

  • Limit price for limit orders
  • Trigger price for stop-loss, stop-loss-limit, take-profit, take-profit-limit, trailing-stop and trailing-stop-limit orders

Notes:

  • Relative Prices: Either price or price2 can be preceded by +, -, or # to specify the order price as an offset relative to the last traded price. + adds the amount to, and - subtracts the amount from the last traded price. # will either add or subtract the amount to the last traded price, depending on the direction and order type used. Prices can also be suffixed with a % to signify the relative amount as a percentage, rather than an absolute price difference.
  • Trailing Stops: Must use a relative price for this field, namely the + prefix, from which the direction will be automatic based on if the original order is a buy or sell (no need to use - or #). The % suffix also works for these order types to use a relative percentage price.
price2
string

Secondary Price:

  • Limit price for stop-loss-limit, take-profit-limit and trailing-stop-limit orders Note:
  • Trailing Stops: Must use a relative price for this field, namely one of the + or - prefixes. This will provide the offset from the trigger price to the limit price, i.e. +0 would set the limit price equal to the trigger price. The % suffix also works for this field to use a relative percentage limit price.
oflags
any

Comma delimited list of order flags. Only these flags can be changed: - post post-only order (available when ordertype = limit). All the flags from the parent order are retained except post-only. post-only needs to be explicitly mentioned on edit request.

deadline
string

RFC3339 timestamp (e.g. 2021-04-01T00:18:45Z) after which the matching engine should reject the new order request, in presence of latency or order queueing. min now() + 2 seconds, max now() + 60 seconds.

cancel_response
boolean

Used to interpret if client wants to receive pending replace, before the order is completely replaced

validate
boolean
Default: false

Validate inputs only. Do not submit order.

Responses

Response Schema: application/json
object (OrderEdited)
error
Array of strings (error) [ items ]

Request samples

curl -X "POST" "https://api.kraken.com/0/private/EditOrder" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>"
     --data-urlencode "pair=XXBTZUSD" \
     --data-urlencode "txid=OHYO67-6LP66-HMQ437" \
     --data-urlencode "ordertype=limit" \
     --data-urlencode "price=45000.1" \
    --data-urlencode "price2=46000.1" \
     --data-urlencode "volume=2.1234" \

Response samples

Content type
application/json
Example
{
  • "error": [ ],
  • "result": {
    • "descr": {
      • "order": "buy 1.25000000 XBTUSD @ limit 27500.0"
      },
    • "txid": "OU22CG-KLAF2-FWUDD7"
    }
}

Cancel Order

Cancel a particular open order (or set of open orders) by txid or userref

API Key Permissions Required: Orders and trades - Create & modify orders or Orders and trades - Cancel & close orders

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

required
string (string) or integer (integer)

Open order transaction ID (txid) or user reference (userref)

Responses

Response Schema: application/json
object (OrderCancelled)
error
Array of strings (error) [ items ]

Request samples

curl -X "POST" "https://api.kraken.com/0/private/CancelOrder" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>"
     --data-urlencode "txid=OYVGEW-VYV5B-UUEXSK"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "count": 1
    }
}

Cancel All Orders

Cancel all open orders

API Key Permissions Required: Orders and trades - Create & modify orders or Orders and trades - Cancel & close orders

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

Responses

Response Schema: application/json
object (OrderCancelled)
error
Array of strings (error) [ items ]

Request samples

curl -X "POST" "https://api.kraken.com/0/private/CancelAll" \
    -H 'API-Key: <YOUR-API-KEY>' \
    -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
    -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
    --data-urlencode "nonce=<YOUR-NONCE>"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "count": 4
    }
}

Cancel All Orders After X

CancelAllOrdersAfter provides a "Dead Man's Switch" mechanism to protect the client from network malfunction, extreme latency or unexpected matching engine downtime. The client can send a request with a timeout (in seconds), that will start a countdown timer which will cancel all client orders when the timer expires. The client has to keep sending new requests to push back the trigger time, or deactivate the mechanism by specifying a timeout of 0. If the timer expires, all orders are cancelled and then the timer remains disabled until the client provides a new (non-zero) timeout.

The recommended use is to make a call every 15 to 30 seconds, providing a timeout of 60 seconds. This allows the client to keep the orders in place in case of a brief disconnection or transient delay, while keeping them safe in case of a network breakdown. It is also recommended to disable the timer ahead of regularly scheduled trading engine maintenance (if the timer is enabled, all orders will be cancelled when the trading engine comes back from downtime - planned or otherwise).

API Key Permissions Required: Orders and trades - Create & modify orders or Orders and trades - Cancel & close orders

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

timeout
required
integer

Duration (in seconds) to set/extend the timer, should be less than 86400 seconds

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/CancelAllOrdersAfter" \
    -H 'API-Key: <YOUR-API-KEY>' \
    -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
    -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
    --data-urlencode "nonce=<YOUR-NONCE>" \
    --data-urlencode "timeout=60"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "currentTime": "2023-03-24T17:41:56Z",
    • "triggerTime": "2023-03-24T17:42:56Z"
    }
}

Cancel Order Batch

Cancel multiple open orders by txid or userref (maximum 50 total unique IDs/references)

API Key Permissions Required: Orders and trades - Create & modify orders or Orders and trades - Cancel & close orders

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

required
Array of objects

Responses

Request samples

curl -X "POST" "https://api.kraken.com/0/private/CancelOrderBatch" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/json' \ 
      {
      "nonce": "string",
      "orders": ["OG5V2Y-RYKVL-DT3V3B","OP5V2Y-RYKVL-ET3V3B"],
      }

      

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "count": 2
    }
}

NFT Trading

createAuction

Create NFT auction. Creates a new auction for a user owned NFT in Kraken's custody. This method accepts the auction details. In the response, the method returns the identifier of the auction.

Authorizations:
API-Key
Request Body schema: application/x-www-form-urlencoded
auction_currency
required
string

Auction currency code

required
object

Auction parameters

auction_type
required
string
Enum: "ascending" "descending" "fixed"

Auction type

nft_id
required
Array of strings

Array of NFT ids to put in auction

nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

offer_id
string or null

Optional offer id linked to the auction

otp
string or null
start_time
integer or null <uint32> >= 0

Optional unix time (in seconds) defining the start time of the auction

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl -X "POST" "https://api.kraken.com/0/private/NftCreateAuction" \
              -H 'API-Key: <YOUR-API-KEY>' \
              -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
              -H 'Content-Type: application/json' \
              {
                "nonce": <YOUR-NONCE>,
                "auction_currency": "ETH",
                "nft_id": ["NT4EFBO-OWGI5-QLO7AG"],
                "auction_type": "fixed",
                "auction_params": {
                "allow_offers": true,
                  "ask_price": 10
                }
              }

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "auction_id": "AT2POJ-4CH3O-4TH6JH"
    }
}

modifyAuction

Modify NFT auction. Modifies an existing NFT auction. This method accepts the auction identifier and the new details. In the response, the method returns the identifier of the auction.

Authorizations:
API-Key
Request Body schema: application/x-www-form-urlencoded
string or integer or number or (object or null)

Only for Fixed price auction type New auction ask price set by the seller

auction_id
required
string

Auction id

nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

otp
string or null
string or integer or number or (object or null)

Only for Descending auction type New auction reserve price, minimum price at which the item can be sold

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl -X "POST" "https://api.kraken.com/0/private/NftModifyAuction" \
              -H 'API-Key: <YOUR-API-KEY>' \
              -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
              -H 'Content-Type: application/json' \
              {
                "nonce": <YOUR-NONCE>,
                "auction_id": "AT2POJ-4CH3O-4TH6JH",
                "ask_price": "0.03"
              }

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "auction_id": "AT2POJ-4CH3O-4TH6JH"
    }
}

cancelAuction

Cancel NFT auction. This method accepts an array of auction identifiers to cancel. Returns an array of statuses for the attempted cancel action.

Authorizations:
API-Key
Request Body schema: application/x-www-form-urlencoded
auction_ids
required
Array of strings

Array of auction ids to cancel

nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

otp
string or null

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl -X "POST" "https://api.kraken.com/0/private/NftCancelAuction" \
              -H 'API-Key: <YOUR-API-KEY>' \
              -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
              -H 'Content-Type: application/json' \
              {
                "auction_ids": ['AGZGTN-DQLBQ-OPBMT7']
              }

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "statuses": [
      • {
        }
      ]
    }
}

placeOffer

Place NFT offer. Creates a new offer for a specified NFT. This method accepts the offer details. In the response, the method returns the identifier of the offer.

Authorizations:
API-Key
Request Body schema: application/x-www-form-urlencoded
expire_time
integer or null <uint32> >= 0

Optional unix time (in seconds) defining the expire time of the offer

nft_id
required
Array of strings

Identifier of the NFT

nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

required
string or integer or number

Offer amount

offer_currency
required
string

Offer currency code

otp
string or null
quote_id
string or null

Optional quote id, if the offer is linked to an existing quote

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl -X "POST" "https://api.kraken.com/0/private/NftPlaceOffer" \
              -H 'API-Key: <YOUR-API-KEY>' \
              -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
              -H 'Content-Type: application/json' \
              {
                "nonce":<YOUR-NONCE>,
                "nft_id": ["NTYI3JW-MH6TV-FIHLVZ"],
                "offer_currency": "MATIC",
                "offer_amount": 11
              }

Response samples

Content type
application/json
{
  • "result": {
    • "offer_id": "ON4LK46-LJSMF-5HHO65"
    },
  • "error": [ ]
}

cancelOffer

Cancel NFT offer. This method accepts an array of offer identifiers to cancel. Returns an array of statuses for the attempted cancel action.

Authorizations:
API-Key
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

offer_ids
required
Array of strings

Array of offer ids to cancel

otp
string or null

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl -X "POST" "https://api.kraken.com/0/private/NftCancelOffer" \
              -H 'API-Key: <YOUR-API-KEY>' \
              -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
              -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
              --data-urlencode "nonce=<YOUR-NONCE>"

Response samples

Content type
application/json
{
  • "result": {
    • "statuses": [
      • {
        }
      ]
    },
  • "error": [ ]
}

counterNftOffer

Creates a counteroffer for an existing offer. This method accepts the identifier of the original offer along with a new asking price and currency. In the response, the method returns the identifier of the auction.

Authorizations:
API-Key
Request Body schema: application/x-www-form-urlencoded
required
string or integer or number

Counter offer ask price

currency
required
string

Counter offer currency

expire_time
integer or null <uint32> >= 0

Optional expiry time

nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

offer_id
required
string

Original offer id

otp
string or null

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl -X "POST" "https://api.kraken.com/0/private/NftCounterOffer" \
              -H 'API-Key: <YOUR-API-KEY>' \
              -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
              -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
              --data-urlencode "nonce=<YOUR-NONCE>&ask_price=1&currency=ETH&offer_id=ONQYPLG-OFARL-35RBGO"

Response samples

Content type
application/json
{
  • "result": {
    • "auction_id": "AYRRX3-JAJVV-IF2HHD"
    },
  • "error": [ ]
}

acceptNftOffer

Accept NFT offer. This method accepts the identifier of the offer to accept. Returns the identifier of the auction created.

Authorizations:
API-Key
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

offer_id
required
string

Offer id

otp
string or null

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl -X "POST" "https://api.kraken.com/0/private/NftAcceptOffer" \
              -H 'API-Key: <YOUR-API-KEY>' \
              -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
              -H 'Content-Type: application/json' \
              {
                "nonce": <YOUR-NONCE>,
                "offer_id": "ON65F7C-CDFOB-VSYE6D"
              }

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "auction_id": "AYXTZ3-LE64M-LGTI6D"
    }
}

getAuctionTrades

Get NFT auction trades. Returns an array of NFT trades given the requested filters.

Authorizations:
API-Key
Request Body schema: application/x-www-form-urlencoded
auction_id
Array of strings or null

Optional array of auction ids to filter

end_time
integer <uint32> >= 0
Default: 4294967295

unix time (in seconds) defining the latest trade time

nft_id
Array of strings or null

Optional array of NFT identifiers to filter

nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

otp
string or null
start_time
integer <uint32> >= 0
Default: 0

unix time (in seconds) defining the earliest trade time

Responses

Response Schema: application/json
error
required
Array of strings (error)
Array of objects or null

Request samples

curl -X "POST" "https://api.kraken.com/0/private/NftAuctionTrades" \
              -H 'API-Key: <YOUR-API-KEY>' \
              -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
              -H 'Content-Type: application/json' \
              {
                "nonce": <YOUR-NONCE>,
                "nft_id": ["NTYI3JW-MH6TV-FIHLVZ"]
              }

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": [
    • {
      • "auction_id": "AJXTPJ-22AZ4-5B72GK",
      • "trade_id": "TNUH4MT-3CUNP-GM47JM",
      • "currency": "ETH",
      • "price": "0.0100000000",
      • "volume": "1",
      • "time": 1653673317249460700,
      • "buy_user": "finish-stumble-seed",
      • "sell_user": "civil-hire-matrix",
      • "nft_ids": [
        ]
      },
    • {
      • "auction_id": "AQIPAV-WXBF4-4X4JMT",
      • "trade_id": "TNHEJSU-6G27H-T26RUT",
      • "currency": "ETH",
      • "price": "0.0100000000",
      • "volume": "1",
      • "time": 1653594621912728000,
      • "buy_user": "choose-math-month",
      • "sell_user": "civil-hire-matrix",
      • "nft_ids": [
        ]
      }
    ]
}

getUserOffers

Get NFT user offers. Gets the offers placed by the requesting user or received to owned NFTs.

Authorizations:
API-Key
Request Body schema: application/x-www-form-urlencoded
chain
Array of strings or null

Optional chain id filter

collection
Array of strings or null

Optional collection id filter

count
integer or null <uint32> >= 0

Offers to return per request

end_time
integer or null <uint32> >= 0

unix time (in seconds) defining the latest offer time. Set to 0 to requests latest as possible.

exclude_quotes
boolean or null

Exclude offers linked to a quote. That excludes any offer initiated by Market Maker.

nft_id
string or null

Optional nft id filter

nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

otp
string or null
pos
required
integer <uint32> >= 0

Paging offset

scope
required
string
Enum: "placed" "received"

Offer scope, Placed or Received

sort
required
string
Enum: "desc" "asc"

Sort method

start_time
integer or null <uint32> >= 0

unix time (in seconds) defining the earliest offer time

status
string or null
Enum: "open" "closed" "expired"

Optional offer status filter

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl -X "POST" "https://api.kraken.com/0/private/NftUserOffers" \
              -H 'API-Key: <YOUR-API-KEY>' \
              -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
              -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
              --data-urlencode "nonce=<YOUR-NONCE>"

Response samples

Content type
application/json
{}

getNftWallet

Returns a list of NFTs owned by the user. This includes both NFTs held in Kraken custody and NFTs from a Web3 wallet connected to the user's Kraken account. The method accepts various parameters that allow searching among NFTs, filtering them by certain attributes, and sorting.

Authorizations:
API-Key
Request Body schema: application/x-www-form-urlencoded
chain
string or null
Enum: "Ethereum" "Solana" "Polygon"

Optional blockchain identifier to filter the results.

currency
string or null

Optional fiat currency used for converting crypto prices.

custody
string or null
Enum: "Kraken" "Wallet"

Optional custody type (Kraken/Web3) to filter the results.

nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

otp
string or null
page
integer <uint16> [ 1 .. 65536 ]
Default: 1

Page number with query results starting from one

per_page
integer <uint16> [ 1 .. 1000 ]
Default: 5
price_currency
string
string or integer or number or (object or null)

An amount, either as a string, and integer, or a decimal value

string or integer or number or (object or null)

An amount, either as a string, and integer, or a decimal value

search
string or null

Optional string to search in the NFT's title/description.

sort
string or null
Enum: "RecentlyBought" "RarityRankLowToHigh" "RarityRankHighToLow"

Optional sorting parameter to order the results.

status
Array of strings or null
Enum: "BuyNow" "OnAuction" "New" "HasOffer"

Optional list of statuses to filter the results.

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl -X "POST" "https://api.kraken.com/0/private/NftWallet" \
              -H 'API-Key: <YOUR-API-KEY>' \
              -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
              -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
              --data-urlencode "nonce=<YOUR-NONCE>"

Response samples

Content type
application/json
{}

listNftTransactions

Operation ListNftTransactions returns list of NFT transactions for a specific user.

Authorizations:
API-Key
Request Body schema: application/x-www-form-urlencoded
end_time
integer or null <uint32> >= 0
nft_id
string or null

Filter by NFT id

nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

otp
string or null
page
integer <uint16> [ 1 .. 65536 ]
Default: 1

Page number with query results starting from one

per_page
integer <uint16> [ 1 .. 1000 ]
Default: 5
sort
string
Default: "desc"
Enum: "desc" "asc"
start_time
integer or null <uint32> >= 0
type
string or null
Enum: "Deposit" "Withdrawal" "Purchase" "Sale" "Claim"

Filter by transaction type

Responses

Response Schema: application/json
error
required
Array of strings (error)
object or null

Request samples

curl -X "POST" "https://api.kraken.com/0/private/NftTransactions" \
              -H 'API-Key: <YOUR-API-KEY>' \
              -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
              -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
              --data-urlencode "nonce=<YOUR-NONCE>"

Response samples

Content type
application/json
{}

Funding

Get Deposit Methods

Retrieve methods available for depositing a particular asset.

API Key Permissions Required: Funds permissions - Query and Funds permissions - Deposit

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
required
string

Asset being deposited

aclass
string
Default: "currency"

Asset class being deposited (optional)

Responses

Response Schema: application/json
Array of objects (depositMethod)
error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/DepositMethods" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>" \
     --data-urlencode "asset=XBT"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": [
    • {
      • "method": "Bitcoin",
      • "limit": false,
      • "fee": "0.0000000000",
      • "gen-address": true,
      • "minimum": "0.00010000"
      },
    • {
      • "method": "Bitcoin Lightning",
      • "limit": false,
      • "fee": "0.00000000",
      • "minimum": "0.00010000"
      }
    ]
}

Get Deposit Addresses

Retrieve (or generate a new) deposit addresses for a particular asset and method.

API Key Permissions Required: Funds permissions - Query

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
required
string

Asset being deposited

method
required
string

Name of the deposit method

new
boolean
Default: false

Whether or not to generate a new address

string (string) or integer (integer) or number (number)

Amount you wish to deposit (only required for method=Bitcoin Lightning)

Responses

Response Schema: application/json
Array of objects (depositAddress)
error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/DepositAddresses" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>" \
     --data-urlencode "asset=XBT" \
     --data-urlencode "method=Bitcoin"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": [
    • {
      • "address": "2N9fRkx5JTWXWHmXzZtvhQsufvoYRMq9ExV",
      • "expiretm": "0",
      • "new": true
      },
    • {
      • "address": "2NCpXUCEYr8ur9WXM1tAjZSem2w3aQeTcAo",
      • "expiretm": "0",
      • "new": true
      },
    • {
      • "address": "2Myd4eaAW96ojk38A2uDK4FbioCayvkEgVq",
      • "expiretm": "0"
      },
    • {
      • "address": "rLHzPsX3oXdzU2qP17kHCH2G4csZv1rAJh",
      • "expiretm": "0",
      • "new": true,
      • "tag": "1361101127"
      },
    • {
      • "address": "krakenkraken",
      • "expiretm": "0",
      • "memo": "4150096490"
      }
    ]
}

Get Status of Recent Deposits

Retrieve information about recent deposits. Results are sorted by recency, use the cursor parameter to iterate through list of deposits (page size equal to value of limit) from newest to oldest.

API Key Permissions Required: Funds permissions - Query

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
string

Filter for specific asset being deposited

aclass
string
Default: "currency"

Filter for specific asset class being deposited

method
string

Filter for specific name of deposit method

start
string

Start timestamp, deposits created strictly before will not be included in the response

end
string

End timestamp, deposits created strictly after will be not be included in the response

boolean or string
Default: false

true/false to enable/disable paginated response (boolean) or cursor for next page of results (string)

limit
integer
Default: 25

Number of results to include per page

Responses

Response Schema: application/json
deposit (object) or object
error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/DepositStatus" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>" \
     --data-urlencode "asset=XBT" \
     --data-urlencode "method=Bitcoin"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": [
    • {
      • "method": "Bitcoin",
      • "aclass": "currency",
      • "asset": "XXBT",
      • "refid": "FTQcuak-V6Za8qrWnhzTx67yYHz8Tg",
      • "txid": "6544b41b607d8b2512baf801755a3a87b6890eacdb451be8a94059fb11f0a8d9",
      • "info": "2Myd4eaAW96ojk38A2uDK4FbioCayvkEgVq",
      • "amount": "0.78125000",
      • "fee": "0.0000000000",
      • "time": 1688992722,
      • "status": "Success",
      • "status-prop": "return"
      },
    • {
      • "method": "Ether (Hex)",
      • "aclass": "currency",
      • "asset": "XETH",
      • "refid": "FTQcuak-V6Za8qrPnhsTx47yYLz8Tg",
      • "txid": "0x339c505eba389bf2c6bebb982cc30c6d82d0bd6a37521fa292890b6b180affc0",
      • "info": "0xca210f4121dc891c9154026c3ae3d1832a005048",
      • "amount": "0.1383862742",
      • "time": 1688992722,
      • "status": "Settled",
      • "status-prop": "onhold",
      • "originators": [
        ]
      }
    ]
}

Get Withdrawal Methods

Retrieve a list of withdrawal methods available for the user.

API Key Permissions Required: Funds permissions - Query and Funds permissions - Withdraw

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
string

Filter methods for specific asset

aclass
string
Default: "currency"

Filter methods for specific asset class

network
string

Filter methods for specific network

Responses

Response Schema: application/json
Array of objects (withdrawalMethods)

Withdrawal Methods

error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/WithdrawMethods" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>" \
     --data-urlencode "asset=XBT"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": [
    • {
      • "asset": "XXBT",
      • "method": "Bitcoin",
      • "network": "Bitcoin",
      • "minimum": "0.0004"
      },
    • {
      • "asset": "XXBT",
      • "method": "Bitcoin Lightning",
      • "network": "Lightning",
      • "minimum": "0.00001"
      }
    ]
}

Get Withdrawal Addresses

Retrieve a list of withdrawal addresses available for the user.

API Key Permissions Required: Funds permissions - Query and Funds permissions - Withdraw

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
string

Filter addresses for specific asset

aclass
string
Default: "currency"

Filter addresses for specific asset class

method
string

Filter addresses for specific method

key
string

Find address for by withdrawal key name, as set up on your account

verified
boolean

Filter by verification status of the withdrawal address. Withdrawal addresses successfully completing email confirmation will have a verification status of true.

Responses

Response Schema: application/json
Array of objects (withdrawalAddresses)

Withdrawal Addresses

error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/WithdrawAddresses" \
     -H 'API-Key: <YOUR-API-KEY>' \
     -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "nonce=<YOUR-NONCE>" \
     --data-urlencode "asset=XBT"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": [
    • {
      • "address": "bc1qxdsh4sdd29h6ldehz0se5c61asq8cgwyjf2y3z",
      • "asset": "XBT",
      • "method": "Bitcoin",
      • "key": "btc-wallet-1",
      • "verified": true
      }
    ]
}

Get Withdrawal Information

Retrieve fee information about potential withdrawals for a particular asset, key and amount.

API Key Permissions Required: Funds permissions - Query and Funds permissions - Withdraw

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
required
string

Asset being withdrawn

key
required
string

Withdrawal key name, as set up on your account

amount
required
string

Amount to be withdrawn

Responses

Response Schema: application/json
object (withdrawalInfo)

Withdrawal Info

error
Array of strings (error)

Request samples

import time
import os
import requests

# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
api_key = os.environ['API_KEY_KRAKEN']
api_sec = os.environ['API_SEC_KRAKEN']

# Attaches auth headers and returns results of a POST request
def kraken_request(uri_path, data, api_key, api_sec):
    headers = {}
    headers['API-Key'] = api_key
    # get_kraken_signature() as defined in the 'Authentication' section
    headers['API-Sign'] = get_kraken_signature(uri_path, data, api_sec)             
    req = requests.post((api_url + uri_path), headers=headers, data=data)
    return req

# Construct the request and print the result
resp = kraken_request('/0/private/WithdrawInfo', {
    "nonce": str(int(1000*time.time())),
    "asset": "XBT",
    "key": "btc_testnet_with1",
    "amount": 0.725
}, api_key, api_sec)

print(resp.json())

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "method": "Bitcoin",
    • "limit": "332.00956139",
    • "amount": "0.72480000",
    • "fee": "0.00020000"
    }
}

Withdraw Funds

Make a withdrawal request.

API Key Permissions Required: Funds permissions - Withdraw

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
required
string

Asset being withdrawn

key
required
string

Withdrawal key name, as set up on your account

address
string

Optional, crypto address that can be used to confirm address matches key (will return Invalid withdrawal address error if different)

amount
required
string

Amount to be withdrawn

max_fee
string

Optional, if the processed withdrawal fee is higher than max_fee, withdrawal will fail with EFunding:Max fee exceeded

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

import time
import os
import requests

# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
api_key = os.environ['API_KEY_KRAKEN']
api_sec = os.environ['API_SEC_KRAKEN']

# Attaches auth headers and returns results of a POST request
def kraken_request(uri_path, data, api_key, api_sec):
    headers = {}
    headers['API-Key'] = api_key
    # get_kraken_signature() as defined in the 'Authentication' section
    headers['API-Sign'] = get_kraken_signature(uri_path, data, api_sec)             
    req = requests.post((api_url + uri_path), headers=headers, data=data)
    return req

# Construct the request and print the result
resp = kraken_request('/0/private/Withdraw', {
    "nonce": str(int(1000*time.time())),
    "asset": "XBT",
    "key": "btc_testnet_with1",
    "address": "bc1kar0ssrr7xf3vy5l6d3lydnwkre5og2zz3f5ldq",
    "amount": 0.725
}, api_key, api_sec)

print(resp.json())

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "refid": "FTQcuak-V6Za8qrWnhzTx67yYHz8Tg"
    }
}

Get Status of Recent Withdrawals

Retrieve information about recent withdrawals. Results are sorted by recency, use the cursor parameter to iterate through list of withdrawals (page size equal to value of limit) from newest to oldest.

API Key Permissions Required: Funds permissions - Withdraw or Data - Query ledger entries

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
string

Filter for specific asset being withdrawn

aclass
string
Default: "currency"

Filter for specific asset class being withdrawn

method
string

Filter for specific name of withdrawal method

start
string

Start timestamp, withdrawals created strictly before will not be included in the response

end
string

End timestamp, withdrawals created strictly after will be not be included in the response

boolean or string

true/false to enable/disable paginated response (boolean) or cursor for next page of results (string), default false

limit
integer
Default: 500

Number of results to include per page

Responses

Response Schema: application/json
Array of objects (Withdrawal)
error
Array of strings (error)

Request samples

import time
import os
import requests

# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
api_key = os.environ['API_KEY_KRAKEN']
api_sec = os.environ['API_SEC_KRAKEN']

# Attaches auth headers and returns results of a POST request
def kraken_request(uri_path, data, api_key, api_sec):
    headers = {}
    headers['API-Key'] = api_key
    # get_kraken_signature() as defined in the 'Authentication' section
    headers['API-Sign'] = get_kraken_signature(uri_path, data, api_sec)             
    req = requests.post((api_url + uri_path), headers=headers, data=data)
    return req

# Construct the request and print the result
resp = kraken_request('/0/private/WithdrawStatus', {
    "nonce": str(int(1000*time.time()))
}, api_key, api_sec)

print(resp.json())

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": [
    • {
      • "method": "Bitcoin",
      • "aclass": "currency",
      • "asset": "XXBT",
      • "refid": "FTQcuak-V6Za8qrWnhzTx67yYHz8Tg",
      • "txid": "29323ce235cee8dae22503caba7....8ad3a506879a03b1e87992923d80428",
      • "info": "bc1qm32pq....3ewt0j37s2g",
      • "amount": "0.72485000",
      • "fee": "0.00020000",
      • "time": 1688014586,
      • "status": "Pending",
      • "key": "btc-wallet-1"
      },
    • {
      • "method": "Bitcoin",
      • "aclass": "currency",
      • "asset": "XXBT",
      • "refid": "FTQcuak-V6Za8qrPnhsTx47yYLz8Tg",
      • "txid": "29323ce212ceb2daf81255cbea8a5...ad7a626471e05e1f82929501e82934",
      • "info": "bc1qa35ls....3egf0872h3w",
      • "amount": "0.72485000",
      • "fee": "0.00020000",
      • "time": 1688015423,
      • "status": "Failure",
      • "status-prop": "canceled",
      • "key": "btc-wallet-2"
      }
    ]
}

Request Withdrawal Cancelation

Cancel a recently requested withdrawal, if it has not already been successfully processed.

API Key Permissions Required: Funds permissions - Withdraw, unless withdrawal is a WalletTransfer, then no permissions are required.

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
required
string

Asset being withdrawn

refid
required
string

Withdrawal reference ID

Responses

Response Schema: application/json
result
boolean

Whether cancellation was successful or not.

error
Array of strings (error)

Request samples

import time
import os
import requests

# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
api_key = os.environ['API_KEY_KRAKEN']
api_sec = os.environ['API_SEC_KRAKEN']

# Attaches auth headers and returns results of a POST request
def kraken_request(uri_path, data, api_key, api_sec):
    headers = {}
    headers['API-Key'] = api_key
    # get_kraken_signature() as defined in the 'Authentication' section
    headers['API-Sign'] = get_kraken_signature(uri_path, data, api_sec)
    req = requests.post((api_url + uri_path), headers=headers, data=data)
    return req

# Construct the request and print the result
resp = kraken_request('/0/private/WithdrawCancel', {
    "nonce": str(int(1000*time.time())),
    "asset": "XBT",
    "refid": "FTQcuak-V6Za8qrWnhzTx67yYHz8Tg"
}, api_key, api_sec)

print(resp.json())

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": true
}

Request Wallet Transfer

Transfer from a Kraken spot wallet to a Kraken Futures wallet. Note that a transfer in the other direction must be requested via the Kraken Futures API endpoint for withdrawals to Spot wallets.

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
required
string

Asset to transfer (asset ID or altname)

from
required
string
Value: "Spot Wallet"

Source wallet

to
required
string
Value: "Futures Wallet"

Destination wallet

amount
required
string

Amount to transfer

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

import time
import os
import requests

# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
api_key = os.environ['API_KEY_KRAKEN']
api_sec = os.environ['API_SEC_KRAKEN']

# Attaches auth headers and returns results of a POST request
def kraken_request(uri_path, data, api_key, api_sec):
    headers = {}
    headers['API-Key'] = api_key
    # get_kraken_signature() as defined in the 'Authentication' section
    headers['API-Sign'] = get_kraken_signature(uri_path, data, api_sec)
    req = requests.post((api_url + uri_path), headers=headers, data=data)
    return req

# Construct the request and print the result
resp = kraken_request('/0/private/WalletTransfer', {
    "nonce": str(int(1000*time.time())),
    "asset": "ETH",
    "amount": 0.100,
    "from":"Spot Wallet",
    "to":"Futures Wallet"
}, api_key, api_sec)

print(resp.json())

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "refid": "FTQcuak-V6Za8qrWnhzTx67yYHz8Tg"
    }
}

Subaccounts

Subaccounts are currently only available to institutional clients. Please contact your Account Manager for more details.

Create Subaccount

Create a trading subaccount.

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

username
required
string

Username for the subaccount

email
required
string

Email address for the subaccount

Responses

Response Schema: application/json
result
boolean

Whether subaccount creation was successful or not.

error
Array of strings (error)

Request samples

import time
import os
import requests

# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
api_key = os.environ['API_KEY_KRAKEN']
api_sec = os.environ['API_SEC_KRAKEN']

# Attaches auth headers and returns results of a POST request
def kraken_request(uri_path, data, api_key, api_sec):
    headers = {}
    headers['API-Key'] = api_key
    # get_kraken_signature() as defined in the 'Authentication' section
    headers['API-Sign'] = get_kraken_signature(uri_path, data, api_sec)
    req = requests.post((api_url + uri_path), headers=headers, data=data)
    return req

# Construct the request and print the result
resp = kraken_request('/0/private/CreateSubaccount', {
    "nonce": str(int(1000*time.time())),
    "username": "abc123",
    "email": "abc123@gmail.com"
}, api_key, api_sec)

print(resp.json())

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": true
}

Account Transfer

Transfer funds to and from master and subaccounts. Note: AccountTransfer must be called by the master account.

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

asset
required
string

Asset being transferred

amount
required
string

Amount of asset to transfer

from
required
string

IIBAN of the source account

to
required
string

IIBAN of the destination account

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

import time
import os
import requests

# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
api_key = os.environ['API_KEY_KRAKEN']
api_sec = os.environ['API_SEC_KRAKEN']

# Attaches auth headers and returns results of a POST request
def kraken_request(uri_path, data, api_key, api_sec):
    headers = {}
    headers['API-Key'] = api_key
    # get_kraken_signature() as defined in the 'Authentication' section
    headers['API-Sign'] = get_kraken_signature(uri_path, data, api_sec)
    req = requests.post((api_url + uri_path), headers=headers, data=data)
    return req

# Construct the request and print the result
resp = kraken_request('/0/private/AccountTransfer', {
    "nonce": str(int(1000*time.time())),
    "asset": "XBT",
    "amount": 1.0,
    "from": "ABCD 1234 EFGH 5678"
    "to": "IJKL 0987 MNOP 6543"
}, api_key, api_sec)

print(resp.json())

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "transfer_id": "TOH3AS2-LPCWR8-JDQGEU",
    • "status": "complete"
    }
}

Earn

The earn API allows interacting with all of Kraken's yield generating products. It replaces the old /staking part of the API.

The different available earn products are represented by earn strategies. This corresponds to the legacy Staking/Assets. Stake/Unstake are replaced by Allocate/Deallocate.

Overview of the available endpoints under /Earn:

  • Strategies - list all earn strategies for which you are eligible or have a balance.
  • Allocations - lists the balance in your earn account for each strategy. Requires the Query Funds API key permission.
  • Allocate/Deallocate - allocate/deallocate to an earn strategy through an async operation. Requires the Earn Funds API key permission.
  • AllocateStatus/DeallocateStatus - verifies the state of the last allocation/deallocation. Requires the Earn Funds or Query Funds API key permission.

Example usage:

Determine which funds are earning rewards:

  1. Call Strategies to obtain information about the relevant strategy. The lock_type field shows whether bonding/unbonding funds are earning yield. The relevant fields are bonding_rewards/unbonding_rewards.
  2. Call Allocations for the relevant strategy. From the previous step, for strategies where bonding/unbonding does not earn yield, substract these balances from amount_allocated.total to determine which balances are currently earning.

Get allocatable balance:

Call /0/private/BalanceEx, subtract hold_trading amount. Remaining balance is available for allocation to a strategy.

Geo restrictions:

Some earn strategies are not available in all geographic regions. Strategies will return only strategies available to the caller.

Allocate Earn Funds

Allocate funds to the Strategy.

Requires the Earn Funds API key permission. The amount must always be defined.

This method is asynchronous. A couple of preflight checks are performed synchronously on behalf of the method before it is dispatched further. The client is required to poll the result using the /0/private/Earn/AllocateStatus endpoint.

There can be only one (de)allocation request in progress for given user and strategy at any time. While the operation is in progress:

  1. pending attribute in /Earn/Allocations response for the strategy indicates that funds are being allocated,
  2. pending attribute in /Earn/AllocateStatus response will be true.

Following specific errors within Earnings class can be returned by this method:

  • Minimum allocation: EEarnings:Below min:(De)allocation operation amount less than minimum
  • Allocation in progress: EEarnings:Busy:Another (de)allocation for the same strategy is in progress
  • Service temporarily unavailable: EEarnings:Busy. Try again in a few minutes.
  • User tier verification: EEarnings:Permission denied:The user's tier is not high enough
  • Strategy not found: EGeneral:Invalid arguments:Invalid strategy ID
Authorizations:
API-Key
Request Body schema: application/json
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

amount
required
string

The amount to allocate.

strategy_id
required
string

A unique identifier of the chosen earn strategy, as returned from /0/private/Earn/Strategies.

Responses

Response Schema: application/json
error
Array of strings (error)
result
boolean or null

Will return true when the operation is successful, null when an error occurred.

Request samples

Content type
application/json
{
  • "amount": "4.3",
  • "nonce": 30295839,
  • "strategy_id": "ESRFUO3-Q62XD-WIOIL7"
}

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": true
}

Deallocate Earn Funds

Deallocate funds from a strategy.

Requires the Earn Funds API key permission. The amount must always be defined.

This method is asynchronous. A couple of preflight checks are performed synchronously on behalf of the method before it is dispatched further. If the method returns HTTP 202 code, the client is required to poll the result using the /Earn/DeallocateStatus endpoint.

There can be only one (de)allocation request in progress for given user and strategy. While the operation is in progress:

  1. pending attribute in Allocations response for the strategy will hold the amount that is being deallocated (negative amount)
  2. pending attribute in DeallocateStatus response will be true.

Following specific errors within Earnings class can be returned by this method:

  • Minimum allocation: EEarnings:Below min:(De)allocation operation amount less than minimum allowed
  • Allocation in progress: EEarnings:Busy:Another (de)allocation for the same strategy is in progress
  • Strategy not found: EGeneral:Invalid arguments:Invalid strategy ID
Authorizations:
API-Key
Request Body schema: application/json
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

amount
required
string

The amount to deallocate. This field is required.

strategy_id
required
string

A unique identifier per earn strategy.

Responses

Response Schema: application/json
error
Array of strings (error)
result
boolean or null

Will return true when the operation is successful, null when an error occurred.

Request samples

Content type
application/json
{
  • "amount": "4.3",
  • "nonce": 30295839,
  • "strategy_id": "ESRFUO3-Q62XD-WIOIL7"
}

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": true
}

Get Allocation Status

Get the status of the last allocation request.

Requires either the Earn Funds or Query Funds API key permission.

(De)allocation operations are asynchronous and this endpoint allows client to retrieve the status of the last dispatched operation. There can be only one (de)allocation request in progress for given user and strategy.

The pending attribute in the response indicates if the previously dispatched operation is still in progress (true) or has successfully completed (false). If the dispatched request failed with an error, then HTTP error is returned to the client as if it belonged to the original request.

Following specific errors within Earnings class can be returned by this method:

  • Insufficient funds: EEarnings:Insufficient funds:Insufficient funds to complete the (de)allocation request
  • User cap exceeded: EEarnings:Above max:The allocation exceeds user limit for the strategy
  • Total cap exceeded: EEarnings:Above max:The allocation exceeds the total strategy limit
  • Minimum allocation: EEarnings:Below min:(De)allocation operation amount less than minimum
Authorizations:
API-Key
Request Body schema: application/json
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

strategy_id
required
string

ID of the earn strategy, call Earn/Strategies to list availble strategies

Responses

Response Schema: application/json
error
Array of strings (error)
object or null

Status of async earn operation

Request samples

Content type
application/json
{
  • "nonce": 30295839,
  • "strategy_id": "ESRFUO3-Q62XD-WIOIL7"
}

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "pending": false
    }
}

Get Deallocation Status

Get the status of the last deallocation request.

Requires either the Earn Funds or Query Funds API key permission.

(De)allocation operations are asynchronous and this endpoint allows client to retrieve the status of the last dispatched operation. There can be only one (de)allocation request in progress for given user and strategy.

The pending attribute in the response indicates if the previously dispatched operation is still in progress (true) or has successfully completed (false). If the dispatched request failed with an error, then HTTP error is returned to the client as if it belonged to the original request.

Following specific errors within Earnings class can be returned by this method:

  • Insufficient funds: EEarnings:Insufficient funds:Insufficient funds to complete the (de)allocation request
  • Minimum allocation: EEarnings:Below min:(De)allocation operation amount less than minimum
Authorizations:
API-Key
Request Body schema: application/json
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

strategy_id
required
string

ID of the earn strategy, call Earn/Strategies to list availble strategies

Responses

Response Schema: application/json
error
Array of strings (error)
object or null

Status of async earn operation

Request samples

Content type
application/json
{
  • "nonce": 30295839,
  • "strategy_id": "ESRFUO3-Q62XD-WIOIL7"
}

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "pending": false
    }
}

List Earn Strategies

List earn strategies along with their parameters.

Requires a valid API key but not specific permission is required.

Returns only strategies that are available to the user based on geographic region.

When the user does not meet the tier restriction, can_allocate will be false and allocation_restriction_info indicates Tier as the restriction reason. Earn products generally require Intermediate tier. Get your account verified to access earn.

Paging isn't yet implemented, so it the endpoint always returns all data in the first page.

Authorizations:
API-Key
Request Body schema: application/json
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

ascending
boolean or null

true to sort ascending, false (the default) for descending.

asset
string or null

Filter strategies by asset name

cursor
string or null

None to start at beginning/end, otherwise next page ID

limit
integer or null <uint16>

How many items to return per page. Note that the limit may be cap'd to lower value in the application code.

lock_type
Array of strings or null
Enum: "flex" "bonded" "timed" "instant"

Filter strategies by lock type

Responses

Response Schema: application/json
error
Array of strings (error)
object or null

Request samples

Content type
application/json
{
  • "nonce": 30295839,
  • "asset": "DOT"
}

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "next_cursor": "2",
    • "items": [
      • {
        }
      ]
    }
}

List Earn Allocations

List all allocations for the user.

Requires the Query Funds API key permission.

By default all allocations are returned, even for strategies that have been used in the past and have zero balance now. That is so that the user can see how much was earned with given strategy in the past. hide_zero_allocations parameter can be used to remove zero balance entries from the output. Paging hasn't been implemented for this method as we don't expect the result for a particular user to be overwhelmingly large.

All amounts in the output can be denominated in a currency of user's choice (the converted_asset parameter).

Information about when the next reward will be paid to the client is also provided in the output.

Allocated funds can be in up to 4 states:

  • bonding
  • allocated
  • exit_queue (ETH only)
  • unbonding

Any funds in total not in bonding/unbonding are simply allocated and earning rewards. Depending on the strategy funds in the other 3 states can also be earning rewards. Consult the output of /Earn/Strategies to know whether bonding/unbonding earn rewards. ETH in exit_queue still earns rewards.

Note that for ETH, when the funds are in the exit_queue state, the expires time given is the time when the funds will have finished unbonding, not when they go from exit queue to unbonding.

(Un)bonding time estimate can be inaccurate right after having (de)allocated the funds. Wait 1-2 minutes after (de)allocating to get an accurate result.

Authorizations:
API-Key
Request Body schema: application/json
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

ascending
boolean or null

true to sort ascending, false (the default) for descending.

converted_asset
string or null

A secondary currency to express the value of your allocations (the default is USD).

hide_zero_allocations
boolean or null

Omit entries for strategies that were used in the past but now they don't hold any allocation (the default is false)

Responses

Response Schema: application/json
error
Array of strings (error)
object or null

Page response

Request samples

Content type
application/json
{
  • "nonce": 30295839,
  • "converted_asset": "EUR",
  • "hide_zero_allocations": true
}

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "converted_asset": "USD",
    • "total_allocated": "49.2398",
    • "total_rewarded": "0.0675",
    • "next_cursor": "2",
    • "items": [
      • {
        }
      ]
    }
}

Websockets Authentication

Get Websockets Token

An authentication token must be requested via this REST API endpoint in order to connect to and authenticate with our Websockets API. The token should be used within 15 minutes of creation, but it does not expire once a successful Websockets connection and private subscription has been made and is maintained.

API Key Permissions Required: WebSocket interface - On

Authorizations:
(API-KeyAPI-Sign)
Request Body schema: application/x-www-form-urlencoded
nonce
required
integer <int32> (nonce)

Nonce used in construction of API-Sign header

Responses

Response Schema: application/json
object
error
Array of strings (error)

Request samples

curl -X "POST" "https://api.kraken.com/0/private/GetWebSocketsToken" \
    -H 'API-Key: <YOUR-API-KEY>' \
    -H 'API-Sign: <YOUR-MSG-SIGNATURE>' \
    -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
    --data-urlencode "nonce=<YOUR-NONCE>"

Response samples

Content type
application/json
{
  • "error": [ ],
  • "result": {
    • "token": "1Dwc4lzSwNWOAwkMdqhssNNFhs1ed606d1WcF3XfEMw",
    • "expires": 900
    }
}