Get User Rank
horizon_get_user_rankRetrieves a player's own leaderboard position, score, and profile by userId, so you can show their rank after score submission or display 'your rank' in the game.
Instructions
Returns one player's own position, score and profile on a leaderboard. Use when: after horizon_submit_score, or to show 'your rank' in the game. Not for: a list of entries (use horizon_get_leaderboard_top or horizon_get_leaderboard_around). Requires: a userId from horizon_signup_* or horizon_signin_*; no session token. Side effects: None (read only). Returns: {position, username, score, profile}. profile is {avatarId, frameId, badges} (IDs from the cosmetics catalog; null or [] when not set, set with horizon_set_profile). On boards with a schedule the result also carries period {start, end} (ISO-8601, UTC) and equal scores share a rank (1, 1, 3). Errors: 404 when the player has no score on this board (or in the chosen period) yet (submit one first) or the leaderboardKey is unknown (check horizon_list_leaderboards). 404 NO_PREVIOUS_PERIOD for period previous when the board has no ended period yet: read the current period instead. 400 for any other period value. Needs HORIZON_API_KEY. Every failure returns an error result (isError) with the HTTP status and body: a 401 that horizon_test_connection also returns means HORIZON_API_KEY is wrong, 429 means the account's per-minute rate limit was reached (wait a minute, then retry).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"userId": "<userId>"
},
"name": "horizon_get_user_rank"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | No | Scoring period to read: current (default) or previous (the period that ended last, on boards with a weekly or monthly schedule). Needs leaderboardKey | |
| userId | Yes | Player user ID (UUID) from horizon_signup_* or horizon_signin_* | |
| leaderboardKey | No | Board key from horizon_list_leaderboards (1 to 64 characters: a-z, 0-9, _ and -). Omit to use the API key's default board. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| score | No | ||
| period | No | ||
| profile | No | ||
| position | No | ||
| username | No |