Account Data

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

post/private/ClosedOrders

Request

  • Base URL: https://api.kraken.com/0
  • URL: https://api.kraken.com/0/private/ClosedOrders
  • Auth: API key in header API-Key and API key in header API-Sign

Query parameters

account_idstring

Public wallet account ID. Omit to use the authenticated user's default wallet. See List Wallet Accounts.

Request body

nonceinteger required

Nonce used in construction of API-Sign header

tradesboolean

Whether or not to include trades related to position in output

userrefinteger

Restrict results to given user reference

cl_ord_idstring

Restrict results to given client order id

startinteger

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

endinteger

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

ofsinteger

Result offset for pagination. Deprecated, use with_cursor and cursor instead. Must be absent or 0 when with_cursor is true.

with_cursorboolean

Use cursor-based pagination instead of ofs. Each page holds up to 50 orders, and the response includes cursor.next when more orders are available.

cursorstring

Opaque pagination token from cursor.next of the previous page. Requires with_cursor.

closetime'open' | 'close' | 'both'

Which time field is used when filtering results:

  • open: Uses the opentm field only (start < opentm && opentm <= end)
  • close: Uses the closetm field only (start < closetm && closetm <= end)
  • both: Requires both times to fall within the range (start < opentm && closetm <= end)
consolidate_takerboolean

Whether or not to consolidate trades by individual taker trades

without_countboolean

If true, does not retrieve the count of closed orders (count is returned as 0, as it is when with_cursor is true). Request can be noticeably faster for users with many closed orders as this avoids an extra database query.

rebase_multiplier'rebased' | 'base' nullable

Optional parameter for viewing xStocks data.

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

Example request

{
  "nonce": 1234567,
  "trades": true,
  "cl_ord_id": "9cc788d8-9c00-4b25-94d3-26d93603948d",
  "start": 1695728276,
  "end": 1695828276,
  "closetime": "open"
}

Response

Closed orders info retrieved.

errorstring[]

Example response

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

Changes

No recorded changes to this operation across all 1 revision of this API.