Leaderboard API Endpoint

GET /api/leaderboard

Returns the highest test data from each user as a JSON array. The data includes metrics such as username, words per minute (WPM), accuracy percentage, the time taken for the test, and the length of the test for a comprehensive overview of user performance.

Request Parameters

Responses

Example Request

curl -X GET "https://url/api/leaderboard"

Example Response

[
  {
    "username": "user1",
    "wpm": 75,
    "accuracy": 97,
    "test_time": 120,
    "test_length": 250
  },
  {
    "username": "user2",
    "wpm": 73,
    "accuracy": 95,
    "test_time": 115,
    "test_length": 240
  }
]