Ticker Stats
Retrieve ticker statistics for specific or all trading symbols.
Endpoint
GET /ticker-stats
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
names | string | No | Comma-separated list of symbols to retrieve (e.g., CAKE_USDT,ETH_USDT ). If omitted, retrieves stats for all symbols. |
Response
JSON Array of Objects
Response Fields
Field | Type | Description |
---|---|---|
a | string | Symbol name (e.g., ETH_USDT ). |
b | string | Current price. |
c | string | Close price 24 hours ago. |
d | string | High price in the last 24 hours. |
e | string | Low price in the last 24 hours. |
f | string | Base volume in the last 24 hours (e.g., total ETH for ETH_USDT ). |
g | string | Quote volume in the last 24 hours (e.g., total USDT for ETH_USDT ). |
h | string | Last updated timestamp (in milliseconds). |
i | string | Best bid price. |
k | string | Best ask price. |
Example Usage
- cURL
- ReactJS
- React Native
- Node.js
- Java
- C#
- Python
- Go
- Rust
curl --location 'https://spot-markets.goonus.io/ticker-stats?names=CAKE_USDT,ETH_USDT'
import React, { useEffect, useState } from 'react';
function TickerStats() {
const [data, setData] = useState(null);
useEffect(() => {
fetch('https://spot-markets.goonus.io/ticker-stats?names=CAKE_USDT,ETH_USDT')
.then(response => response.json())
.then(setData)
.catch(error => console.error('Error:', error));
}, []);
return (
<div>
<h1>Ticker Stats</h1>
<pre>{data ? JSON.stringify(data, null, 2) : 'Loading...'}</pre>
</div>
);
}
export default TickerStats;
import { useEffect } from 'react';
import { Text, View } from 'react-native';
const fetchData = async () => {
try {
const response = await fetch('https://spot-markets.goonus.io/ticker-stats?names=CAKE_USDT,ETH_USDT');
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
};
export default function App() {
useEffect(() => {
fetchData();
}, []);
return (
<View>
<Text>Check console for API data.</Text>
</View>
);
}
const axios = require('axios');
axios.get('https://spot-markets.goonus.io/ticker-stats', {
params: {
names: 'CAKE_USDT,ETH_USDT'
}
})
.then(response => console.log(response.data))
.catch(error => console.error('Error:', error));
import java.net.http.*;
import java.net.URI;
public class TickerStats {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://spot-markets.goonus.io/ticker-stats?names=CAKE_USDT,ETH_USDT"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program {
static async Task Main(string[] args) {
var client = new HttpClient();
var response = await client.GetStringAsync("https://spot-markets.goonus.io/ticker-stats?names=CAKE_USDT,ETH_USDT");
Console.WriteLine(response);
}
}
import requests
url = "https://spot-markets.goonus.io/ticker-stats?names=CAKE_USDT,ETH_USDT"
response = requests.get(url)
print(response.json())
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://spot-markets.goonus.io/ticker-stats?names=CAKE_USDT,ETH_USDT"
resp, err := http.Get(url)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}
use reqwest;
use tokio;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let resp = reqwest::get("https://spot-markets.goonus.io/ticker-stats?names=CAKE_USDT,ETH_USDT").await?.text().await?;
println!("{}", resp);
Ok(())
}
Response Example
[
{
"a": "ETH_USDT",
"b": "2.0000000",
"c": "2.0000000",
"d": "3.0000000",
"e": "0.0000000",
"f": "0.300",
"g": "0.80000000",
"h": "1720755300000",
"i": "4001.00000",
"k": "4503.05000"
},
{
"a": "BTC_USDT",
"b": "0.0000000",
"c": null,
"d": "0.0000000",
"e": "0.0000000",
"f": "0.000",
"g": "0.00000000",
"h": "1720755300000",
"i": "4001.00000",
"k": "4503.05000"
}
]