VlrDevApi

events.matches()

Get all matches for an event with team IDs and scores

Signature

import vlrdevapi as vlr

result = vlr.events.matches(
    event_id: int,
    stage: str | None = None,
    limit: int | None = None,
    timeout: float = 5.0
) -> list[Match]

Parameters

Prop

Type

Return Value

Type: list[Match]

Returns a list of matches for the event. Each Match object contains:

Prop

Type

MatchTeam fields:

Prop

Type

Examples

Get Event Matches

Get event matches
import vlrdevapi as vlr

# Get matches for an event
matches = vlr.events.matches(event_id=1189, limit=3)

for match in matches:
    team1, team2 = match.teams
    print(f"Match {match.match_id}: {team1.name} vs {team2.name}")
    print(f"  Status: {match.status}")
    print(f"  Stage: {match.stage or 'N/A'}")
    
    if match.status == "completed" and team1.score is not None:
        print(f"  Score: {team1.score}-{team2.score}")

Filter by Stage

Filter by stage
import vlrdevapi as vlr

# Fetch only Playoffs matches using the stage filter
matches = vlr.events.matches(event_id=2498, stage="Playoffs", limit=5)

print(f"Found {len(matches)} playoff matches")
for match in matches:
    team1, team2 = match.teams
    print(f"{team1.name} vs {team2.name} - {match.status}")

Find Ongoing Matches

Find ongoing matches
import vlrdevapi as vlr

# Get matches and filter for ongoing ones
matches = vlr.events.matches(event_id=1189)

ongoing_matches = [m for m in matches if m.status == "ongoing"]

if ongoing_matches:
    print(f" {len(ongoing_matches)} ongoing match(es) in progress:")
    for match in ongoing_matches:
        team1, team2 = match.teams
        print(f"  {team1.name} vs {team2.name}")
        print(f"    Stage: {match.stage or 'Unknown'}")
        print(f"    Current Score: {team1.score or 0}-{team2.score or 0}")
else:
    print("No ongoing matches currently")

Get Match Details with Team IDs

Get match details with team IDs
import vlrdevapi as vlr

# Get matches with enriched team information
matches = vlr.events.matches(event_id=1189, limit=2)

for match in matches:
    team1, team2 = match.teams
    
    print(f"Match ID: {match.match_id}")
    print(f"  {team1.name} (ID: {team1.id}) vs {team2.name} (ID: {team2.id})")
    print(f"  Status: {match.status}")
    
    if match.date:
        print(f"  Date: {match.date}")
    if match.time:
        print(f"  Time: {match.time}")

Error Handling

  • Network failures: Returns an empty list []
  • Invalid event 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.

Source

Data scraped from: https://www.vlr.gg/event/matches/{event_id}