Locations¶
- class clash_royale.Locations[source]¶
Bases:
ResourceResource for location-related endpoints.
Check the locations API docs for more detailed information about each endpoint.
- list(**params: Unpack[PaginationParams]) PaginatedList[Location][source]¶
List all available locations.
- get(location_id: int) Location[source]¶
Get location information by ID.
- Parameters:
location_id – The location ID from the locations list.
- get_clan_rankings(location_id: int, **params: Unpack[PaginationParams]) PaginatedList[ClanRanking][source]¶
Get clan rankings for a specific location.
- Parameters:
location_id – The location ID from the locations list.
- get_player_rankings(location_id: int, **params: Unpack[PaginationParams]) PaginatedList[PlayerRanking][source]¶
Get player rankings for a specific location.
- Parameters:
location_id – The location ID from the locations list.
- get_clan_war_rankings(location_id: int, **params: Unpack[PaginationParams]) PaginatedList[ClanRanking][source]¶
Get clan war rankings for a specific location.
- Parameters:
location_id – The location ID from the locations list.
- get_path_of_legend_player_rankings(location_id: int, **params: Unpack[PaginationParams]) PaginatedList[PlayerPathOfLegendRanking][source]¶
Get player rankings in Path of Legend for a specific location.
- Parameters:
location_id – The location ID from the locations list.
- get_path_of_legend_season_rankings(season_id: str, **params: Unpack[PaginationParams]) PaginatedList[PlayerPathOfLegendRanking][source]¶
Get top Path of Legend players for a given season.
- Parameters:
season_id – The season ID (e.g., “2024-01”).
- get_season(season_id: str) LeagueSeason | LeagueSeasonV2[source]¶
Get top player league season.
This method automatically selects the appropriate API endpoint based on the
season_idformat:Numeric ID (e.g.,
"1","2"): Uses the V2 endpoint and returnsLeagueSeasonV2.Date-based code (e.g.,
"2016-02","2025-07"): Uses the legacy endpoint and returnsLeagueSeason.
Warning
The Clash Royale API may occasionally return incomplete season data with null values. This is a known API issue, not a library bug.
- Parameters:
season_id – Identifier of the season. Can be either a numeric unique ID (e.g.,
"1") or a date-based code (e.g.,"2016-02").- Returns:
LeagueSeasonV2ifseason_idis numeric, otherwiseLeagueSeason.
- get_season_player_rankings(season_id: str, **params: Unpack[PaginationParams]) PaginatedList[PlayerSeasonRanking][source]¶
Get top player rankings for a season.
- Parameters:
season_id – The season ID (e.g., “2017-03”).
- list_seasons() PaginatedList[LeagueSeason][source]¶
List top player league seasons.
Warning
The Clash Royale API may occasionally return incomplete season data with null values. This is a known API issue, not a library bug. Consider using
list_seasons_v2()instead.
- list_seasons_v2() PaginatedList[LeagueSeasonV2][source]¶
List league seasons with more details.
Warning
The Clash Royale API may occasionally return incomplete season data with null values. This is a known API issue, not a library bug.
- get_global_tournament_rankings(tournament_tag: str, **params: Unpack[PaginationParams]) PaginatedList[LadderTournamentRanking][source]¶
Get global tournament rankings.