Player Agents
Fetch per-agent statistics for a player - rating, ACS, K/D, ADR, KAST, and more over a configurable timespan.
player.agents(player_id, timespan) returns detailed per-agent statistics for a player on vlr.gg.
Signature
player.agents(
player_id: int,
timespan: Literal["30d", "60d", "90d", "all"] = "all",
) -> AgentStatsPageParameters
Prop
Type
Returns - AgentStatsPage
Prop
Type
AgentStats Fields
Prop
Type
Examples
Agent stats with default timespan
Fetch per-agent statistics using the default 'all' timespan.
import vlrdevapi
stats = vlrdevapi.player.agents(player_id=438)
print(f"Timespan: {stats.timespan}")
for a in stats.agents:
print(f"{a.agent}: {a.rounds}r | {a.rating} rating | {a.acs} ACS | {a.kd} KD")Filter by last 60 days
Limit agent stats to the last 60 days of play.
import vlrdevapi
stats = vlrdevapi.player.agents(player_id=438, timespan="60d")
for a in stats.agents:
rnd = a.rounds or 0
rat = f"{a.rating:.2f}" if a.rating is not None else "N/A"
acs = f"{a.acs:.1f}" if a.acs is not None else "N/A"
kd = f"{a.kd:.2f}" if a.kd is not None else "N/A"
adr = f"{a.adr:.1f}" if a.adr is not None else "N/A"
print(f"{a.agent:>8} | {rnd:>3}r | R={rat} | ACS={acs} | K/D={kd} | ADR={adr}")Find most played agent
Identify the agent the player has played the most rounds on.
import vlrdevapi
stats = vlrdevapi.player.agents(player_id=438, timespan="all")
most_played = max(stats.agents, key=lambda a: a.rounds or 0)
print(f"Most played: {most_played.agent} ({most_played.rounds} rounds)")
print(f"Rating: {most_played.rating} | KD: {most_played.kd} | ACS: {most_played.acs}")Curried access
Use the curried player object to access agent stats without passing the player ID each time.
import vlrdevapi
player = vlrdevapi.player(438)
stats = player.agents(timespan="90d")
for a in stats.agents:
rnd = a.rounds or 0
rat = f"{a.rating:.2f}" if a.rating is not None else "N/A"
print(f"{a.agent}: {rat} rating over {rnd} rounds")Last updated on