# Csgostats — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Track and analyze Counter-Strike 2 player performance with detailed statistics including weapon usage, match history, and head-to-head comparisons. Access global leaderboards, view recent matches, and discover which players you've competed against to benchmark your skills.

**Category:** Sports | **Website:** [csgostats.gg/](https://csgostats.gg/) | **Docs:** [parse.bot/marketplace/129f024f-043e-48a1-9a4e-2b5d7009c2e4/csgostats-gg-api](https://parse.bot/marketplace/129f024f-043e-48a1-9a4e-2b5d7009c2e4/csgostats-gg-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-csgostats-gg-api-129f024f/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_leaderboard

Get current CS2 leaderboard by game mode. Returns top players with their rank position, display name, Steam ID, win count, and current rating score.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `mode` | string | No | Game mode for leaderboard (premier, competitive) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-csgostats-gg-api-129f024f/get_leaderboard \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode":"<string>"}'
```

### get_match_details

Get full match scoreboard and details including map, teams, scores, and per-player statistics. Each team contains team_name, score, and a players array with name, steam_id, avatar, rank_image, and a stats array of numeric values.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `match_id` | string | Yes | Match ID (numeric string, obtainable from get_player_matches or get_recent_matches results) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-csgostats-gg-api-129f024f/get_match_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"match_id":"<string>"}'
```

### get_player_matches

Get paginated list of matches for a player including match ID, date, map, score, and K/D/A per match. Returns up to ~50 matches per page.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `offset` | integer | No | Pagination offset (0-based page number) |
| `player_id` | string | Yes | Steam ID of the player (17-digit numeric string) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-csgostats-gg-api-129f024f/get_player_matches \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"offset":"<integer>","player_id":"<string>"}'
```

### get_player_played_with

Get list of players frequently played with/against

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `player_id` | string | Yes | Steam ID of the player |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-csgostats-gg-api-129f024f/get_player_played_with \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"player_id":"<string>"}'
```

### get_player_profile

Get player profile overview including display name, Steam avatar URL, and current rank images across all game modes (CS2, Premier, Wingman, etc.). Each rank entry includes a rank_image URL and a type indicating whether it is the current rank or best achieved.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `player_id` | string | Yes | Steam ID of the player (17-digit numeric string, e.g. 76561198779774220) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-csgostats-gg-api-129f024f/get_player_profile \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"player_id":"<string>"}'
```

### get_player_stats

Get detailed player statistics including summary stats (played, won, lost, tied, kills, deaths, assists, headshots, damage, rounds) and full weapons breakdown with kills, headshots, HS percentage, and accuracy per weapon.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Date filter (7d, 30d, 6mo, 12mo) |
| `maps` | string | No | Map filter |
| `modes` | string | No | Game mode filter |
| `platforms` | string | No | Platform filter |
| `player_id` | string | Yes | Steam ID of the player (17-digit numeric string) |
| `source` | string | No | Source filter (cs2, csgo) |
| `vac` | string | No | VAC filter |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-csgostats-gg-api-129f024f/get_player_stats \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","maps":"<string>","modes":"<string>","platforms":"<string>","player_id":"<string>","source":"<string>","vac":"<string>"}'
```

### get_recent_matches

Get global feed of the 50 most recent matches across all players on csgostats.gg. Returns match ID, relative date, map name, score, and a link to the match details page.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-csgostats-gg-api-129f024f/get_recent_matches \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
