@@ -24,6 +24,21 @@ A call to this endpoint will retrieve information about the average time to unlo
2424
2525::: code-group
2626
27+ ``` ts [NodeJS]
28+ import { buildAuthorization , getGameProgression } from " @retroachievements/api" ;
29+
30+ // First, build your authorization object.
31+ const username = " <your username on RA>" ;
32+ const webApiKey = " <your web API key>" ;
33+
34+ const authorization = buildAuthorization ({ username , webApiKey });
35+
36+ // Then, make the API call.
37+ const gameProgression = await getGameProgression (authorization , {
38+ gameId: 14402 ,
39+ });
40+ ```
41+
2742``` kotlin [Kotlin]
2843val credentials = RetroCredentials (" <username>" , " <web api key>" )
2944val api: RetroInterface = RetroClient (credentials).api
@@ -104,10 +119,65 @@ if (response is NetworkResponse.Success) {
104119}
105120```
106121
122+ ``` json [NodeJS]
123+ {
124+ "id" : 228 ,
125+ "title" : " Super Mario World" ,
126+ "consoleId" : 3 ,
127+ "consoleName" : " SNES/Super Famicom" ,
128+ "imageIcon" : " /Images/112443.png" ,
129+ "numDistinctPlayers" : 79281 ,
130+ "timesUsedInBeatMedian" : 4493 ,
131+ "timesUsedInHardcoreBeatMedian" : 8249 ,
132+ "medianTimeToBeat" : 17878 ,
133+ "medianTimeToBeatHardcore" : 19224 ,
134+ "timesUsedInCompletionMedian" : 155 ,
135+ "timesUsedInMasteryMedian" : 1091 ,
136+ "medianTimeToComplete" : 67017 ,
137+ "medianTimeToMaster" : 79744 ,
138+ "numAchievements" : 89 ,
139+ "achievements" : [
140+ {
141+ "id" : 342 ,
142+ "title" : " Giddy Up!" ,
143+ "description" : " Catch a ride with a friend" ,
144+ "points" : 1 ,
145+ "trueRatio" : 1 ,
146+ "type" : null ,
147+ "badgeName" : " 46580" ,
148+ "numAwarded" : 75168 ,
149+ "numAwardedHardcore" : 37024 ,
150+ "timesUsedInUnlockMedian" : 63 ,
151+ "timesUsedInHardcoreUnlockMedian" : 69 ,
152+ "medianTimeToUnlock" : 274 ,
153+ "medianTimeToUnlockHardcore" : 323
154+ },
155+ {
156+ "id" : 341 ,
157+ "title" : " Unleash The Dragon" ,
158+ "description" : " Collect 5 Dragon Coins in a level" ,
159+ "points" : 2 ,
160+ "trueRatio" : 2 ,
161+ "type" : null ,
162+ "badgeName" : " 46591" ,
163+ "numAwarded" : 66647 ,
164+ "numAwardedHardcore" : 34051 ,
165+ "timesUsedInUnlockMedian" : 66 ,
166+ "timesUsedInHardcoreUnlockMedian" : 70 ,
167+ "medianTimeToUnlock" : 290 ,
168+ "medianTimeToUnlockHardcore" : 333
169+ }
170+ // ... additional achievements
171+ ]
172+ }
173+ ```
174+
107175:::
108176
109177## Source
110178
111- | Repo | URL |
112- | :---- | :------------------------------------------------------------------------------------------- |
113- | RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetGameProgression.php |
179+ | Repo | URL |
180+ | :--------- | :------------------------------------------------------------------------------------------------------------------- |
181+ | RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetGameProgression.php |
182+ | api-js | https://github.com/RetroAchievements/api-js/blob/main/src/game/getGameProgression.ts |
183+ | api-kotlin | https://github.com/RetroAchievements/api-kotlin/blob/main/src/main/kotlin/org/retroachivements/api/RetroInterface.kt |
0 commit comments