Skip to main content

Get user leaderboard

Overview

Returns the leaderboard of affiliated onboarded users for a given range and affiliate username.


Endpoint

GET /affiliate/leaderboard


Query Parameters

Summary Table

ParameterTypeRequiredConstraintsDescription
fromDateNo2020-01-01Start date for filtering the leaderboard.
limitNumberYes1–50Maximum number of results to return.
toDateNo2020-01-01End date for filtering the leaderboard.
usernameStringNoFilters results to a specific username.

Parameters

from (optional)

  • Type: Date
  • Description: Start date for leaderboard data filtering.
  • Constraints: Cannot be earlier than January 1st, 2020.

limit (required)

  • Type: number
  • Description: Maximum number of leaderboard entries to return.
  • Constraints: Minimum 1, maximum 50.

to (optional)

  • Type: Date
  • Description: End date for leaderboard data filtering.
  • Constraints: Cannot be earlier than January 1st, 2020.

username (optional)

  • Type: string
  • Description: Filter leaderboard results to a specific username.

Notes

  • If both from and to are omitted, the leaderboard will return results based on all available data.
  • Providing a username will restrict results to only that affiliate, while still respecting date and limit filters.

Example request

GET /affiliate/leaderboard?from=2025-09-01T00:00:00.000Z&to=2025-09-30T00:00:00.000Z&username=<AFFILIATE_USERNAME>&limit=2

Responses

200 OK

{
"items": [
{
"username": "FO**AR",
"total_wager": 100
},
{
"username": "BI**AR",
"total_wager": 90
}
],
"limit": 2
}

400 Bad request

Bad date

{
"message": "Validation failed (invalid date format)",
"error": "Bad Request",
"statusCode": 400
}

Limit too big

{
"message": "Validation failed",
"error": {
"errors": [],
"properties": {
"limit": {
"errors": ["Too big: expected number to be <=50"]
}
}
},
"statusCode": 400
}

403 Forbidden

{
"message": "You are not authorized to access this resource.",
"error": "Forbidden",
"statusCode": 403
}

Changelog

  • v1.0.0 – Initial release of the leaderboard endpoint.