MLB Teams, Player Search & Season Schedule Lookup
Look up every current MLB team, search for a player by name, or pull a full season's schedule and scores, with stadium, roster, and matchup details for each record.
Input schema
Input fields, types, required flags, descriptions, defaults, and prefills come from the published definition. Prefill examples are distinct from defaults.
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | required | What data to fetch. |
searchQuery | string | optional | Player name for players mode. |
season | string | optional | MLB season year. |
Show all input fields
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | required | What data to fetch. |
searchQuery | string | optional | Player name for players mode. |
season | string | optional | MLB season year. |
maxItems | integer | optional | Maximum records to return. |
Download the published input schema
View complete JSON
{
"description": "Scrape MLB teams, players, and game results from TheSportsDB free API.",
"properties": {
"maxItems": {
"default": 20,
"description": "Maximum records to return.",
"maximum": 200,
"minimum": 1,
"prefill": 20,
"title": "Max items",
"type": "integer"
},
"mode": {
"default": "teams",
"description": "What data to fetch.",
"editor": "select",
"enum": [
"teams",
"players",
"games"
],
"enumTitles": [
"MLB Teams",
"Player Search",
"Season Games"
],
"prefill": "teams",
"title": "Mode",
"type": "string"
},
"searchQuery": {
"default": "Shohei Ohtani",
"description": "Player name for players mode.",
"editor": "textfield",
"prefill": "Shohei Ohtani",
"title": "Search query",
"type": "string"
},
"season": {
"default": "2024",
"description": "MLB season year.",
"editor": "select",
"enum": [
"2022",
"2023",
"2024"
],
"enumTitles": [
"2022",
"2023",
"2024"
],
"prefill": "2024",
"title": "Season",
"type": "string"
}
},
"required": [
"mode"
],
"schemaVersion": 1,
"title": "MLB Stats Scraper Input",
"type": "object"
}
Output schema
Published result links and storage locations. This schema is not an exhaustive contract for every field in a dataset record.
| Field | Type | Required | Description |
|---|---|---|---|
results | string | optional | Dataset containing all scraped MLB team, player, or game records. |
Download the published output schema
View complete JSON
{
"actorOutputSchemaVersion": 1,
"description": "One record per MLB team, matched player, or scheduled/completed game, depending on the selected mode.",
"properties": {
"results": {
"description": "Dataset containing all scraped MLB team, player, or game records.",
"template": "{{links.apiDefaultDatasetUrl}}/items",
"title": "MLB Records",
"type": "string"
}
},
"title": "MLB Teams, Player Search & Season Schedule Lookup Output"
}
Dataset schema
Published dataset views and any declared field definitions. A view can select only a subset of the returned record fields.
Download the published dataset schema
View complete JSON
{
"actorSpecification": 1,
"views": {
"overview": {
"display": {
"component": "table",
"properties": {}
},
"title": "MLB Stats Scraper",
"transformation": {
"fields": [
"teamName",
"playerName",
"eventName",
"homeTeam",
"awayTeam",
"matchDate"
]
}
}
}
}
Key-value schema
Published key-value store definitions, when provided by this build.
This definition is not present in the default published build. See the published README for available documentation.
Published README
Read the full published documentation
MLB Teams, Player Search & Season Schedule Lookup
Pull Major League Baseball reference data in three shapes: the full list of current MLB teams with their stadium and founding details, a name search across MLB players with bio and position info, or a season's full schedule of games with final or in-progress scores.
What this actor does
- Lists every current MLB team with city, stadium, founding year, and official website
- Searches MLB players by name and returns position, physical stats, nationality, and a short bio
- Pulls a full season's game schedule with home/away teams, scores, venue, and status
- Tags every record with a
recordTypeso mixed exports stay easy to filter - Only includes a field when the data source actually supplied it — no blank or placeholder values
Output per team (recordType: "mlb_team")
teamId— unique team identifierteamName— full team nameshortName— abbreviated team namecity— team's home locationstadium— home stadium nameformedYear— year the franchise was foundedwebsite— official team websitelogoUrl— team logo image URLteamUrl— reference page for the teamscrapedAt— ISO 8601 timestamp of when the record was collected
Output per player (recordType: "mlb_player")
playerId— unique player identifierplayerName— player's full nameteam— current team namenationality— player's nationalityposition— playing positionheight/weight— physical stats as publishedbirthDate— date of birthdescription— short biography (truncated to 300 characters)imageUrl— player photo or cutout imageprofileUrl— reference page for the playerscrapedAt— ISO 8601 timestamp of when the record was collected
Output per game (recordType: "mlb_game")
eventId— unique game/event identifiereventName— game title (typically "Away Team vs Home Team")homeTeam/awayTeam— team nameshomeScore/awayScore— final or current score (omitted for games that haven't been played yet)season— season the game belongs tomatchDate— date the game was/is scheduledvenue— stadium where the game is playedstatus— game status as publishedeventUrl— reference page for the gamescrapedAt— ISO 8601 timestamp of when the record was collected
Input
| Field | Type | Default | Description |
|---|---|---|---|
mode |
string | teams |
teams (all current MLB teams), players (search by name), or games (a season's schedule) |
searchQuery |
string | Shohei Ohtani |
Player name to search; used only in players mode |
season |
string | 2024 |
Season year to pull games for (2022, 2023, or 2024); used only in games mode |
maxItems |
integer | 20 |
Maximum records to return (1–200) |
Example: list all current MLB teams
{
"mode": "teams",
"maxItems": 30
}
Example: search for a player
{
"mode": "players",
"searchQuery": "Aaron Judge",
"maxItems": 10
}
Example: pull a season's schedule
{
"mode": "games",
"season": "2023",
"maxItems": 200
}
Use cases
- Fantasy baseball tools pulling player bios and team reference data to enrich a roster app
- Sports content sites keeping a simple, always-current list of MLB teams and stadiums
- Analytics projects building a season-by-season game log without hand-collecting scores
- Trivia and reference apps looking up a player's position, nationality, or physical stats by name
- Data pipelines that need a lightweight MLB reference layer without a paid sports-data subscription
FAQ
Do I need an API key or MLB account? No — all three modes read from a free, public sports-data source and require no authentication.
Why does players mode only return results for one name at a time? Each run searches the single name given in searchQuery; run it again with a different name to look up another player.
Why are homeScore/awayScore sometimes missing from a game record? Those fields are only included once a score has actually been published for that game; scheduled-but-not-yet-played games omit them rather than showing a zero.
Which seasons can I pull with games mode? 2022, 2023, or 2024 — pick the one you need in the season input.
Why is description cut off at 300 characters? Player biographies are truncated to keep records a consistent, manageable size; the full bio is not currently returned.
Is this affiliated with Major League Baseball? No. This is an independent actor that reads publicly available MLB reference data; it is not endorsed by or affiliated with MLB or any team.
Python quickstart
Use a schema-derived input and the Python standard library to start a run. An Apify account and token are required for execution.
Source build V6ZY83AGWDTk4LlbA. Documentation is regenerated from the default published build; private drafts are not included.