curl --request GET \
--url https://api.agg.market/leaderboard \
--header 'x-app-id: <api-key>'import requests
url = "https://api.agg.market/leaderboard"
headers = {"x-app-id": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-app-id': '<api-key>'}};
fetch('https://api.agg.market/leaderboard', 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://api.agg.market/leaderboard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-app-id: <api-key>"
],
]);
$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://api.agg.market/leaderboard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-app-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.agg.market/leaderboard")
.header("x-app-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agg.market/leaderboard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-app-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"rank": 50,
"userId": "<string>",
"username": "<string>",
"avatarUrl": "<string>",
"walletAddress": "<string>",
"orders": 123,
"volume": 123,
"spent": 123,
"realizedPnl": 123,
"wins": 123,
"losses": 123,
"winRate": 0.5
}
],
"nextCursor": "<string>",
"hasMore": true
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"statusCode": 429,
"code": "rate_limited",
"retryAfter": 2
}Trader leaderboard
Users of this app ranked by realizedPnl (default) or volume over an inclusive UTC day range; omit from/to for all time. rank is exact within the top 100 and null beyond. Identity fields follow the app’s leaderboardIdentity setting. Pass exactly one of userId, externalId, username or walletAddress to look up a single user. realizedPnl is gross, position-level realized P&L in USD: sell proceeds against the position’s average entry, plus settlement payout against entry, attributed to the order’s creation day (sells) or the settlement day. It excludes venue and app fees. Positions with an unknown cost basis (imported inventory) contribute 0. History: volume and order counts are complete; P&L is complete from the deploy date, and earlier settled positions carry their lifetime P&L on their redemption day. Data refreshes every 5 minutes. Timestamp window: pass from (and optionally to) as ISO-8601 timestamps with an explicit offset instead of days to get one user’s stats over [from, to) — for windows shorter than a day or not aligned to UTC days. Requires an x-app-api-key issued for this app (403 without one, or with another app’s key: a live sub-day window would expose individual trades to anyone with the public app id) and either exactly one of userId, externalId, username or walletAddress, or up to 20 userIds (one row each, ordered by metric; users with no activity in the window are omitted, as with day ranges); to defaults to now and is clamped to now; at most 366 days; cannot be combined with categoryIds or venueEventIds, and from/to must both be days or both be timestamps. Rows are computed live with the same rules (a window covering whole UTC days matches the day range), and rank is null. Filters: categoryIds (one category, including its sub-categories), venueEventIds (up to 5 events, each merged across venues; all time only), userIds (up to 100 users, unpaginated). wins/losses count settled position legs: a leg whose settlement booked a profit is a win, a loss is a loss, and a zero settlement (void, refund at cost, or a position with no known entry price) is neither. A position fully sold before settlement has no settlement, so it counts toward realizedPnl only; a leg partly sold and then settled is classified by its settlement alone. winRate = wins / (wins + losses), null before any settlement. A trade counts in the categories of the event it was placed on (its venue’s own event), while venueEventIds expands to the same event on every venue. Category rows overlap (an NFL game counts in nfl, football and sports), so never add two categories’ numbers together.
curl --request GET \
--url https://api.agg.market/leaderboard \
--header 'x-app-id: <api-key>'import requests
url = "https://api.agg.market/leaderboard"
headers = {"x-app-id": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-app-id': '<api-key>'}};
fetch('https://api.agg.market/leaderboard', 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://api.agg.market/leaderboard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-app-id: <api-key>"
],
]);
$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://api.agg.market/leaderboard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-app-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.agg.market/leaderboard")
.header("x-app-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agg.market/leaderboard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-app-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"rank": 50,
"userId": "<string>",
"username": "<string>",
"avatarUrl": "<string>",
"walletAddress": "<string>",
"orders": 123,
"volume": 123,
"spent": 123,
"realizedPnl": 123,
"wins": 123,
"losses": 123,
"winRate": 0.5
}
],
"nextCursor": "<string>",
"hasMore": true
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"statusCode": 429,
"code": "rate_limited",
"retryAfter": 2
}Integration guide
- Before you call: Set up your app and request headers.
- Workflow: Display user activity and rankings.
- Next: Track orders to a final state.
Authorizations
Query Parameters
Return only these users' rows (AGG user ids), unpaginated. At most 100, or 20 with a timestamp from/to. Requested users with no stats in the slice are omitted (the single-user lookups return a zero row instead). Cannot be combined with the single-user lookups or cursor.
1001