Get User Rank

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}/rank

Path Parameters

ParameterTypeRequiredDescription
userIdstringYesThe 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

FieldTypeDescription
userIdstringUnique identifier of the user
usernamestringDisplay name of the user
points7dnumberTotal points accumulated in the last 7 days
points30dnumberTotal points accumulated in the last 30 days
points365dnumberTotal points accumulated in the last 365 days
rank7dnumberUser's rank in the 7-day leaderboard
rank30dnumberUser's rank in the 30-day leaderboard
rank365dnumberUser's rank in the 365-day leaderboard
createdAtnumberUnix 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 CodeDescription
200Successfully retrieved user rank
401Unauthorized - Invalid or missing authentication token
404User not found
500Internal server error