# Basketball Reference — 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.

> Access data from basketball-reference.com.

**Category:** Sports | **Website:** [www.basketball-reference.com/](https://www.basketball-reference.com/) | **Docs:** [parse.bot/marketplace/f68b435c-830d-48da-bc2a-986c39482fe6/basketball-reference-com-api](https://parse.bot/marketplace/f68b435c-830d-48da-bc2a-986c39482fe6/basketball-reference-com-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-basketball-reference-com-api-f68b435c/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_game_log

Retrieve game-by-game statistics for a player in a specific season. Returns each regular season game with date, opponent, result, and full box score stats including points, rebounds, assists, shooting splits, and plus/minus.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `player_id` | string | Yes | Basketball Reference player identifier (e.g. 'curryst01', 'jamesle01'). Obtainable from search_players results. |
| `season` | string | Yes | Season ending year as 4-digit string (e.g. '2025' for the 2024-25 season). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-basketball-reference-com-api-f68b435c/get_game_log \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"player_id":"<string>","season":"<string>"}'
```

### get_player_stats

Retrieve career and season-by-season per-game statistics for a player. Returns shooting percentages, points, rebounds, assists, steals, blocks, and turnovers for each season played and career totals.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `player_id` | string | Yes | Basketball Reference player identifier (e.g. 'curryst01', 'jamesle01'). Obtainable from search_players results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-basketball-reference-com-api-f68b435c/get_player_stats \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"player_id":"<string>"}'
```

### get_season_leaders

Retrieve statistical leaders for a given NBA season and stat category. Returns the top 20 players ranked by the specified statistic with their values and team affiliations.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `season` | string | Yes | Season ending year as 4-digit string (e.g. '2025' for the 2024-25 season). |
| `stat_category` | string | Yes | Statistical category identifier (e.g. 'pts_per_g' for points per game, 'trb_per_g' for rebounds per game, 'ast_per_g' for assists per game, 'stl_per_g', 'blk_per_g', 'fg_pct', 'fg3_pct', 'ft_pct'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-basketball-reference-com-api-f68b435c/get_season_leaders \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"season":"<string>","stat_category":"<string>"}'
```

### get_team_stats

Retrieve team season statistics and standings information. Returns the team record, conference finish, coach, and aggregate per-game team stats.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `season` | string | Yes | Season ending year as 4-digit string (e.g. '2025' for the 2024-25 season). |
| `team_id` | string | Yes | Three-letter team abbreviation (e.g. 'LAL', 'BOS', 'GSW', 'OKC'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-basketball-reference-com-api-f68b435c/get_team_stats \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"season":"<string>","team_id":"<string>"}'
```

### search_players

Search for basketball players by name. Returns matching players from NBA, ABA, BAA, WNBA, and international leagues with their identifiers and active seasons.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Player name search query (partial or full name). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-basketball-reference-com-api-f68b435c/search_players \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
