csstats APIcsstats.gg ↗
Access CS2 player stats, match history, scoreboards, leaderboards, and ban data from csstats.gg via 7 structured API endpoints.
What is the csstats API?
The csstats.gg API exposes 7 endpoints covering Counter-Strike 2 player statistics, match history, and leaderboard data. Starting with search_player, you can resolve a Steam ID, display name, or profile URL into a csstats.gg profile, then pull aggregated career stats like K/D, HLTV Rating, ADR, and HS% from get_player_stats. Match-level data includes full per-player scoreboards, and a dedicated endpoint surfaces global VAC ban counts for the past 30 days.
curl -X GET 'https://api.parse.bot/scraper/758b30c6-74c7-46ea-a4fb-2efd60740f7c/search_player?query=s1mple' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace csstats-gg-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: CSStats SDK — Counter-Strike 2 player stats, matches, leaderboards."""
from parse_apis.CSStats_gg_API import CSStats, LeaderboardMode, PlayerNotFound
cs = CSStats()
# Search for a player by name
for result in cs.players.search(query="s1mple", limit=3):
print(result.name, result.steam_id, result.profile_url)
# Drill into the first search result's full stats
first = cs.players.search(query="s1mple", limit=1).first()
if first:
player = first.details()
print(player.name, player.steam_id)
for stat_name, stat_value in player.overview.items():
print(f" {stat_name}: {stat_value}")
# List recent matches for a player
full_player = cs.players.get(steam_id="76561197978186923")
for match in full_player.matches.list(limit=3):
print(match.date, match.map, match.score, match.k, match.d, match.rating)
# Get the full scoreboard for a specific match
match = full_player.matches.list(limit=1).first()
if match:
board = match.scoreboard()
for team in board.teams:
for mp in team:
print(f" {mp.name} K:{mp.k} D:{mp.d} A:{mp.a} Rating:{mp.rating}")
# Browse the premier leaderboard
for entry in cs.leaderboard(mode=LeaderboardMode.PREMIER).top(limit=5):
print(entry.rank, entry.name, entry.elo)
# Typed error handling for a non-existent player
try:
cs.players.get(steam_id="00000000000000000")
except PlayerNotFound as exc:
print(f"Player not found: {exc.steam_id}")
# Fetch global ban statistics
report = cs.ban_reports.fetch()
print(f"Bans in last 30 days: {report.total_bans_30d}")
print("exercised: players.search / players.get / details / matches.list / scoreboard / leaderboard.top / ban_reports.fetch")
Search for a player by Steam ID, name, or profile URL. When a 17-digit Steam ID is provided, returns the resolved profile URL directly. Name-based queries resolve via the site's search form and may return multiple matching players.
| Param | Type | Description |
|---|---|---|
| queryrequired | string | Steam ID (17-digit numeric), player name, or Steam profile URL |
{
"type": "object",
"fields": {
"players": "array of player objects with name, steam_id, profile_url (present when multiple results found)",
"steam_id": "string - resolved 64-bit Steam ID (present for single-result lookups)",
"profile_url": "string - full URL to the player's csstats.gg profile (present for single-result lookups)"
},
"sample": {
"data": {
"players": [
{
"name": "s1mple",
"steam_id": "76561197978186923",
"profile_url": "https://csstats.gg/player/76561197978186923"
}
]
},
"status": "success"
}
}About the csstats API
Player Lookup and Career Stats
Use search_player with a 17-digit Steam ID, a player name, or a full Steam profile URL. A Steam ID input resolves directly to a profile_url and confirmed steam_id. Name queries may return an array of matching player objects, each with name, steam_id, and profile_url. Once you have a Steam ID, get_player_stats returns the player's display name and an overview object containing labeled stat pairs — K/D, HLTV Rating, Win Rate, HS%, ADR, and other aggregated career metrics.
Match History and Scoreboards
get_player_matches accepts a steam_id and returns a matches array sorted most-recent first. Each entry includes match_id, date, map, score, and individual performance fields: k (kills), d (deaths), a (assists), and rating. To drill into a specific game, pass the match_id to get_match_scoreboard, which returns two teams of up to five players each, with per-player name, steam_id, k, d, a, and rating.
Leaderboards and Social Graph
get_leaderboard accepts an optional mode parameter (premier or wingman) and returns a ranked list of top players with rank, name, steam_id, and elo. get_player_played_with returns players who have shared matches with a given Steam ID, with an offset parameter for pagination through results.
Ban Statistics
get_ban_stats takes no inputs and returns total_bans_30d — a comma-formatted string of the total VAC and game bans detected across all tracked players in the past 30 days. This gives a platform-wide signal of ban activity without tying to a specific player.
The csstats API is a managed, monitored endpoint for csstats.gg — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when csstats.gg changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official csstats.gg API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Track a CS2 player's K/D, ADR, and HLTV Rating over time using get_player_stats
- Build a match review tool that pulls full scoreboard data via get_match_scoreboard using match IDs from get_player_matches
- Display current Premier and Wingman leaderboard rankings in a third-party CS2 companion app using get_leaderboard
- Identify frequent teammates or opponents for a player using get_player_played_with
- Monitor platform-wide VAC and game ban trends with the 30-day aggregate from get_ban_stats
- Resolve arbitrary Steam names or profile URLs to Steam IDs for downstream stats lookups via search_player
- Compare squad members' win rates and HS% before a match by batch-querying get_player_stats per Steam ID
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does csstats.gg have an official developer API?+
What does get_player_stats actually return, and is it career-wide or per-season?+
overview object containing aggregated stats labeled as they appear on the player profile — including K/D, HLTV Rating, Win Rate, HS%, and ADR. These reflect career aggregates as tracked by csstats.gg rather than a filterable per-season or per-mode breakdown. The API does not currently expose per-season splits. You can fork it on Parse and revise to add a season-scoped endpoint if that granularity is needed.How do name-based searches behave compared to Steam ID lookups in search_player?+
steam_id and profile_url. Name-based queries go through the site's search and may return an array of player objects when multiple accounts share a similar name. For deterministic lookups, Steam IDs are more reliable than display names.Does the API expose map-specific or weapon-specific stats?+
Is there pagination support for match history or played-with results?+
offset integer for pagination. get_player_matches does not expose an offset or page parameter in the current spec — it returns the most recent matches available on the player's profile. If deeper match history pagination is needed, you can fork it on Parse and revise to add offset support to that endpoint.