@@ -29,7 +29,22 @@ This data can be found on the Supported Game Files page, for example, [Sonic the
29
29
30
30
::: code-group
31
31
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]
33
48
val credentials = RetroCredentials (" <username>" , " <web api key>" )
34
49
val api: RetroInterface = RetroClient (credentials).api
35
50
@@ -75,11 +90,31 @@ if (response is NetworkResponse.Success) {
75
90
}
76
91
```
77
92
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
+
78
112
:::
79
113
80
114
## Source
81
115
82
116
| Repo | URL |
83
117
| :--------- | :------------------------------------------------------------------------------------------------------------------- |
84
118
| 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 |
85
120
| api-kotlin | https://github.com/RetroAchievements/api-kotlin/blob/main/src/main/kotlin/org/retroachivements/api/RetroInterface.kt |
0 commit comments