VLRdevAPI

Series Economy

Fetch economy data per round for a game - team bank, spend, buy type, and round winner.

series.economy(series_id, game_id) returns economy data for each round of a specific game within a series.

Signature

series.economy(
    series_id: int,
    game_id: int,
) -> EconomyData

With curried access:

vlrdevapi.series(series_id).economy(game_id: int) -> EconomyData

Parameters

Prop

Type

Returns - EconomyData

Prop

Type

RoundEconomyData Fields

Prop

Type

RoundWinner Fields

Prop

Type

BuyType Values

ValueDescriptionTotal Team Spend
BuyType.ECOEco buy0 - 5,000
BuyType.SEMI_ECOSemi-eco5,000 - 10,000
BuyType.SEMI_BUYSemi-buy10,000 - 20,000
BuyType.FULL_BUYFull-buy20,000+

Examples

Basic economy dump

Print the economy state for every round - how much each team had in the bank, what they spent, and what buy type they went with.

import vlrdevapi

econ = vlrdevapi.series.economy(series_id=670471, game_id=1)
print(f"{econ.team1} vs {econ.team2}")
print()

for rd in econ.rounds[:5]:
    buy1 = f"{rd.buy_type_team1:>9}"
    buy2 = f"{rd.buy_type_team2:>9}"
    tag = " (PISTOL)" if rd.is_pistol_round else ""
    print(f"R{rd.round_number:>2}: {econ.team1:>15} bank={rd.bank_team1:>6} spent={rd.spent_team1:>5} [{buy1}]")
    print(f"     {econ.team2:>15} bank={rd.bank_team2:>6} spent={rd.spent_team2:>5} [{buy2}]")
    print(f"     -> Winner: {rd.winner.name}{tag}")

Buy type analysis

Analyse how buy types correlate with round wins. This shows which team won full-buy rounds, eco rounds, etc.

import vlrdevapi
from collections import Counter

econ = vlrdevapi.series.economy(series_id=670471, game_id=1)

for team_name in [econ.team1, econ.team2]:
    team_buys = Counter()
    team_wins = Counter()
    for rd in econ.rounds:
        buy = rd.buy_type_team1 if team_name == econ.team1 else rd.buy_type_team2
        team_buys[buy] += 1
        if rd.winner.name == team_name:
            team_wins[buy] += 1
    print(f"\n--- {team_name} ---")
    for buy_type, total in team_buys.items():
        wins = team_wins.get(buy_type, 0)
        pct = wins / total * 100 if total else 0
        print(f"  {buy_type}: {wins}/{total} wins ({pct:.0f}%)")

Force buy and eco round detection

Identify eco rounds, force buys (semi-buy with low bank), and full-buy rounds. These are often key turning points in a match.

import vlrdevapi
from vlrdevapi._series.economy import BuyType

econ = vlrdevapi.series.economy(series_id=670471, game_id=1)

found = 0
for rd in econ.rounds:
    if rd.buy_type_team1 == BuyType.ECO.value and rd.buy_type_team2 == BuyType.ECO.value:
        print(f"R{rd.round_number}: Double eco")
        found += 1
    elif rd.buy_type_team1 == BuyType.FULL_BUY.value and rd.buy_type_team2 != BuyType.FULL_BUY.value:
        print(f"R{rd.round_number}: {econ.team1} full-buy vs {econ.team2} {rd.buy_type_team2}")
        found += 1
if not found:
    print("No force/eco round patterns found in this game")

Pistol round analysis

Pistol rounds (rounds 1 and 13) are critical. Check who won them and what the economy looked like.

import vlrdevapi

econ = vlrdevapi.series.economy(series_id=670471, game_id=1)

pistols = [rd for rd in econ.rounds if rd.is_pistol_round]
for rd in pistols:
    print(f"Pistol R{rd.round_number}: {rd.winner.name} won")
    print(f"  {econ.team1}: bank={rd.bank_team1} spent={rd.spent_team1}")
    print(f"  {econ.team2}: bank={rd.bank_team2} spent={rd.spent_team2}")

Curried access

Analyse full-buy round outcomes using the curried access pattern.

import vlrdevapi
from vlrdevapi._series.economy import BuyType

series = vlrdevapi.series(670471)
econ = series.economy(game_id=1)

full_buy_wins = {"team1": 0, "team2": 0}
for rd in econ.rounds:
    if rd.buy_type_team1 == BuyType.FULL_BUY and rd.winner.name == econ.team1:
        full_buy_wins["team1"] += 1
    if rd.buy_type_team2 == BuyType.FULL_BUY and rd.winner.name == econ.team2:
        full_buy_wins["team2"] += 1
print(f"Full-buy wins: {econ.team1} {full_buy_wins['team1']} - {full_buy_wins['team2']} {econ.team2}")

Last updated on

On this page