Tickers (24hr)
Two endpoints, one shape. Use All Pairs for a market overview, or For Specific Coin when you only care about one symbol (or a few).
All Pairs
Returns 24hr stats for every symbol on an exchange.
| Method | GET |
| Endpoint | /trade/api/v2/24hr/all-pairs/ticker |
Request Parameters
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
exchange | string | Yes | See Exchange Identifiers. |
Example
- Python
- Java
- Go
- Node.js
import requests
headers, path = sign_request("GET", "/trade/api/v2/24hr/all-pairs/ticker",
params={"exchange": "coinswitchx"})
response = requests.get(BASE_URL + path, headers=headers)
print(response.json())
HttpResponse<String> resp = client.send(
"GET", "/trade/api/v2/24hr/all-pairs/ticker",
Map.of("exchange", "coinswitchx"), null);
System.out.println(resp.body());
headers, p, err := SignRequest("GET", "/trade/api/v2/24hr/all-pairs/ticker", map[string]string{"exchange": "coinswitchx"})
if err != nil { panic(err) }
req, _ := http.NewRequest("GET", BaseURL+p, nil)
for k, v := range headers { req.Header.Set(k, v) }
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
const {signRequest, BASE_URL} = require('./reference-client');
const {headers, path} = signRequest('GET', '/trade/api/v2/24hr/all-pairs/ticker', {"exchange": "coinswitchx"});
const r = await fetch(BASE_URL + path, {
method: 'GET',
headers,
});
console.log(await r.json());
For Specific Coin
Returns 24hr stats for one or more specific symbols. Accepts a comma-separated list of exchanges.
| Method | GET |
| Endpoint | /trade/api/v2/24hr/ticker |
Request Parameters
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
exchange | string | Yes | Comma-separated list of exchange identifiers. |
symbol | string | Yes | BASE/QUOTE, e.g. BTC/INR, BTC/USDT. |
Example
- Python
- Java
- Go
- Node.js
import requests
headers, path = sign_request("GET", "/trade/api/v2/24hr/ticker",
params={"exchange": "coinswitchx,c2c1",
"symbol": "BTC/INR"})
response = requests.get(BASE_URL + path, headers=headers)
print(response.json())
HttpResponse<String> resp = client.send(
"GET", "/trade/api/v2/24hr/ticker",
Map.of("exchange", "coinswitchx,c2c1", "symbol", "BTC/INR"), null);
System.out.println(resp.body());
headers, p, err := SignRequest("GET", "/trade/api/v2/24hr/ticker", map[string]string{"exchange": "coinswitchx,c2c1",
"symbol": "BTC/INR"})
if err != nil { panic(err) }
req, _ := http.NewRequest("GET", BaseURL+p, nil)
for k, v := range headers { req.Header.Set(k, v) }
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
const {signRequest, BASE_URL} = require('./reference-client');
const {headers, path} = signRequest('GET', '/trade/api/v2/24hr/ticker', {"exchange": "coinswitchx,c2c1",
"symbol": "BTC/INR"});
const r = await fetch(BASE_URL + path, {
method: 'GET',
headers,
});
console.log(await r.json());
Response
Both endpoints return the same shape:
{
"data": {
"WAVES/INR": {
"symbol": "WAVES/INR",
"openPrice": "127.65",
"lowPrice": "125.53",
"highPrice": "129.88",
"lastPrice": "125.56",
"baseVolume": "1910.65",
"quoteVolume": "240593.58",
"percentageChange": "-1.63728946337642",
"bidPrice": "125.56",
"askPrice": "127.29",
"at": 1687267004787
}
}
}
Response Parameters
data is an object keyed by symbol. Each value:
| Field | Type | Description |
|---|---|---|
symbol | string | Symbol, e.g. "WAVES/INR". |
openPrice | string | Price 24h ago. |
lowPrice | string | 24h low. |
highPrice | string | 24h high. |
lastPrice | string | Most recent trade price. |
baseVolume | string | 24h volume in base asset. |
quoteVolume | string | 24h volume in quote asset. |
percentageChange | string | 24h percentage change. |
bidPrice | string | Best bid. |
askPrice | string | Best ask. |
at | integer | Snapshot timestamp (Unix milliseconds). |