players.matches()
Get a player's match history
Signature
import vlrdevapi as vlr
result = vlr.players.matches(
player_id: int,
limit: int | None = None,
page: int | None = None,
timeout: float = 5.0
) -> list[Match]Parameters
Prop
Type
Return Value
Type: list[Match]
Returns a list of player matches. Each Match object contains:
Prop
Type
MatchTeam fields:
Prop
Type
Examples
Get Player Match History
import vlrdevapi as vlr
# Get recent matches for a player
matches = vlr.players.matches(player_id=123, limit=10)
for m in matches:
print(f"{m.event} - {m.stage} {m.phase}")
print(f" {m.player_team.name} vs {m.opponent_team.name}")
if m.result:
score = f"{m.player_score}-{m.opponent_score}" if m.player_score is not None else "N/A"
print(f" Result: {m.result.upper()} ({score})")
if m.date:
print(f" Date: {m.date}")Analyze Player Performance
import vlrdevapi as vlr
from collections import Counter
# Get player matches
matches = vlr.players.matches(player_id=123, limit=50)
# Count wins/losses
results = Counter(m.result for m in matches if m.result)
print(f"Recent Performance ({len(matches)} matches):")
print(f" Wins: {results['win']}")
print(f" Losses: {results['loss']}")
print(f" Draws: {results.get('draw', 0)}")
if results['win'] + results['loss'] > 0:
win_rate = results['win'] / (results['win'] + results['loss']) * 100
print(f" Win Rate: {win_rate:.1f}%")Browse with Pagination
import vlrdevapi as vlr
# Get page 2 of player matches
matches = vlr.players.matches(player_id=123, page=2)
print(f"Found {len(matches)} matches on page 2")
for m in matches:
print(f"{m.event}: {m.result or 'TBD'}")Filter by Event
import vlrdevapi as vlr
# Get all matches and filter
matches = vlr.players.matches(player_id=123, limit=100)
# Filter for VCT matches
vct_matches = [m for m in matches if m.event and "VCT" in m.event]
print(f"VCT matches: {len(vct_matches)}")
for m in vct_matches:
print(f"{m.event} - {m.stage}: {m.result}")Get Match Details
import vlrdevapi as vlr
# Get player matches
matches = vlr.players.matches(player_id=123, limit=5)
for m in matches:
print(f"\nMatch {m.match_id}:")
print(f" Event: {m.event}")
print(f" Stage: {m.stage} - {m.phase}")
print(f" Teams: {m.player_team.name} vs {m.opponent_team.name}")
# Get detailed series info
# series_info = vlr.series.info(m.match_id)
# if series_info:
# for map_data in series_info.maps:
# print(f" {map_data.map_name}: {map_data.team1_score}-{map_data.team2_score}")Error Handling
- Network failures: Returns an empty list
[] - Invalid player ID: Returns an empty list
[] - No matches found: Returns an empty list
[]
The function never raises exceptions, making it safe to use without try-catch blocks.
Tips
- The
stagefield contains tournament stage (e.g., "Group Stage", "Playoffs") - The
phasefield contains specific phase within stage (e.g., "W1", "GF") - Combine with
series.info(match_id)for detailed per-map statistics - Use pagination to browse through extensive match history
- Check
resultforNonebefore using (upcoming/TBD matches) - Scores represent maps won, not rounds
Related
Source
Data scraped from: https://www.vlr.gg/player/matches/{player_id}