Get Trading History Stats
curl --request GET \
--url https://backend-global.gains.trade/api/trading-history/{window}/statsimport requests
url = "https://backend-global.gains.trade/api/trading-history/{window}/stats"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://backend-global.gains.trade/api/trading-history/{window}/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://backend-global.gains.trade/api/trading-history/{window}/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://backend-global.gains.trade/api/trading-history/{window}/stats"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://backend-global.gains.trade/api/trading-history/{window}/stats")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend-global.gains.trade/api/trading-history/{window}/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"totalVolume": 123,
"totalTrades": 123,
"updatedAt": 123
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}Trading Data
Get Trading History Stats
Returns precomputed trading stats for a recent time window.
GET
/
api
/
trading-history
/
{window}
/
stats
Get Trading History Stats
curl --request GET \
--url https://backend-global.gains.trade/api/trading-history/{window}/statsimport requests
url = "https://backend-global.gains.trade/api/trading-history/{window}/stats"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://backend-global.gains.trade/api/trading-history/{window}/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://backend-global.gains.trade/api/trading-history/{window}/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://backend-global.gains.trade/api/trading-history/{window}/stats"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://backend-global.gains.trade/api/trading-history/{window}/stats")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend-global.gains.trade/api/trading-history/{window}/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"totalVolume": 123,
"totalTrades": 123,
"updatedAt": 123
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}Endpoint
GET /api/trading-history/{window}/stats
Returns precomputed trading stats for a recent time window.
Parameters
| Parameter | Location | Required | Type | Description |
|---|---|---|---|---|
window | path | Yes | string | Supported values: 24h, 48h, 72h. |
chainId | query | Yes | integer | Blockchain chain ID. Common values: 42161 Arbitrum, 8453 Base, 137 Polygon. |
Usage Example
curl -X GET "https://backend-global.gains.trade/api/trading-history/24h/stats?chainId=42161"
Response Structure
The generated API panel lists the response schema for status codes: 200, 400, 500. Error responses generally return anerror or message field.