From ceae480e9edbdbe344f9e7fb035ce8407c7108b8 Mon Sep 17 00:00:00 2001 From: Joshua Raphael Date: Fri, 9 Jan 2026 20:16:48 -0700 Subject: [PATCH] feat: add js client for API_GetGameProgression --- docs/v1/get-game-progression.md | 76 +++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 3 deletions(-) diff --git a/docs/v1/get-game-progression.md b/docs/v1/get-game-progression.md index 1600da9..95a851f 100644 --- a/docs/v1/get-game-progression.md +++ b/docs/v1/get-game-progression.md @@ -24,6 +24,21 @@ A call to this endpoint will retrieve information about the average time to unlo ::: code-group +```ts [NodeJS] +import { buildAuthorization, getGameProgression } from "@retroachievements/api"; + +// First, build your authorization object. +const username = ""; +const webApiKey = ""; + +const authorization = buildAuthorization({ username, webApiKey }); + +// Then, make the API call. +const gameProgression = await getGameProgression(authorization, { + gameId: 14402, +}); +``` + ```kotlin [Kotlin] val credentials = RetroCredentials("", "") val api: RetroInterface = RetroClient(credentials).api @@ -104,10 +119,65 @@ if (response is NetworkResponse.Success) { } ``` +```json [NodeJS] +{ + "id": 228, + "title": "Super Mario World", + "consoleId": 3, + "consoleName": "SNES/Super Famicom", + "imageIcon": "/Images/112443.png", + "numDistinctPlayers": 79281, + "timesUsedInBeatMedian": 4493, + "timesUsedInHardcoreBeatMedian": 8249, + "medianTimeToBeat": 17878, + "medianTimeToBeatHardcore": 19224, + "timesUsedInCompletionMedian": 155, + "timesUsedInMasteryMedian": 1091, + "medianTimeToComplete": 67017, + "medianTimeToMaster": 79744, + "numAchievements": 89, + "achievements": [ + { + "id": 342, + "title": "Giddy Up!", + "description": "Catch a ride with a friend", + "points": 1, + "trueRatio": 1, + "type": null, + "badgeName": "46580", + "numAwarded": 75168, + "numAwardedHardcore": 37024, + "timesUsedInUnlockMedian": 63, + "timesUsedInHardcoreUnlockMedian": 69, + "medianTimeToUnlock": 274, + "medianTimeToUnlockHardcore": 323 + }, + { + "id": 341, + "title": "Unleash The Dragon", + "description": "Collect 5 Dragon Coins in a level", + "points": 2, + "trueRatio": 2, + "type": null, + "badgeName": "46591", + "numAwarded": 66647, + "numAwardedHardcore": 34051, + "timesUsedInUnlockMedian": 66, + "timesUsedInHardcoreUnlockMedian": 70, + "medianTimeToUnlock": 290, + "medianTimeToUnlockHardcore": 333 + } + // ... additional achievements + ] +} +``` + ::: ## Source -| Repo | URL | -| :---- | :------------------------------------------------------------------------------------------- | -| RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetGameProgression.php | +| Repo | URL | +| :--------- | :------------------------------------------------------------------------------------------------------------------- | +| RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetGameProgression.php | +| api-js | https://github.com/RetroAchievements/api-js/blob/main/src/game/getGameProgression.ts | +| api-kotlin | https://github.com/RetroAchievements/api-kotlin/blob/main/src/main/kotlin/org/retroachivements/api/RetroInterface.kt |