Skip to content

Commit

Permalink
adding docs for API_GetGameLeaderboards (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioslife authored Aug 8, 2024
1 parent ca4cef2 commit bbba908
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,13 @@ export default defineConfig({
],
},
{
text: "Leaderboard",
text: "Leaderboards",
collapsible: true,
items: [
{
text: "Leaderboards (by gameID)",
link: "/v1/get-game-leaderboards",
},
{
text: "Entries",
link: "/v1/get-leaderboard-entries",
Expand Down
Binary file added docs/public/game-leaderboards.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions docs/v1/get-game-leaderboards.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<script setup>
import SampleRequest from '../components/SampleRequest.vue';
</script>

# Game Leaderboards

A call to this endpoint will retrieve a given games's list of leaderboards, targeted by the game's ID.

[[toc]]

## On-site Representation

A games's list of leaderboards can be found on on the game's page:

![Game Leaderboards](/game-leaderboards.png)

## HTTP Request

<SampleRequest httpVerb="GET">https://retroachievements.org/API/API_GetGameLeaderboards.php?i=1</SampleRequest>

### Query Parameters

| Name | Required? | Description |
| :--- | :-------- | :----------------------------------------------------------- |
| `z` | Yes | Your username. |
| `y` | Yes | Your web API key. |
| `i` | Yes | The target game ID. |
| `c` | | Count, number of records to return (default: 100, max: 500). |
| `o` | | Offset, number of entries to skip (default: 0). |

## Client Library

Not yet supported.

## Response

::: code-group

```json [HTTP Response]
{
"Count": 29,
"Total": 29,
"Results": [
{
"ID": 104370,
"RankAsc": false,
"Title": " South Island Conqueror",
"Description": "Complete the game with the highest score possible",
"Format": "VALUE",
"TopEntry": {
"User": "vani11a",
"Score": "390490",
"FormattedScore": "390,490"
}
}
// ...
]
}
```

:::

## Source

| Repo | URL |
| :---- | :-------------------------------------------------------------------------------------------- |
| RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetGameLeaderboards.php |

0 comments on commit bbba908

Please sign in to comment.