Examples¶
Working code examples demonstrating common usage patterns for the Riot Games API.
All examples are shown using the async RiotClient. You can use SyncRiotClient as a drop-in replacement — just remove async/await and use with instead of async with:
# Async
async with RiotClient() as client:
account = await client.account.get_by_riot_id(...)
# Sync — same API, no async needed
with SyncRiotClient() as client:
account = client.account.get_by_riot_id(...)
Available Examples¶
-
Summoner lookups, match history, champion mastery, live game spectator, error handling
-
TFT summoner data, match history, ranked leaderboards
-
Content data, platform status
Running the Examples¶
All examples require:
- A valid Riot API key set as
RIOT_API_KEYenvironment variable - The
riotskillissuepackage installed
Included Example Scripts¶
The /examples directory in the repository contains runnable Python scripts:
| Script | Description |
|---|---|
basic_usage.py |
Account lookup and summoner data |
match_history.py |
Fetching and processing match history |
champion_mastery.py |
Champion mastery rankings |