Get User Rank API - Retrieve Individual User Rankings
Get a user's current leaderboard rank and performance metrics across multiple timeframes with a single API call. This user ranking endpoint returns positions and points for 7-day, 30-day, and 365-day leaderboards simultaneously.
Perfect for user profile statistics, achievement systems, performance dashboards, and displaying user rank badges. Ideal for gamification APIs, loyalty program tracking, and competitive app features.
Retrieve a specific user's ranking and points across all floating leaderboard timeframes (7d, 30d, 365d).
Note: This endpoint only supports floating leaderboards. For monthly leaderboard data, use the User Leaderboard View endpoint with the month parameter.
Use Cases
- Display user statistics on profile pages
- Show performance trends across different time windows
- Create achievement badges based on rankings
- Compare short-term vs long-term performance
Endpoint
GET /user/{userId}/rankPath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | The unique identifier of the user |
Response
Returns an object containing the user's rank and points for each timeframe.
Response Schema
{
"userId": "abc123def456ghi789jkl012mno345",
"username": "username_abc345",
"points7d": 45,
"points30d": 198,
"points365d": 1250,
"rank7d": 12,
"rank30d": 8,
"rank365d": 5,
"createdAt": 1699276800000
}Field Descriptions
| Field | Type | Description |
|---|---|---|
userId | string | Unique identifier of the user |
username | string | Display name of the user |
points7d | number | Total points accumulated in the last 7 days |
points30d | number | Total points accumulated in the last 30 days |
points365d | number | Total points accumulated in the last 365 days |
rank7d | number | User's rank in the 7-day leaderboard |
rank30d | number | User's rank in the 30-day leaderboard |
rank365d | number | User's rank in the 365-day leaderboard |
createdAt | number | Unix timestamp when the user was created |
Example Request
curl -X GET "https://api.lynesapp.de/user/abc123def456ghi789jkl012mno345/rank" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Status Codes
| Status Code | Description |
|---|---|
200 | Successfully retrieved user rank |
401 | Unauthorized - Invalid or missing authentication token |
404 | User not found |
500 | Internal server error |