Skip to content

Commit 0bd2a56

Browse files
gastongaidukdrisc
authored andcommitted
docs: add get user game leaderboards docs (RetroAchievements#68)
1 parent 0dccf80 commit 0bd2a56

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Click the function names to open their complete docs on the docs site.
6161

6262
- [Leaderboards (by gameID)](https://api-docs.retroachievements.org/v1/get-game-leaderboards.html) - Get a given games's list of leaderboards.
6363
- [Entries](https://api-docs.retroachievements.org/v1/get-leaderboard-entries.html) - Get a given leadboard's entries.
64+
- [User game leaderboards](https://api-docs.retroachievements.org/v1/get-user-game-ladearboards.html) - Get a given user and game leaderboards.
6465

6566
### System
6667

docs/.vitepress/config.mts

+4
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ export default defineConfig({
166166
text: "Entries",
167167
link: "/v1/get-leaderboard-entries",
168168
},
169+
{
170+
text: "User Leaderboards (by gameID)",
171+
link: "/v1/get-user-game-leaderboards",
172+
},
169173
],
170174
},
171175
{

docs/v1/get-user-game-leaderboards.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
![Game Leaderboards](/game-leaderboards.png)
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

Comments
 (0)