Skip to content

Batch player retrieval

NexarClient.get_players() is an efficient way of getting fetching many players in parallel

# List of riot IDs to fetch
riot_ids = [
    "bexli#bex",
    "mltsimpleton#na1",
]

print(f"Fetching {len(riot_ids)} players...")

# Fetch all players in parallel
players = await client.get_players(riot_ids)

print(f"Successfully retrieved {len(players)} players!\n")

NexarClient.get_players() also takes regional arguments

riot_ids_korean: list[str] = []  # Imagine this is populated with Korean players

players_korean = await client.get_players(
    riot_ids_korean,
    region=Region.KR,
)