MLB API endpoint
Returns the player box score for an MLB game by numeric `id`. For the home and away teams it lists each player used with position, batting order and batting, pitching and fielding stats, plus team totals.
/mlb/game-boxscoreQuery parameters: id (required numeric MLB game id).
Returns both teams, every used player, positions, batting order, and batting, pitching, and fielding statistics.
| Field | Filled in, of 26 checked | Values in the sample |
|---|---|---|
| person | 26 | |
| position | 26 | Pitcher (13), Outfielder (4), Third Base (2) and 5 more |
| batting_order | 11 | 100 to 900, median 500 |
| stats | 26 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| id | string | Yes | Numeric MLB game id | 824651 | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/mlb/game-boxscore?id=824651" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"data": {
"game_id": 824651,
"away": {
"players": []
},
"home": {
"players": []
}
}
}Request schema
No body schema
Response schema
#/definitions/mlb.boxscoreResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | ||||
| data | mlb.BoxscoreResponse | No | ||||
| data.away | mlb.BoxscoreTeam | No | ||||
| data.away.players | array | No | ||||
| data.away.players[].batting_order | string | No | ||||
| data.away.players[].person | mlb.NamedRef | No | ||||
| data.away.players[].person.id | integer | No | MLB id of the player or league. | |||
| data.away.players[].person.name | string | No | Name of the player or league. | |||
| data.away.players[].position | string | No | ||||
| data.away.players[].stats | object | No | ||||
| data.away.team | mlb.TeamRef | No | ||||
| data.away.team.abbreviation | string | No | Short team abbreviation, for example `NYY`. Omitted when not available. | |||
| data.away.team.id | integer | No | MLB team id. | |||
| data.away.team.name | string | No | Full team name. | |||
| data.away.team_stats | object | No | ||||
| data.fetched_at | string | No | ||||
| data.game_id | integer | No | ||||
| data.home | mlb.BoxscoreTeam | No | ||||
| data.home.players | array | No | ||||
| data.home.players[].batting_order | string | No | ||||
| data.home.players[].person | mlb.NamedRef | No | ||||
| data.home.players[].person.id | integer | No | MLB id of the player or league. | |||
| data.home.players[].person.name | string | No | Name of the player or league. | |||
| data.home.players[].position | string | No | ||||
| data.home.players[].stats | object | No | ||||
| data.home.team | mlb.TeamRef | No | ||||
| data.home.team.abbreviation | string | No | Short team abbreviation, for example `NYY`. Omitted when not available. | |||
| data.home.team.id | integer | No | MLB team id. | |||
| data.home.team.name | string | No | Full team name. | |||
| data.home.team_stats | object | No | ||||
| data.source_url | string | No | ||||
| msg | string | No |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/mlb/game-boxscore?id=824651" \
-H "x-api-key: $CRAWLORA_API_KEY"