GET
/
streaks
/
rankings
JavaScript
import { TrophyApiClient } from '@trophyso/node';

const trophy = new TrophyApiClient({
  apiKey: 'YOUR_API_KEY'
});

const response = await trophy.streaks.rankings({
  limit: 20,
  type: 'active'
});
[
  {
    "userId": "user-123",
    "name": "Alice Johnson",
    "streakLength": 15
  },
  {
    "userId": "user-456",
    "name": "Bob Smith",
    "streakLength": 12
  },
  {
    "userId": "user-789",
    "name": "Charlie Brown",
    "streakLength": 8
  }
]

Authorizations

X-API-KEY
string
header
required

Query Parameters

limit
integer
default:10

Number of users to return. Must be between 1 and 100.

Required range: 1 <= x <= 100
type
enum<string>
default:active

Whether to rank users by active streaks or longest streaks ever achieved.

Available options:
active,
longest

Response

200
application/json

Successful operation

The response is of type StreakRankingUser · object[].