Client¶
The async client class for querying the Clash Royale API.
- class clash_royale.aio.Client[source]¶
Bases:
AsyncClientAn async client to retrieve data from the Clash Royale API.
Create a client instance with the given options.
>>> from clash_royale.aio import Client >>> async with Client(api_key="your_api_key_here") as client: ... player = await client.players.get("#ABC123")
This client provides several methods to retrieve the content most kinds of Clash Royale objects, based on their json structure.
If your server does not have a static IP address, you can use a proxy server by setting the proxy parameter.
>>> client = Client( api_key="your_api_key_here", proxy="https://my.proxy.com", )
For more detail about proxy usage, check the usage section of the documentation.
- Parameters:
api_key – The Clash Royale API key.
proxy – Proxy URL (default: None).
timeout – Request timeout in seconds (default: 10.0).
base_url – Base URL for the API (default: https://api.clashroyale.com/v1).
- __init__(api_key: str, proxy: str | None = None, timeout: float = 10.0, base_url: str = 'https://api.clashroyale.com/v1')[source]¶
- tournaments: Tournaments¶
- leaderboards: Leaderboards¶
- global_tournaments: GlobalTournaments¶