Work with live matches and weekly races
Use the public live overview to find active matches. Weekly races have their own current race and leaderboard.
Get the live overview
live.get() does not require a private key:
import { mcsrranked } from "mcsrranked-sdk";
const live = await mcsrranked.live.get();
console.log(`${live.players} players are online`);
for (const match of live.liveMatches) {
console.log(match.players.map((player) => player.nickname));
}
To inspect one player's private live state, configure authentication first. See authentication and private live data.
Get the current weekly race
const race = await mcsrranked.weeklyRaces.current();
console.log(race.seed);
for (const entry of race.leaderboard) {
console.log(entry.rank, entry.player.nickname, entry.time);
}
Use weeklyRaces.get() to request an earlier race by ID:
Check service status
The status resource reads the public MCSR Ranked status page:
The monitor IDs and status values belong to the status API. See the official API documentation for their current meaning.
Continue with the live, weekly races, or status reference.