# Mykbostats — 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 KBO league data including team standings, schedules, rosters, player profiles, and game details to track Korean baseball statistics and performance metrics. Search for players, view depth charts, get foreign player information, and analyze win matrices to stay informed about the Korean Baseball Organization.

**Category:** Sports | **Website:** [mykbostats.com/](https://mykbostats.com/) | **Docs:** [parse.bot/marketplace/23333538-695b-4ca5-a15e-132519376234/mykbostats-com-api](https://parse.bot/marketplace/23333538-695b-4ca5-a15e-132519376234/mykbostats-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-mykbostats-com-api-23333538/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_foreign_players

Get list of foreign (international) players currently in the KBO with their stats, split into pitchers and hitters. Pitchers include W-L-SV, ERA, WHIP, and other pitching stats. Hitters include AVG, OBP, SLG, OPS, and other batting stats.

**Estimated cost:** Metered

_No parameters required._

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

### get_game_detail

Get full details for a specific game including inning-by-inning line score, batting stats, and pitching stats for both teams. Line score is an array of arrays (header, away, home). Batting and pitching are each an array of two team arrays.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `game_id` | string | Yes | Game identifier from schedule results (e.g., '13557-Kia-vs-Hanwha-20260609'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mykbostats-com-api-23333538/get_game_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"game_id":"<string>"}'
```

### get_player_profile

Get player profile information and career season-by-season stats. Profile includes name, alternate name (Korean), affiliation, throws/bats, height/weight, birthdate, and draft info. Stats array contains one entry per season with year, team, and all stat columns appropriate to the player type (hitter or pitcher).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `player_id` | string | Yes | Player identifier from search results URL path (e.g., '268-Kim-Sunbin-Kia-Tigers', '2966-Caleb-Boushley-KT-Wiz'). |

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

### get_schedule

Get KBO schedule and results for a week. Returns the week containing the specified date, grouped by day with all games for each day. Each game includes team names, scores (if completed), status, and a game_id for detail lookup.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Date in YYYY-MM-DD format to get the week's schedule. Omitting returns the current week. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mykbostats-com-api-23333538/get_schedule \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>"}'
```

### get_standings

Get current KBO standings including wins, losses, draws, winning percentage, and games back for all 10 teams. Returns the full league table ordered by rank. Each team entry includes a team_id usable for team detail, roster, and depth chart lookups.

**Estimated cost:** Metered

_No parameters required._

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

### get_statistics

Get statistical leaderboards for a given category. Returns a ranked list of players leading the specified stat. Columns vary by stat category. Each leader entry includes player info with rank, team, and the relevant stats.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `stat_code` | string | No | Stat category code. Accepted values: 'ba' (batting average), 'hr' (home runs), 'era' (earned run average). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mykbostats-com-api-23333538/get_statistics \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"stat_code":"<string>"}'
```

### get_team_depth_chart

Get team depth chart showing position assignments for hitters, starting rotation, spot starters, and bullpen. The depth_chart array shows which positions each player can fill. Rotation, spot_starters, and bullpen arrays list pitching staff members.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `team_id` | string | Yes | Team identifier (e.g., '6-LG-Twins', '22-KT-Wiz', '5-Kia-Tigers'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mykbostats-com-api-23333538/get_team_depth_chart \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"team_id":"<string>"}'
```

### get_team_detail

Get detailed information for a specific team including home stadium, establishment date, former names, championships won, current manager, and GM.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `team_id` | string | Yes | Team identifier from standings or team list (e.g., '6-LG-Twins', '22-KT-Wiz', '5-Kia-Tigers', '1-Doosan-Bears', '4-Hanwha-Eagles', '3-Samsung-Lions', '9-NC-Dinos', '24-SSG-Landers', '2-Lotte-Giants', '23-Kiwoom-Heroes'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mykbostats-com-api-23333538/get_team_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"team_id":"<string>"}'
```

### get_team_list

Get list of KBO teams with aggregate roster composition stats including fan count, handedness splits (RHH/LHH/SH for hitters, RHP/LHP for pitchers), average age, average game duration, and average home attendance.

**Estimated cost:** Metered

_No parameters required._

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

### get_team_roster

Get active roster for a team split into pitchers and hitters with key stats. Pitchers include ERA, WHIP, IP, SO, BB, K/BB. Hitters include BA, OPS, H, HR, RBI, SB. Each player entry includes a player_id for profile lookup.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `team_id` | string | Yes | Team identifier (e.g., '6-LG-Twins', '22-KT-Wiz', '1-Doosan-Bears'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mykbostats-com-api-23333538/get_team_roster \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"team_id":"<string>"}'
```

### get_win_matrix

Get head-to-head win matrix between all teams. Each entry shows one team's record against every opponent as 'pct W-L-D' strings. The diagonal (team vs itself) is marked with a dash.

**Estimated cost:** Metered

_No parameters required._

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

### search_players

Search for players by name. Returns results grouped by team, with each team containing a name and results array of matching player entries. Each player entry includes active status, numeric id, title with name/position/number, and URL path.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword (player name, e.g., 'Kim', 'Park', 'Lee'). |

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