Get replay
The getReplay
method on a LegacyClient
instance makes a GET
request to the get_replay
endpoint and returns a string containing the Base64 encoded replay if the replay exists, otherwise null.
Example
const replay = await legacyApi.getReplay('user & beatmap id', {
u: 14544646,
b: 2176783
});
Parameters
Parameter | Type | Optional | Description |
---|---|---|---|
by | ‘score id’ | ‘user & beatmap id’ | Get the replay by specifying a score ID or a user ID and a beatmap ID |
if score id
is passed as the value for the parameter by
then the parameters change as follows:
Parameter | Type | Optional | Description |
---|---|---|---|
by | ‘score id’ | Get the replay by specifying a score ID | |
params | GetReplayByScoreIdParams | The request’s URL parameters | |
params.s | number | Replay from a score with a specific score ID | |
params.m | GameMode | ✓ | Replay gamemode |
params.mods | Mod[] | ✓ | Replay with a specific list of mods |
if user & beatmap id
is passed as the value for the parameter by
then the parameters change as follows:
Parameter | Type | Optional | Description |
---|---|---|---|
by | ‘score id’ | Get the replay by specifying a score ID | |
params | GetReplayByScoreIdParams | The request’s URL parameters | |
params.b | number | Replay from a beatmap with a specific beatmap ID | |
params.u | string | number | Replay from a user with a specific user ID or username | |
params.type | UserType | ✓ | Specify if u is a user ID (id ) or a username (string ) |
params.m | GameMode | ✓ | Replay gamemode |
params.mods | Mod[] | ✓ | Replay with a specific list of mods |
Returns
Promise<string | null>;
Possible Exceptions
See the error handling documentation for more information.
invalid_json_syntax
network_error
unexpected_response
Notice that something is missing? Found a typo? Think something's incomplete? Or think that something can be explained better? Feel free to open a pull request or submit an issue on the library's Github repository .