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
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"
}
'import requests
url = "https://api.kraken.com/0/private/ClosedOrders"
payload = {
"nonce": 1234567,
"trades": True,
"cl_ord_id": "9cc788d8-9c00-4b25-94d3-26d93603948d",
"start": 1695728276,
"end": 1695828276,
"closetime": "open"
}
headers = {
"API-Key": "<api-key>",
"API-Sign": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'API-Key': '<api-key>',
'API-Sign': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
nonce: 1234567,
trades: true,
cl_ord_id: '9cc788d8-9c00-4b25-94d3-26d93603948d',
start: 1695728276,
end: 1695828276,
closetime: 'open'
})
};
fetch('https://api.kraken.com/0/private/ClosedOrders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kraken.com/0/private/ClosedOrders"
payload := strings.NewReader("{\n \"nonce\": 1234567,\n \"trades\": true,\n \"cl_ord_id\": \"9cc788d8-9c00-4b25-94d3-26d93603948d\",\n \"start\": 1695728276,\n \"end\": 1695828276,\n \"closetime\": \"open\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
req.Header.Add("API-Sign", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"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
}
}Authorizations
Body
application/json
⌘I
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"
}
'import requests
url = "https://api.kraken.com/0/private/ClosedOrders"
payload = {
"nonce": 1234567,
"trades": True,
"cl_ord_id": "9cc788d8-9c00-4b25-94d3-26d93603948d",
"start": 1695728276,
"end": 1695828276,
"closetime": "open"
}
headers = {
"API-Key": "<api-key>",
"API-Sign": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'API-Key': '<api-key>',
'API-Sign': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
nonce: 1234567,
trades: true,
cl_ord_id: '9cc788d8-9c00-4b25-94d3-26d93603948d',
start: 1695728276,
end: 1695828276,
closetime: 'open'
})
};
fetch('https://api.kraken.com/0/private/ClosedOrders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kraken.com/0/private/ClosedOrders"
payload := strings.NewReader("{\n \"nonce\": 1234567,\n \"trades\": true,\n \"cl_ord_id\": \"9cc788d8-9c00-4b25-94d3-26d93603948d\",\n \"start\": 1695728276,\n \"end\": 1695828276,\n \"closetime\": \"open\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
req.Header.Add("API-Sign", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"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
}
}