search.search_events()
Search for events
Signature
import vlrdevapi as vlr
result = vlr.search.search_events(
query: str,
timeout: float = 5.0
) -> list[SearchEventResult]Parameters
Prop
Type
Return Value
Type: list[SearchEventResult]
Returns a list of event search results.
Prop
Type
Examples
Search for Events
import vlrdevapi as vlr
# Search for events
events = vlr.search.search_events("champions")
print(f"Found {len(events)} events")
for e in events:
print(f"{e.name}")
print(f" Dates: {e.date_range}")
print(f" Prize: {e.prize}")
print(f" URL: {e.url}")Get Event Details
import vlrdevapi as vlr
import time
# Search and get full info
events = vlr.search.search_events("vct")
for event in events[:3]: # First 3 results
print(f"\nFound: {event.name}")
# Get detailed event info
event_info = vlr.events.info(event.event_id)
if event_info:
print(f" Name: {event_info.name}")
print(f" Prize: {event_info.prize}")
print(f" Location: {event_info.location}")
print(f" Dates: {event_info.date_text}")
time.sleep(1) # Small delay to avoid overwhelming the serverSearch and Get Matches
import vlrdevapi as vlr
# Search for event
events = vlr.search.search_events("masters")
if events:
event = events[0] # First result
print(f"Event: {event.name}")
# Get matches for this event
matches = vlr.events.matches(event.event_id, limit=5)
print(f"\nUpcoming matches: {len(matches)}")
for match in matches:
print(f" {match.teams[0].name} vs {match.teams[1].name}")Error Handling
- Network failures: Returns an empty list
[] - No results found: Returns an empty list
[] - Empty query: Returns an empty list
[]
The function never raises exceptions, making it safe to use without try-catch blocks.
Tips
- Check list length before accessing results:
if events: - All optional fields can be
None- check before using - Use the
event_idto fetch detailed information withevents.info() - Combine with
events.matches()to get event matches - The
prizefield includes currency formatting from VLR.gg
Related
Source
Data scraped from: https://www.vlr.gg/search/?q={query}&type=events