# Cpbl — 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 comprehensive CPBL baseball data including live game schedules, detailed box scores, player statistics, and play-by-play game feeds to stay updated on the Chinese Professional Baseball League. Build applications that display team standings, player rosters, news updates, and advanced performance metrics for all CPBL games and athletes.

**Category:** Sports | **Website:** [cpbl.com.tw/](https://cpbl.com.tw/) | **Docs:** [parse.bot/marketplace/e2d60e5f-bce9-4959-9c14-88e0ff37c1e5/cpbl-com-tw-api](https://parse.bot/marketplace/e2d60e5f-bce9-4959-9c14-88e0ff37c1e5/cpbl-com-tw-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-cpbl-com-tw-api-e2d60e5f/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_all_stats

Retrieve aggregate player statistics rankings for a given year and position type. Returns a paginated table of top players ranked by batting average (for batters) or ERA (for pitchers). Each page returns up to 15 players. Column headers are in Chinese.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `kind_code` | string | No | Game type code. |
| `page` | integer | No | Page index (0-based). Each page returns up to 15 players. |
| `position` | string | No | Position filter. |
| `year` | string | No | Year in YYYY format. Defaults to the current year. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cpbl-com-tw-api-e2d60e5f/get_all_stats \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind_code":"<string>","page":"<integer>","position":"<string>","year":"<string>"}'
```

### get_box_score

Retrieve the full box score for a specific game, including game details, scoreboard by inning, batting stats, and pitching stats for both home and visiting teams. Requires a game serial number obtainable from get_schedule results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `game_sno` | string | Yes | Game serial number identifying the specific game. Obtainable from get_schedule results (GameSno field). |
| `kind_code` | string | No | Game type code. |
| `year` | string | No | Year in YYYY format. Defaults to the current year. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cpbl-com-tw-api-e2d60e5f/get_box_score \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"game_sno":"<string>","kind_code":"<string>","year":"<string>"}'
```

### get_game_text_feed

Retrieve the pitch-by-pitch play-by-play text feed for a specific game. Returns detailed logs for every pitch including pitcher, hitter, action description, base runners, ball/strike count, and score. Requires a game serial number from get_schedule.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `game_sno` | string | Yes | Game serial number identifying the specific game. Obtainable from get_schedule results (GameSno field). |
| `kind_code` | string | No | Game type code. |
| `year` | string | No | Year in YYYY format. Defaults to the current year. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cpbl-com-tw-api-e2d60e5f/get_game_text_feed \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"game_sno":"<string>","kind_code":"<string>","year":"<string>"}'
```

### get_news

Retrieve the latest league news and announcements from the CPBL official site. Returns the most recent news items with titles, dates, and URLs to the full articles.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cpbl-com-tw-api-e2d60e5f/get_news \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_player_list

Retrieve the list of all active players across all CPBL teams, including their player ID (acnt) and team affiliation. Use the acnt value to look up individual player stats via get_player_stats.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cpbl-com-tw-api-e2d60e5f/get_player_list \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_player_stats

Retrieve historical season-by-season statistics for a specific player. Returns yearly stats including batting average, home runs, OBP, SLG, OPS, and advanced sabermetric metrics (wOBA, wRC+, BABIP, K%, BB%). The player ID is obtainable from get_player_list or get_all_stats results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `acnt` | string | Yes | Player account ID, a 10-digit zero-padded string (e.g. 0000003649). Obtainable from get_player_list or get_all_stats results. |
| `kind_code` | string | No | Game type code. |
| `stat_type` | string | No | Type of stats to retrieve. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cpbl-com-tw-api-e2d60e5f/get_player_stats \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"acnt":"<string>","kind_code":"<string>","stat_type":"<string>"}'
```

### get_schedule

Retrieve the CPBL game schedule for a given year and month. Returns an array of game objects including teams, scores, pitchers, and MVP information. The schedule covers all games in the specified month regardless of completion status.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `kind_code` | string | No | Game type code. |
| `month` | string | No | Month in MM format (zero-padded). Defaults to the current month. |
| `year` | string | No | Year in YYYY format. Defaults to the current year. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cpbl-com-tw-api-e2d60e5f/get_schedule \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind_code":"<string>","month":"<string>","year":"<string>"}'
```

### get_standings

Retrieve current season standings for all CPBL teams. Returns win-loss records, winning percentage, games behind, elimination number, and head-to-head records between all teams. No parameters required.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-cpbl-com-tw-api-e2d60e5f/get_standings \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
