VLRdevAPI

Player Teams

Fetch current and past teams for a player, with join/leave/inactive dates.

player.teams(player_id) returns the current and past teams for a player on vlr.gg.

Signature

player.teams(player_id: int) -> PlayerTeams

Parameters

Prop

Type

Returns - PlayerTeams

Prop

Type

PlayerTeam Fields

Prop

Type

Examples

Current and past teams

Retrieve the player's current and former teams with membership dates.

import vlrdevapi

teams = vlrdevapi.player.teams(player_id=438)

print("Current teams:")
for t in teams.current_teams:
    print(f"  {t.name} (since {t.joined_date})")

print("Past teams:")
for t in teams.past_teams:
    end = t.left_date or t.inactive_date or "present"
    print(f"  {t.name} ({t.joined_date} - {end})")

Team timeline

Build a chronological timeline of every team the player has been on.

import vlrdevapi
from datetime import date

teams = vlrdevapi.player.teams(player_id=438)
all_teams = teams.current_teams + teams.past_teams
for t in sorted(all_teams, key=lambda x: x.joined_date or date.min):
    print(f"{t.joined_date}: Joined {t.name}")
    if t.left_date:
        print(f"{t.left_date}: Left {t.name}")

Curried access

Use the curried player object to access teams without passing the player ID each time.

import vlrdevapi

player = vlrdevapi.player(438)
teams = player.teams()
print(f"Currently on: {[t.name for t in teams.current_teams]}")

Last updated on

On this page