CS2 data in Python, in ten lines.
Plain HTTPS and JSON, so requests is all you need: one helper, then live scores, results and a player's form. Paste the key into CITO_API_KEY and run.
- requests only
- JSON in, dicts out
- 500 free requests / month
{ "data": [ ... { "team1Name": "Iberian Soul", "team2Name": "Butterfly", "score": { "team1": 0, "team2": 0 }, "currentMap": "de_mirage", "currentMapScore": { "team1": 5, "team2": 13 }, "currentRound": 18 } ]}Seamless Integration with our MCP Server
Prefer an assistant writing the Python? One command gives Claude or Cursor the CS2 tools, so the code it writes calls real endpoints with real IDs.
MCPInstall the Cito MCP serverWhat Python projects build
The usual first scripts, each a single call.
Live tickers
Print or push every match in progress.
Result feeds
Recent results into a database or a post.
Player models
Per-map stats into pandas for analysis.
Rankings snapshots
Store the VRS table every week.
Schedulers
Upcoming matches into reminders and calendars.
Notebooks
Explore the API in Jupyter with one helper.
Replacing an HLTV scraper in Python?
Python HLTV libraries scrape hltv.org, which now answers scripts with a Cloudflare 403. The HLTV API in Python guide swaps each scraper call for one of these endpoints.
Live scores in Python
Set CITO_API_KEY in your environment, then run.
import os
import requests
API = "https://api.citoapi.com/api/v1"
HEADERS = {"x-api-key": os.environ["CITO_API_KEY"]}
def get(path, **params):
r = requests.get(f"{API}{path}", headers=HEADERS, params=params, timeout=10)
r.raise_for_status()
return r.json()
# Every CS2 match in progress
for m in get("/cs2/live")["data"]:
ms = m.get("currentMapScore") or {}
print(f'{m["team1Name"]} {m["team1Score"]}-{m["team2Score"]} {m["team2Name"]} | '
f'{m["currentMap"]} {ms.get("team1", 0)}-{ms.get("team2", 0)}, round {m["currentRound"]}')Results and player stats
The same helper, two more endpoints.
# Last five results
for m in get("/cs2/matches/recent", limit=5)["data"]:
print(f'{m["eventName"]}: {m["team1Name"]} {m["team1Score"]}-{m["team2Score"]} {m["team2Name"]}')
# ZywOo's recent maps
for row in get("/cs2/players/zywoo/form", limit=5)["data"]:
print(row["map"]["mapName"], row["kills"], row["deaths"], row["adr"], row["rating"])Endpoints you can ship with
Every route here works from requests.get.
Live matches
Poll the live list for every match in progress, open one match for its round, timer, bomb and players, or keep an SSE stream open and get each update pushed.
- GET
/api/v1/cs2/liveMatches in progress: series score, map in play, map score, current round.
- GET
/api/v1/cs2/live/{matchId}/stateOne live match: score, round, round timer, bomb status and players.
- GET
/api/v1/cs2/live/{matchId}/scoreboardSeries score, current map and round, and each player's kills, deaths, money and equipment.
- GET
/api/v1/cs2/live/{matchId}/roundsRound-by-round results so far: winner, side and how each round ended.
- GET
/api/v1/cs2/live/streamServer-Sent Events push of every live update. Every plan; counts like polling.
- GET
/api/v1/cs2/live/wsWebSocket with a room per match. Scale and Enterprise; Pro with the Live WebSockets add-on.
Results
Finished matches with the series score and winner, every map and its score, and the player lines behind them.
- GET
/api/v1/cs2/matches/recentFinished matches with final series score and winner, newest first.
- GET
/api/v1/cs2/matches/{matchId}One match: event, teams, series score, and maps.
- GET
/api/v1/cs2/matches/{matchId}/mapsEach map: name, score, winner, and the team that picked it.
- GET
/api/v1/cs2/matches/{matchId}/player-statsPer-player stats for each map: kills, deaths, ADR, KAST and rating.
- GET
/api/v1/cs2/teams/{teamIdOrSlug}/resultsOne team's finished matches, newest first.
- GET
/api/v1/cs2/events/{eventIdOrSlug}/resultsFinal placements and prize money of a tournament.
Schedule
What is on next: upcoming matches soonest first, today's slate, one team's fixtures, and the tournament calendar.
- GET
/api/v1/cs2/matches/upcomingScheduled matches, soonest first.
- GET
/api/v1/cs2/matches/todayMatches scheduled, live or finished today (UTC).
- GET
/api/v1/cs2/teams/{teamIdOrSlug}/upcomingOne team's scheduled matches.
- GET
/api/v1/cs2/events/upcomingScheduled tournaments, soonest first.
- GET
/api/v1/cs2/events/calendarTournaments in a date range, with from and to.
- GET
/api/v1/cs2/matches/{matchId}/streamsBroadcast links for a match, when known.
Odds & models
Match and map winner prices with implied probability, liquidity and spread, every price change since the market opened, and the team form, map stats and head-to-head a model needs next to them.
- GET
/api/v1/cs2/matches/upcoming?include=oddsUpcoming matches with each one's current market prices attached.
- GET
/api/v1/cs2/matches/{matchId}/oddsMatch and map winner odds: decimal price, implied probability, liquidity, spread, status.
- GET
/api/v1/cs2/matches/{matchId}/odds/historyEvery captured price change for the match and each map, oldest first.
- GET
/api/v1/cs2/teams/{teamIdOrSlug}/formA team's recent results and win rate.
- GET
/api/v1/cs2/teams/{teamIdOrSlug}/map-statsWin rate and matches played on each map.
- GET
/api/v1/cs2/h2h/{teamIdOrSlug}/{opponentIdOrSlug}Head-to-head record and the meetings behind it.
Positions & heatmaps
Where every grenade went off, where each kill and death happened, and where the bomb was planted, in game coordinates and already placed on the map's radar, plus heatmaps per map or per player.
- GET
/api/v1/cs2/maps/{mapId}/utilityEvery smoke, flash, HE and molotov on a map: landing spot, thrower, round, duration.
- GET
/api/v1/cs2/maps/{mapId}/positionsGrenades, bomb plants and kills with attacker and victim spots and callouts, in order.
- GET
/api/v1/cs2/maps/{mapId}/heatmap?kind=smokeCounts per radar cell for smokes, flashes, molotovs, plants, kills or deaths.
- GET
/api/v1/cs2/players/{playerIdOrSlug}/utility?map=MirageWhere one player's grenades land across recent maps, with a heatmap.
- GET
/api/v1/cs2/map-radarsRadar calibration per map to draw any point on a radar image.
Player stats
K/D and rating per map played (ADR and KAST on over 95% of map lines), rolled up into career, yearly and recent-form views.
- GET
/api/v1/cs2/players/{playerIdOrSlug}Nickname, real name, photo, country, team, role and headline stats.
- GET
/api/v1/cs2/players/{playerIdOrSlug}/statsCareer totals plus a stat line per map played.
- GET
/api/v1/cs2/players/{playerIdOrSlug}/seasonsA player's stats by year.
- GET
/api/v1/cs2/players/{playerIdOrSlug}/formThe most recent maps with kills, deaths, ADR, KAST and rating.
- GET
/api/v1/cs2/leaderboards/{metric}Top players by rating, ADR, KAST, K/D, kills or opening kills.
- GET
/api/v1/cs2/players/search?q={name}Find a player by nickname or real name.
Teams & rosters
Team profiles with the current roster, every past lineup, player moves between teams, and how each team plays each map.
- GET
/api/v1/cs2/teams/{teamIdOrSlug}Name, logo, country, region, world ranking and current roster.
- GET
/api/v1/cs2/teams/{teamIdOrSlug}/roster-historyEvery player who has played for the team, with start and end dates.
- GET
/api/v1/cs2/teams/{teamIdOrSlug}/map-statsPer-map win rate, rounds and pick/ban tendencies.
- GET
/api/v1/cs2/teams/{teamIdOrSlug}/vs/{opponentIdOrSlug}Record and past matches between two teams.
- GET
/api/v1/cs2/roster-changes/recentPlayers joining and leaving teams, newest first.
- GET
/api/v1/cs2/transfers/recentPlayer moves between teams, newest first.
Rankings
The world team ranking and the Valve Regional Standings, with points and movement, plus one table per region.
- GET
/api/v1/cs2/rankings/worldThe latest world team ranking.
- GET
/api/v1/cs2/rankings/vrsThe latest Valve Regional Standings (VRS).
- GET
/api/v1/cs2/rankings/region/{region}One region, with each team's world and regional rank.
- GET
/api/v1/cs2/rankingsOne row per team, with points and change since the previous ranking.
Skin prices
The current price of a skin on each marketplace, its daily price history, sell listings across markets, and the week's biggest movers.
- GET
/api/v1/cs2/skins?q={name}Search skins by name, weapon, rarity or price range.
- GET
/api/v1/cs2/skins/{skinIdOrSlug}/pricesThe current price on each marketplace, cheapest first, with offer counts.
- GET
/api/v1/cs2/skins/{skinIdOrSlug}/historyDaily cheapest price across marketplaces, years back on long-listed skins.
- GET
/api/v1/cs2/skins/{skinIdOrSlug}/order-bookSell listings per marketplace with counts, and the lowest ask.
- GET
/api/v1/cs2/skins/trendingBiggest gainers and losers over 1 day to 1 year, with sparklines.
- GET
/api/v1/cs2/skins/{skinIdOrSlug}One skin: weapon, rarity, collection, image and price summary.
Tournaments
Tournaments with dates, prize pool, tier and format, plus every match, the standings and the bracket.
- GET
/api/v1/cs2/events/liveTournaments being played now.
- GET
/api/v1/cs2/events/{eventIdOrSlug}Dates, location, prize pool, tier, teams and format.
- GET
/api/v1/cs2/events/{eventIdOrSlug}/matchesEvery match of the tournament.
- GET
/api/v1/cs2/events/{eventIdOrSlug}/standingsTeams with seed, final placement and prize.
- GET
/api/v1/cs2/events/{eventIdOrSlug}/bracketBracket, groups, play-in and Swiss, each slot with teams, scores and winner.
Frequently asked questions
Python setup, auth and paging
Something missing? Email support@citoapi.com.
Is there a Python library for the CS2 API?
You do not need one: it is REST and JSON, so requests (or httpx) and a small helper cover every endpoint.
How do I authenticate from Python?
Send the key in the x-api-key header, for example headers={'x-api-key': os.environ['CITO_API_KEY']}.
How do I page through results?
Pass limit and page as query parameters and read meta.hasNext to know when to stop.
Can I load the data into pandas?
Yes. pandas.json_normalize(response['data']) flattens a list response into a DataFrame.
Is this an HLTV Python API alternative?
Yes. It covers results, ratings, rankings and live scores without scraping.
Next steps in Python
- CS2 player stats APIRating, ADR, KAST and K/D per map, career and form.
- CS2 live score APISeries, map and round score for every match in progress.
- CS2 fantasy APIPlayer lines per map for fantasy scoring.
- CS2 match results APIFinal series scores, map scores and box scores.
- CS2 API in Node.jsFetch CS2 data from JavaScript and TypeScript.
- CS2 API endpointsEvery CS2 endpoint on one page, grouped by job.
Build in Python: live tickers
Get a free key and run the first example.