pub struct VlrClient { /* private fields */ }Expand description
The main entry point for interacting with VLR.gg.
VlrClient wraps a [reqwest::Client] and exposes methods
to fetch events, match lists, match details, player profiles, and player match histories.
§Examples
use vlr_scraper::{AgentStatsTimespan, EventType, Region, VlrClient};
let client = VlrClient::new();
let events = client
.get_events(EventType::Upcoming, Region::All, 1)
.await?;
println!("Found {} events", events.events.len());
// Fetch a player profile
let player = client.get_player(17323, Default::default()).await?;
println!("{} ({:?})", player.info.name, player.info.country);Implementations§
Source§impl VlrClient
impl VlrClient
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new client with default settings.
Uses a default [reqwest::Client] with no custom configuration.
For custom timeouts, proxies, or headers, use VlrClient::with_client.
Sourcepub fn with_client(client: Client) -> Self
pub fn with_client(client: Client) -> Self
Create a new client using the provided [reqwest::Client].
Use this when you need to configure timeouts, proxies, headers, or other HTTP-level settings.
§Examples
use vlr_scraper::VlrClient;
let http = reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(10))
.build()
.unwrap();
let client = VlrClient::with_client(http);Sourcepub async fn get_events(
&self,
event_type: EventType,
region: Region,
page: u8,
) -> Result<EventsData>
pub async fn get_events( &self, event_type: EventType, region: Region, page: u8, ) -> Result<EventsData>
Fetch a paginated list of events, filtered by type and region.
Returns an EventsData containing a page of Event entries together
with pagination info (page and total_pages). Each event includes its
status, region, title, dates, icon URL, and price tier.
§Arguments
event_type- Whether to retrieveEventType::UpcomingorEventType::Completedevents.region- Geographic filter (useRegion::Allfor no filtering).page- Page number (1-indexed).
§Examples
use vlr_scraper::{EventType, Region, VlrClient};
let client = VlrClient::new();
let data = client
.get_events(EventType::Upcoming, Region::Europe, 1)
.await?;
for event in &data.events {
println!("[{}] {} ({})", event.status, event.title, event.dates);
}Sourcepub async fn get_event_matchlist(&self, event_id: u32) -> Result<EventMatchList>
pub async fn get_event_matchlist(&self, event_id: u32) -> Result<EventMatchList>
Fetch all matches belonging to an event.
Returns an EventMatchList (a Vec<EventMatchListItem>) where each item contains
the match ID, slug, date/time, participating teams with scores, tags, and
event series text.
§Arguments
event_id- The VLR.gg event ID (found inEvent::id).
§Examples
use vlr_scraper::VlrClient;
let client = VlrClient::new();
let matches = client.get_event_matchlist(2095).await?;
for m in &matches {
let teams: Vec<_> = m.teams.iter().map(|t| t.name.as_str()).collect();
println!("{} — {}", teams.join(" vs "), m.event_series_text);
}Sourcepub async fn get_match(&self, match_id: u32) -> Result<Match>
pub async fn get_match(&self, match_id: u32) -> Result<Match>
Fetch full details for a specific match by ID.
Returns a Match containing:
MatchHeader— event info, date, and team names/scores- Live streams and VOD links as
MatchStreamentries - Per-map
MatchGamedata with team scores, player stats, and round-by-round outcomes
§Arguments
match_id- The VLR.gg match ID (found inEventMatchListItem::id).
§Examples
use vlr_scraper::VlrClient;
let client = VlrClient::new();
let m = client.get_match(429519).await?;
println!("{} — {}", m.header.event_title, m.header.event_series_name);
for game in &m.games {
println!(
" {} — {} vs {}",
game.map, game.teams[0].name, game.teams[1].name
);
}Sourcepub async fn get_player_matchlist(
&self,
player_id: u32,
page: u8,
) -> Result<PlayerMatchList>
pub async fn get_player_matchlist( &self, player_id: u32, page: u8, ) -> Result<PlayerMatchList>
Fetch a paginated list of matches a player has participated in.
Returns a PlayerMatchList (a Vec<PlayerMatchListItem>) where each
entry contains the match ID, league name and icon, participating teams
with scores, VOD links, and a match start timestamp.
§Arguments
player_id- The VLR.gg player ID.page- Page number (1-indexed).
§Examples
use vlr_scraper::VlrClient;
let client = VlrClient::new();
let matches = client.get_player_matchlist(17323, 1).await?;
for m in &matches {
let teams: Vec<_> = m.teams.iter().map(|t| t.name.as_str()).collect();
println!("[{}] {}", m.league_name, teams.join(" vs "));
}Sourcepub async fn get_player(
&self,
player_id: u32,
timespan: AgentStatsTimespan,
) -> Result<Player>
pub async fn get_player( &self, player_id: u32, timespan: AgentStatsTimespan, ) -> Result<Player>
Fetch a complete player profile including info, teams, agent stats, news, and event placements.
The returned Player contains:
PlayerInfo— name, real name, avatar URL, country/country code, and social links- Current and past
PlayerTeamentries with team ID, name, logo, and join info PlayerAgentStatsfor the given timespan (rating, ACS, K/D, ADR, KAST, etc.)- Recent
PlayerNewsItemarticles mentioning the player EventPlacementhistory with per-stage results and total winnings
§Arguments
player_id- The VLR.gg player ID.timespan- Time window for agent statistics (seeAgentStatsTimespan).
§Examples
use vlr_scraper::{AgentStatsTimespan, VlrClient};
let client = VlrClient::new();
let player = client.get_player(17323, AgentStatsTimespan::All).await?;
println!("{} ({:?})", player.info.name, player.info.country);
for team in &player.current_teams {
println!(" team: {}", team.name);
}
for stat in &player.agent_stats {
println!(
" {} — rating {:.2}, K/D {:.2}",
stat.agent, stat.rating, stat.kd
);
}Sourcepub async fn get_team_matchlist(
&self,
team_id: u32,
page: u8,
) -> Result<Vec<MatchItem>>
pub async fn get_team_matchlist( &self, team_id: u32, page: u8, ) -> Result<Vec<MatchItem>>
Fetch a paginated list of matches a team has participated in.
Returns a Vec<MatchItem> where each entry contains the match ID,
league name and icon, participating teams with scores, VOD links, and
a match start timestamp.
§Arguments
team_id- The VLR.gg team ID.page- Page number (1-indexed).
§Examples
use vlr_scraper::VlrClient;
let client = VlrClient::new();
let matches = client.get_team_matchlist(6530, 1).await?;
for m in &matches {
let teams: Vec<_> = m.teams.iter().map(|t| t.name.as_str()).collect();
println!("[{}] {}", m.league_name, teams.join(" vs "));
}Sourcepub async fn get_team_transactions(
&self,
team_id: u32,
) -> Result<Vec<TeamTransaction>>
pub async fn get_team_transactions( &self, team_id: u32, ) -> Result<Vec<TeamTransaction>>
Fetch a team’s roster transaction history (joins, leaves, inactive changes).
Returns a Vec<TeamTransaction> where each entry contains the date,
action type, player info (id, alias, real name, country code), position,
and an optional reference URL.
§Arguments
team_id- The VLR.gg team ID (found in team page URLs).
§Examples
use vlr_scraper::VlrClient;
let client = VlrClient::new();
let transactions = client.get_team_transactions(6530).await?;
for txn in &transactions {
println!(
"{:?} — {} {} ({})",
txn.date, txn.action, txn.player_alias, txn.position
);
}Sourcepub async fn get_team(&self, team_id: u32) -> Result<Team>
pub async fn get_team(&self, team_id: u32) -> Result<Team>
Fetch a complete team profile including info, roster, event placements, and total winnings.
The returned Team contains:
TeamInfo— name, tag, logo URL, country/country code, and social linksTeamRosterMemberentries with player/staff info, roles, and captain statusEventPlacementhistory with stage results and prize earnings- Total career winnings as an optional string
§Arguments
team_id- The VLR.gg team ID (found in team page URLs).
§Examples
use vlr_scraper::VlrClient;
let client = VlrClient::new();
let team = client.get_team(6530).await?;
println!("{} ({:?})", team.info.name, team.info.tag);
for member in &team.roster {
println!(" {} — {}", member.alias, member.role);
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for VlrClient
impl !RefUnwindSafe for VlrClient
impl Send for VlrClient
impl Sync for VlrClient
impl Unpin for VlrClient
impl !UnwindSafe for VlrClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more