Skip to content

Client Reference

Synchronous Client

MCSRRanked

Synchronous client for the MCSR Ranked API.

Methods:

Name Description
__init__

Initialize the MCSR Ranked client.

with_options

Create a new client with modified options.

close

Close the HTTP client.

Attributes:

Name Type Description
users Users

Users resource for user-related API calls.

matches Matches

Matches resource for match-related API calls.

leaderboards Leaderboards

Leaderboards resource for leaderboard-related API calls.

live Live

Live resource for live data API calls.

weekly_races WeeklyRaces

Weekly races resource for weekly race API calls.

users: Users cached property

Users resource for user-related API calls.

matches: Matches cached property

Matches resource for match-related API calls.

leaderboards: Leaderboards cached property

Leaderboards resource for leaderboard-related API calls.

live: Live cached property

Live resource for live data API calls.

weekly_races: WeeklyRaces cached property

Weekly races resource for weekly race API calls.

__init__(*, api_key: str | None = None, private_key: str | None = None, base_url: str | None = None, timeout: float | None = None, max_retries: int | None = None) -> None

Initialize the MCSR Ranked client.

Parameters:

Name Type Description Default
api_key str | None

API key for expanded rate limits. Falls back to MCSRRANKED_API_KEY env var.

None
private_key str | None

Private key for accessing live data. Falls back to MCSRRANKED_PRIVATE_KEY env var.

None
base_url str | None

Base URL for the API (default: https://api.mcsrranked.com).

None
timeout float | None

Request timeout in seconds (default: 30).

None
max_retries int | None

Maximum number of retries (default: 2).

None

with_options(*, api_key: str | None = None, private_key: str | None = None, base_url: str | None = None, timeout: float | None = None, max_retries: int | None = None) -> MCSRRanked

Create a new client with modified options.

Parameters:

Name Type Description Default
api_key str | None

API key (default: inherit from current client).

None
private_key str | None

Private key (default: inherit from current client).

None
base_url str | None

Base URL (default: inherit from current client).

None
timeout float | None

Request timeout (default: inherit from current client).

None
max_retries int | None

Max retries (default: inherit from current client).

None

Returns:

Type Description
MCSRRanked

New client instance with modified options.

close() -> None

Close the HTTP client.


Asynchronous Client

AsyncMCSRRanked

Asynchronous client for the MCSR Ranked API.

Methods:

Name Description
__init__

Initialize the async MCSR Ranked client.

with_options

Create a new client with modified options.

close

Close the HTTP client.

Attributes:

Name Type Description
users AsyncUsers

Users resource for user-related API calls.

matches AsyncMatches

Matches resource for match-related API calls.

leaderboards AsyncLeaderboards

Leaderboards resource for leaderboard-related API calls.

live AsyncLive

Live resource for live data API calls.

weekly_races AsyncWeeklyRaces

Weekly races resource for weekly race API calls.

users: AsyncUsers cached property

Users resource for user-related API calls.

matches: AsyncMatches cached property

Matches resource for match-related API calls.

leaderboards: AsyncLeaderboards cached property

Leaderboards resource for leaderboard-related API calls.

live: AsyncLive cached property

Live resource for live data API calls.

weekly_races: AsyncWeeklyRaces cached property

Weekly races resource for weekly race API calls.

__init__(*, api_key: str | None = None, private_key: str | None = None, base_url: str | None = None, timeout: float | None = None, max_retries: int | None = None) -> None

Initialize the async MCSR Ranked client.

Parameters:

Name Type Description Default
api_key str | None

API key for expanded rate limits. Falls back to MCSRRANKED_API_KEY env var.

None
private_key str | None

Private key for accessing live data. Falls back to MCSRRANKED_PRIVATE_KEY env var.

None
base_url str | None

Base URL for the API (default: https://api.mcsrranked.com).

None
timeout float | None

Request timeout in seconds (default: 30).

None
max_retries int | None

Maximum number of retries (default: 2).

None

with_options(*, api_key: str | None = None, private_key: str | None = None, base_url: str | None = None, timeout: float | None = None, max_retries: int | None = None) -> AsyncMCSRRanked

Create a new client with modified options.

Parameters:

Name Type Description Default
api_key str | None

API key (default: inherit from current client).

None
private_key str | None

Private key (default: inherit from current client).

None
base_url str | None

Base URL (default: inherit from current client).

None
timeout float | None

Request timeout (default: inherit from current client).

None
max_retries int | None

Max retries (default: inherit from current client).

None

Returns:

Type Description
AsyncMCSRRanked

New client instance with modified options.

close() -> None async

Close the HTTP client.


Module-Level Access

The SDK provides module-level access without creating a client:

import mcsrranked

user = mcsrranked.users.get("Feinberg")
matches = mcsrranked.matches.list()

Note

Module-level access uses a lazily-created internal client. For async usage, you must use AsyncMCSRRanked explicitly.