Get public trades book [Private]
Get a list of trades by pair (e.g. BTC_USDT
). Returns a list of trades, newest first, 100 trades maximum, but not more than specified by the limit
parameter.
To call any private endpoint, headers should include authorization key(s).
You may use a single API key or a public-private key pair based on your current tasks. Here you may find typical Header configurations for both options.
Method name: | /v4/trade/private/book/{pairs} |
Request type: | GET |
Data dictionary
Name | Type | Parameter type | Required | Range | Description |
---|---|---|---|---|---|
pair | string | PATH | YES | - | A trading pair as per the list from Get all traded markets endpoint |
limit | int | QUERY | NO | 1-100 | Maximum amount of results in a response |
Parameter
limit
defaults to 25 if not provided.
Exemplary request
Example path | Description |
---|---|
/v4/trade/private/book/BTC_USDT?limit=5 | Returns the list of 5 new trades for BTC_USDT pair |
/v4/trade/private/book/BTC_USDT | Returns the list of 25 new trades for BTC_USDT pair |
const apiKey = "YOUR_API_KEY"; // put here your Api key
const url = "https://api.kuna.io";
const path = "/v4/trade/private/book/BTC_USDT?limit=5";
const options = {
headers: {
accept: "application/json",
"Content-Type": "application/json",
"api-key": apiKey,
},
};
fetch(url + path, options)
.then((response) => response.json())
.then((showResponse) => console.log(showResponse.data));
import requests
apiKey = "YOUR_API_KEY"; # put here your Api key
url = "https://api.kuna.io"
path = "/v4/trade/private/book/BTC_USDT?limit=5"
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"api-key": apiKey,
}
request = requests.get(url + path, headers=headers)
print(request.json())
How to call public endpoints here
Response
{
"id": "3e5591ba-2778-4d85-8851-54284045ea44", // Unique identifier of a trade
"pair": "BTC_USDT", // Market pair that is being traded
"quoteQuantity": "11528.8118", // Qty of the quote asset, USDT in this example
"matchPrice": "18649", // Exchange price at the moment of execution
"matchQuantity": "0.6182", // Qty of the base asset, BTC in this example
"createdAt": "2022-09-23T14:30:41.486Z", // Date-time of trade execution, UTC
"side": "Ask" // Trade type: `Ask` or `Bid`. Bid for buying base asset, Ask for selling base asset (e.g. for BTC_USDT trading pair, BTC is the base asset).
}
Updated over 1 year ago