@@ -29,7 +29,22 @@ This data can be found on the Supported Game Files page, for example, [Sonic the
2929
3030::: code-group
3131
32- ``` Kotlin
32+ ``` ts [NodeJS]
33+ import { buildAuthorization , getGameHashes } from " @retroachievements/api" ;
34+
35+ // First, build your authorization object.
36+ const username = " <your username on RA>" ;
37+ const webApiKey = " <your web API key>" ;
38+
39+ const authorization = buildAuthorization ({ username , webApiKey });
40+
41+ // Then, make the API call.
42+ const game = await getGameHashes (authorization , {
43+ gameId: 14402 ,
44+ });
45+ ```
46+
47+ ``` kotlin [Kotlin]
3348val credentials = RetroCredentials (" <username>" , " <web api key>" )
3449val api: RetroInterface = RetroClient (credentials).api
3550
@@ -75,11 +90,31 @@ if (response is NetworkResponse.Success) {
7590}
7691```
7792
93+ ``` json [NodeJS]
94+ {
95+ "results" : [
96+ {
97+ "md5" : " 1b1d9ac862c387367e904036114c4825" ,
98+ "name" : " Sonic The Hedgehog (USA, Europe) (Ru) (NewGame).md" ,
99+ "labels" : [" nointro" , " rapatches" ],
100+ "patchUrl" : " https://github.com/RetroAchievements/RAPatches/raw/main/MD/Translation/Russian/1-Sonic1-Russian.zip"
101+ },
102+ {
103+ "md5" : " 1bc674be034e43c96b86487ac69d9293" ,
104+ "name" : " Sonic The Hedgehog (USA, Europe).md" ,
105+ "labels" : [" nointro" ],
106+ "patchUrl" : null
107+ }
108+ ]
109+ }
110+ ```
111+
78112:::
79113
80114## Source
81115
82116| Repo | URL |
83117| :--------- | :------------------------------------------------------------------------------------------------------------------- |
84118| RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetGameHashes.php |
119+ | api-js | https://github.com/RetroAchievements/api-js/blob/main/src/game/getGameHashes.ts |
85120| api-kotlin | https://github.com/RetroAchievements/api-kotlin/blob/main/src/main/kotlin/org/retroachivements/api/RetroInterface.kt |
0 commit comments