Get public orders book [Public]
Get a list of order prices by pair (e.g. BTC_USDT
). Returns a list of order prices, 2 arrays for Bids and Asks; lowest first for Asks, highest first for Bids; leveled by order prices, but no more levels than specified by the level
parameter.
This is a public route, no need for authorization.
Method name: | /v4/order/public/book/{pairs} |
Request type: | GET |
To increase the API rate limits, you can use a private endpoint: /v4/order/private/book
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 |
level | int | QUERY | NO | 5, 10, 20, 50, 100, 500, 1000 | Amount of price levels for existing orders in the response |
Parameter
level
defaults to 1000 if not provided.
Exemplary request
Example path | Description |
---|---|
/v4/order/public/book/BTC_USDT?level=5 | Returns a list of order prices for BTC_USDT ; 5 lowest for Asks and 5 highest fir Bids |
/v4/order/public/book/BTC_USDT | Returns a list of order prices for BTC_USDT ; 1000 lowest for Asks and 1000 highest fir Bids |
const url = "https://api.kuna.io";
const path = "/v4/order/public/book/BTC_USDT?level=5";
const options = {
headers: {
accept: "application/json",
},
};
fetch(url + path, options)
.then((response) => response.json())
.then((showResponse) => console.log(showResponse.data));
import requests
url = "https://api.kuna.io"
path = "/v4/order/public/book/BTC_USDT?level=5"
headers = {
"accept": "application/json"
}
request = requests.get(url + path, headers=headers)
print(request.json())
How to call public endpoints here
Response
{
"asks": [ // An array of sell orders
[
"16950", // Sell price, level 1
"0.001" // Sell quantity, level 1
],
[
"17000", // Sell price, level 2
"0.01" // Sell quantity, level 2
]
],
"bids": [ // An array of buy orders
[
"16700", // Sell price, level 1
"0.01" // Sell quantity, level 1
],
[
"16000", // Sell price, level 2
"0.001" // Sell quantity, level 2
]
]
}
Updated over 1 year ago