Skip to main content
POST
/
private
/
ClosedOrders
Get Closed Orders
curl --request POST \
  --url https://api.kraken.com/0/private/ClosedOrders \
  --header 'API-Key: <api-key>' \
  --header 'API-Sign: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "nonce": 1234567,
  "trades": true,
  "cl_ord_id": "9cc788d8-9c00-4b25-94d3-26d93603948d",
  "start": 1695728276,
  "end": 1695828276,
  "closetime": "open"
}
'
{
  "error": [],
  "result": {
    "closed": {
      "O37652-RJWRT-IMO74O": {
        "refid": "None",
        "userref": 1,
        "status": "canceled",
        "reason": "User requested",
        "opentm": 1688148493.7708,
        "closetm": 1688148610.0482,
        "starttm": 0,
        "expiretm": 0,
        "descr": {
          "pair": "XBTGBP",
          "type": "buy",
          "ordertype": "stop-loss-limit",
          "price": "23667.0",
          "price2": "0",
          "leverage": "none",
          "order": "buy 0.00100000 XBTGBP @ limit 23667.0",
          "close": ""
        },
        "vol": "0.00100000",
        "vol_exec": "0.00000000",
        "cost": "0.00000",
        "fee": "0.00000",
        "price": "0.00000",
        "stopprice": "0.00000",
        "limitprice": "0.00000",
        "misc": "",
        "oflags": "fciq",
        "trigger": "index"
      },
      "O6YDQ5-LOMWU-37YKEE": {
        "refid": "None",
        "userref": 36493663,
        "status": "canceled",
        "reason": "User requested",
        "opentm": 1688148493.7708,
        "closetm": 1688148610.0477,
        "starttm": 0,
        "expiretm": 0,
        "descr": {
          "pair": "XBTEUR",
          "type": "buy",
          "ordertype": "take-profit-limit",
          "price": "27743.0",
          "price2": "0",
          "leverage": "none",
          "order": "buy 0.00100000 XBTEUR @ limit 27743.0",
          "close": ""
        },
        "vol": "0.00100000",
        "vol_exec": "0.00000000",
        "cost": "0.00000",
        "fee": "0.00000",
        "price": "0.00000",
        "stopprice": "0.00000",
        "limitprice": "0.00000",
        "misc": "",
        "oflags": "fciq",
        "trigger": "index"
      }
    },
    "count": 2
  }
}

Documentation Index

Fetch the complete documentation index at: https://kraken-sandbox.mintlify.app/llms.txt

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

Authorizations

API-Key
string
header
required

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

API-Sign
string
header
required

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

Body

application/json
nonce
integer<int64>
required

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

cl_ord_id
string

Restrict results to given client order 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
enum<string>
default:both

Which time to use to search

Available options:
open,
close,
both
consolidate_taker
boolean
default:true

Whether or not to consolidate trades by individual taker trades

without_count
boolean
default:false

Whether or not to include page count in result (true is much faster for users with many closed orders)

rebase_multiplier
enum<string> | null
default:rebased

Optional parameter for viewing xstocks data.

  • rebased: Display in terms of underlying equity.
  • base: Display in terms of SPV tokens.
Available options:
rebased,
base

Response

200 - application/json

Closed orders info retrieved.

result
ClosedOrders · object

Closed Orders

error
string[]

Kraken API error