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

ParameterTypeOptionalDescription
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:

ParameterTypeOptionalDescription
by‘score id’Get the replay by specifying a score ID
paramsGetReplayByScoreIdParamsThe request’s URL parameters
params.snumberReplay from a score with a specific score ID
params.mGameModeReplay gamemode
params.modsMod[]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:

ParameterTypeOptionalDescription
by‘score id’Get the replay by specifying a score ID
paramsGetReplayByScoreIdParamsThe request’s URL parameters
params.bnumberReplay from a beatmap with a specific beatmap ID
params.ustring | numberReplay from a user with a specific user ID or username
params.typeUserTypeSpecify if u is a user ID (id) or a username (string)
params.mGameModeReplay gamemode
params.modsMod[]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 .