Skip to main content

Daily Leaderboard

Returns each user's points increment since UTC 00:00 today. The cache is refreshed every 5 minutes by a background worker.

GET /points/leaderboard/daily

No authentication required.

Query Parameters

ParameterTypeRequiredDefaultDescription
epochintegerNoCurrent active epochEpoch number
limitintegerNo10Number of entries, clamped to 1–50
offsetintegerNo0Pagination offset (minimum 0)

Response

{
"success": true,
"data": {
"date": "2026-04-16",
"epoch_number": 3,
"refreshed_at": "2026-04-16T08:35:00Z",
"total": 2840,
"entries": [
{
"rank": 1,
"user_address": "0xAbCd...1234",
"points_today": "4230.50",
"tier": "T3"
},
{
"rank": 2,
"user_address": "0xEfGh...5678",
"points_today": "3810.20",
"tier": "T2"
}
]
},
"error": null,
"timestamp": 1745280000
}

Response Fields

FieldTypeDescription
datestringUTC date (YYYY-MM-DD)
epoch_numberintEpoch the data belongs to
refreshed_atstringLast cache refresh time (minute-level precision)
totalintTotal users with points today (not capped by limit)
entriesarrayRanked entries

entries[]

FieldTypeDescription
rankintRank position for today
user_addressstringUser's wallet address
points_todayDecimalPoints earned since UTC 00:00 today
tierstring | nullUser's current tier; null if not set

Refresh Mechanism

The read path queries the daily_points_leaderboard table directly. A background worker refreshes that table every 5 minutes (incremental within the day; full rebuild on the first run after UTC 00:00, when the previous day's rows are purged).

  • This leaderboard shows today's increment only, not epoch cumulative totals. See Leaderboard for epoch totals.
  • If the background worker has not completed its first run of the day, the endpoint may return an empty list.
  • Use offset + limit for pagination, e.g., page 2: ?limit=50&offset=50.

Code Examples

Python

import requests

BASE_URL = "https://api.prex.world/api/v1"

resp = requests.get(
f"{BASE_URL}/points/leaderboard/daily",
params={"limit": 10},
)
data = resp.json()["data"]

print(f"Daily leaderboard {data['date']} (refreshed {data['refreshed_at']})")
for e in data["entries"]:
print(f" #{e['rank']} {e['user_address'][:10]}...: {e['points_today']} pts today")