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
limitintegerNo100Number of entries, max 500
offsetintegerNo0Pagination offset

Response

{
"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"
}
]
}

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

LayerIntervalNotes
Redis cache330 seconds TTLWritten on first request; invalidated on refresh
DB cache table (daily_points_leaderboard)Every 5 minutesBackground worker UPSERT
Daily resetUTC 00:00Data rebuilt from zero on first refresh each day
  • 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 after service start (≈10 seconds), the endpoint may return an empty list.
  • Use offset + limit for pagination, e.g., page 2: ?limit=100&offset=100.

Code Examples

Python

import requests

BASE_URL = "https://api.primit.io/api/v1"

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

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")