Skip to Content
VLRdevAPI

Series Economy

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

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

Mirrors the buy tiers vlr.gg uses on the economy tab (based on total team spend):

ValueDescriptionTotal Team Spend
BuyType.PISTOLPistol round buy (rounds 1 and 13)-
BuyType.ECOEco buyunder 10,000
BuyType.HALF_BUYHalf-buy10,000 - 18,000
BuyType.FULL_BUYFull-buy18,000+

TeamBuyMatrix Fields

The economy tab's buy-type matrix, per team.

  • pistol / converted / bonus come from the Pistol / Conv. / Bonus summary table: pistol rounds played, the round after a pistol win (conversion), and the round after a conversion (bonus).
  • on_eco / on_half_buy / on_full_buy carry each tier's record, split by the opponent's buy tier.
ValueDescription
pistolPistol rounds won/total (EconScore or None)
convertedRounds after pistol won/total (EconScore or None)
bonusRounds after conversion won/total (EconScore or None)
on_ecoRecord while on eco (BuyTierRecord or None)
on_half_buyRecord while on half buy (BuyTierRecord or None)
on_full_buyRecord while on full buy (BuyTierRecord or None)
ecoAlias for on_eco (read-only property)
half_buyAlias for on_half_buy (read-only property)
full_buyAlias for on_full_buy (read-only property)

BuyTierRecord Fields

ValueDescription
vs_ecoRounds vs opponents on eco (EconScore or None)
vs_halfRounds vs opponents on half buy (EconScore or None)
vs_fullRounds vs opponents on full buy (EconScore or None)
totalCombined won/total across all opponent tiers; None when no matchup was recorded (read-only property)

EconScore Fields

ValueDescriptionTypeDefault
wonRounds wonint0
totalTotal rounds playedint0

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}%)")

Buy matrix from the economy tab

The buy-type matrix is the same data vlr.gg renders on the economy tab: the pistol/conversion/bonus summary and how each team's buys fared against each opponent buy type. Use the flat pistol_team1-style shortcuts for quick reads, the total property for combined per-tier records, and the vs_* cells for detailed breakdowns.

import vlrdevapi

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

# Shortcut: pistol/conversion/bonus summary straight off the result.
print(f"Team 1 pistol rounds: {econ.pistol_team1.won}/{econ.pistol_team1.total}")

full = econ.buy_matrix_team1.full_buy
if full:
    # Combined record on full buy across all opponent tiers.
    print(f"Full buy overall: {full.total.won}/{full.total.total}")
    # Detailed: split by what the opponent was on.
    if full.vs_eco:
        print(f"  vs eco: {full.vs_eco.won}/{full.vs_eco.total}")
    if full.vs_half:
        print(f"  vs half: {full.vs_half.won}/{full.vs_half.total}")
    if full.vs_full:
        print(f"  vs full: {full.vs_full.won}/{full.vs_full.total}")

for team, m in ((econ.team1, econ.buy_matrix_team1), (econ.team2, econ.buy_matrix_team2)):
    print(f"--- {team} ---")
    for label, score in (("Pistol", m.pistol), ("Conversion", m.converted), ("Bonus", m.bonus)):
        if score:
            print(f"  {label}: {score.won}/{score.total}")
    for label, record in (("On eco", m.on_eco), ("On half buy", m.on_half_buy), ("On full buy", m.on_full_buy)):
        if record is None:
            continue
        cells = [
            f"vs eco {record.vs_eco.won}/{record.vs_eco.total}" if record.vs_eco else "vs eco -",
            f"vs half {record.vs_half.won}/{record.vs_half.total}" if record.vs_half else "vs half -",
            f"vs full {record.vs_full.won}/{record.vs_full.total}" if record.vs_full else "vs full -",
        ]
        print(f"  {label}: " + " | ".join(cells))

Attacker / defender round wins

The round timeline (win type and each winner's side) lives in series.rounds, together with the per-round economy, so use it directly:

import vlrdevapi
from collections import Counter

rounds = vlrdevapi.series.rounds(series_id=670471, game_id=1)

for team_name in [rounds.team1, rounds.team2]:
    wins = Counter(
        rd.side
        for rd in rounds.rounds
        if rd.winner_team_name == team_name and rd.side
    )
    print(f"{team_name}: Attack {wins.get('Attack', 0)} - Defense {wins.get('Defense', 0)}")

Force buy and eco round detection

Identify eco rounds, half-buys, 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