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
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.
The "API-Key" header should contain your API key.
Authenticated requests should be signed with the "API-Sign" header, using a signature generated with your private key, nonce, encoded payload, and URI path.
Nonce used in construction of API-Sign header
Whether or not to include trades related to position in output
Restrict results to given user reference
Restrict results to given client order id
Starting unix timestamp or order tx ID of results (exclusive)
Ending unix timestamp or order tx ID of results (inclusive)
Result offset for pagination
Which time to use to search
open, close, both Whether or not to consolidate trades by individual taker trades
Whether or not to include page count in result (true is much faster for users with many closed orders)
Optional parameter for viewing xstocks data.
rebased: Display in terms of underlying equity.base: Display in terms of SPV tokens.rebased, base 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
}
}