|
| 1 | +<script setup> |
| 2 | +import SampleRequest from '../components/SampleRequest.vue'; |
| 3 | +</script> |
| 4 | + |
| 5 | +# User Game Leaderboards |
| 6 | + |
| 7 | +A call to this endpoint will retrieve a user's list of leaderboards for a given game, targeted by the game's ID. |
| 8 | + |
| 9 | +[[toc]] |
| 10 | + |
| 11 | +## On-site Representation |
| 12 | + |
| 13 | +A games's list of leaderboards can be found on on the game's page: |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +This endpoint will only return the leaderboards for the user given in the request. If the user has not submitted a score for a leaderboard, it will not be included in the response. |
| 18 | + |
| 19 | +## HTTP Request |
| 20 | + |
| 21 | +<SampleRequest httpVerb="GET">https://retroachievements.org/API/API_GetUserGameLeaderboards.php?i=1&u=zuliman92</SampleRequest> |
| 22 | + |
| 23 | +### Query Parameters |
| 24 | + |
| 25 | +| Name | Required? | Description | |
| 26 | +| :--- | :-------- | :----------------------------------------------------------- | |
| 27 | +| `y` | Yes | Your web API key. | |
| 28 | +| `i` | Yes | The target game ID. | |
| 29 | +| `u` | Yes | The username of the user to retrieve leaderboards for. | |
| 30 | +| `c` | | Count, number of records to return (default: 200, max: 500). | |
| 31 | +| `o` | | Offset, number of entries to skip (default: 0). | |
| 32 | + |
| 33 | +## Client Library |
| 34 | + |
| 35 | +Not yet supported. |
| 36 | + |
| 37 | +## Response |
| 38 | + |
| 39 | +::: code-group |
| 40 | + |
| 41 | +```json [HTTP Response] |
| 42 | +{ |
| 43 | + "Count": 10, |
| 44 | + "Total": 64, |
| 45 | + "Results": [ |
| 46 | + { |
| 47 | + "ID": 19062, |
| 48 | + "RankAsc": true, |
| 49 | + "Title": "New Zealand One", |
| 50 | + "Description": "Complete New Zealand S1 in least time", |
| 51 | + "Format": "MILLISECS", |
| 52 | + "UserEntry": { |
| 53 | + "User": "zuliman92", |
| 54 | + "Score": 12620, |
| 55 | + "FormattedScore": "2:06.20", |
| 56 | + "Rank": 2, |
| 57 | + "DateUpdated": "2024-12-12T16:40:59+00:00" |
| 58 | + } |
| 59 | + }, |
| 60 | + ... |
| 61 | + ] |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +::: |
| 66 | + |
| 67 | +## Source |
| 68 | + |
| 69 | +| Repo | URL | |
| 70 | +| :---- | :------------------------------------------------------------------------------------------------ | |
| 71 | +| RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetUserGameLeaderboards.php | |
0 commit comments