How to call public endpoints
Practical guide on how to easily get started with Kuna Core public endpoints.
All public endpoints do not need authentication and sending body parameters. The headers configuration is pretty simple.
Header settings for public endpoints
The following headers config should work for any public endpoint:
Header | Value | Description |
---|---|---|
accept | application/json | The client expects response data as JSON. |
Example. Get all market rates
No auth, no parameters, no body required for this request.
const url = BASE_URL;
const path = "/v2/rate/equivalent";
const options = {
headers: {
accept: "application/json",
},
};
fetch(url + path, options)
.then((response) => response.json())
.then((showResponse) => console.log(showResponse.data));
import requests
url = BASE_URL
path = "/v2/rate/equivalent"
headers = {
"accept": "application/json"
}
request = requests.get(url + path, headers=headers)
print(request.json())
Example. Get list of tickers for BTC_USDT and ETH_USDT
No auth and body required. We need to provide one parameter - pairs
.
const url = BASE_URL;
const path = "/v2/ticker?pairs=BTC_USDT,ETH_USDT";
const options = {
headers: {
accept: "application/json",
},
};
fetch(url + path, options)
.then((response) => response.json())
.then((showResponse) => console.log(showResponse.data));
import requests
url = BASE_URL
path = "/v2/ticker?pairs=BTC_USDT,ETH_USDT"
headers = {
"accept": "application/json"
}
request = requests.get(url + path, headers=headers)
print(request.json())
Updated 9 months ago