# 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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/csgostats/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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/credits/csgostats/get-leaderboard \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/csgostats/get-match-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/csgostats/get-player-matches \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/csgostats/get-player-played-with \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/csgostats/get-player-profile \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/csgostats/get-player-stats \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/csgostats/get-recent-matches \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.