Get Trades History
curl --request POST \
--url https://api.kraken.com/0/private/TradesHistory \
--header 'API-Key: <api-key>' \
--header 'API-Sign: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"nonce": 1695828490,
"type": "all",
"trades": false,
"consolidate_taker": true,
"pair": "BTC/USD",
"limit": 75
}
'import requests
url = "https://api.kraken.com/0/private/TradesHistory"
payload = {
"nonce": 1695828490,
"type": "all",
"trades": False,
"consolidate_taker": True,
"pair": "BTC/USD",
"limit": 75
}
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: 1695828490,
type: 'all',
trades: false,
consolidate_taker: true,
pair: 'BTC/USD',
limit: 75
})
};
fetch('https://api.kraken.com/0/private/TradesHistory', 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/TradesHistory"
payload := strings.NewReader("{\n \"nonce\": 1695828490,\n \"type\": \"all\",\n \"trades\": false,\n \"consolidate_taker\": true,\n \"pair\": \"BTC/USD\",\n \"limit\": 75\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": {
"trades": {
"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": 40274859,
"maker": true
},
"TCWJEG-FL4SZ-3FKGH6": {
"ordertxid": "OQCLML-BW3P3-BUCMWZ",
"postxid": "TKH2SE-M7IF5-CFI7LT",
"pair": "XXBTZUSD",
"time": 1688667769.6396,
"type": "buy",
"ordertype": "limit",
"price": "30010.00000",
"cost": "300.10000",
"fee": "0.00000",
"vol": "0.01000000",
"margin": "0.00000",
"misc": "",
"trade_id": 39482674,
"maker": true
}
}
}
}Account Data
Get Trades History
Retrieve information about trades/fills. By default, the most recent trades are returned.
- Unless otherwise stated, costs, fees, prices, and volumes are specified with the precision for the asset pair (
pair_decimalsandlot_decimals), not the individual assets’ precision (decimals).
API Key Permissions Required: Orders and trades - Query closed orders & trades
POST
/
private
/
TradesHistory
Get Trades History
curl --request POST \
--url https://api.kraken.com/0/private/TradesHistory \
--header 'API-Key: <api-key>' \
--header 'API-Sign: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"nonce": 1695828490,
"type": "all",
"trades": false,
"consolidate_taker": true,
"pair": "BTC/USD",
"limit": 75
}
'import requests
url = "https://api.kraken.com/0/private/TradesHistory"
payload = {
"nonce": 1695828490,
"type": "all",
"trades": False,
"consolidate_taker": True,
"pair": "BTC/USD",
"limit": 75
}
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: 1695828490,
type: 'all',
trades: false,
consolidate_taker: true,
pair: 'BTC/USD',
limit: 75
})
};
fetch('https://api.kraken.com/0/private/TradesHistory', 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/TradesHistory"
payload := strings.NewReader("{\n \"nonce\": 1695828490,\n \"type\": \"all\",\n \"trades\": false,\n \"consolidate_taker\": true,\n \"pair\": \"BTC/USD\",\n \"limit\": 75\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": {
"trades": {
"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": 40274859,
"maker": true
},
"TCWJEG-FL4SZ-3FKGH6": {
"ordertxid": "OQCLML-BW3P3-BUCMWZ",
"postxid": "TKH2SE-M7IF5-CFI7LT",
"pair": "XXBTZUSD",
"time": 1688667769.6396,
"type": "buy",
"ordertype": "limit",
"price": "30010.00000",
"cost": "300.10000",
"fee": "0.00000",
"vol": "0.01000000",
"margin": "0.00000",
"misc": "",
"trade_id": 39482674,
"maker": true
}
}
}
}Authorizations
Query Parameters
Public wallet account ID. Omit to use the authenticated user's default wallet. See List Wallet Accounts.
Body
application/json
Was this page helpful?