MLB API endpoint
Returns an MLB player by numeric `id`. The response has the full name, position, bats and throws sides, birth date, city and country, current age, height, weight, jersey number, MLB debut date, active flag and current team. Unknown players return `404`.
/mlb/playerThe required id is a numeric MLB player ID. The response includes biographical information, position, handedness, active status, and current team. Unknown players return 404.
| Field | In the sample | Value in the sample |
|---|---|---|
| player.id | Has a value | |
| player.full_name | Has a value | |
| player.active | Has a value | true |
| player.primary_number | Has a value | 99 |
| player.birth_date | Has a value | 1992-04-26 |
| player.birth_city | Has a value | “Linden” |
| player.birth_country | Has a value | “USA” |
| player.height | Has a value | |
| player.weight | Has a value | 282 |
| player.current_age | Has a value | 34 |
| player.mlb_debut_date | Has a value | 2016-08-13 |
| player.position | Has a value | “Outfielder” |
| player.position_code | Has a value | |
| player.bat_side | Has a value | “Right” |
| player.pitch_hand | Has a value | “Right” |
| player.current_team | Has a value |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| id | string | Yes | Numeric MLB player id | 592450 | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/mlb/player?id=592450" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"player": {
"id": 592450,
"full_name": "Aaron Judge",
"active": true,
"position": "Right Field",
"current_team": {
"id": 147,
"name": "New York Yankees"
}
}
}
}Request schema
No body schema
Response schema
#/definitions/mlb.playerResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | mlb.PlayerResponse | No | ||||
| data.fetched_at | string | No | ||||
| data.player | mlb.Player | No | ||||
| data.player.active | boolean | No | ||||
| data.player.bat_side | string | No | ||||
| data.player.birth_city | string | No | ||||
| data.player.birth_country | string | No | ||||
| data.player.birth_date | string | No | ||||
| data.player.current_age | integer | No | ||||
| data.player.current_team | mlb.TeamRef | No | ||||
| data.player.current_team.abbreviation | string | No | Short team abbreviation, for example `NYY`. Omitted when not available. | |||
| data.player.current_team.id | integer | No | MLB team id. | |||
| data.player.current_team.name | string | No | Full team name. | |||
| data.player.full_name | string | No | ||||
| data.player.height | string | No | ||||
| data.player.id | integer | No | ||||
| data.player.mlb_debut_date | string | No | ||||
| data.player.pitch_hand | string | No | ||||
| data.player.position | string | No | ||||
| data.player.position_code | string | No | ||||
| data.player.primary_number | string | No | ||||
| data.player.weight | integer | No | ||||
| data.source_url | string | No | ||||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 429 | Too Many Requests | #/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/player?id=592450" \
-H "x-api-key: $CRAWLORA_API_KEY"