MLB Stats Scraper: Player Stats, Scores, Standings & Box Score
Pricing
from $6.15 / 1,000 results
MLB Stats Scraper: Player Stats, Scores, Standings & Box Score
Scrape MLB stats with no API key: teams, rosters, player hitting/pitching/fielding stats, schedules and scores, box scores, and division standings from the official MLB Stats API. All 30 clubs, career and year-by-year history, playoff race. Export JSON, CSV, Excel. Fantasy and analytics ready.
Pricing
from $6.15 / 1,000 results
Rating
5.0
(1)
Developer
Scrapers Lat
Maintained by CommunityActor stats
1
Bookmarked
7
Total users
4
Monthly active users
13 days ago
Last modified
Categories
Share
MLB Stats Scraper: Player Stats, Scores, Standings & Box Score API
Scrape MLB stats without an API key. This MLB Stats API scraper pulls baseball stats data for every one of the 30 Major League Baseball clubs: teams, rosters, per-player MLB player stats (hitting, pitching and fielding), full MLB schedule and scores, MLB standings, box scores with line scores, and ballpark, league, division and season reference data. Clean rows for fantasy baseball data, betting models, sports analytics, dashboards and research. Export to JSON, CSV, Excel or XML.
No API key. No token. No scraping code to maintain. Pick a mode, set a few filters, press Run.
📥 Input · 📤 Output · 💰 Pricing · ▶️ Examples
Table of contents
- What it does
- Why this scraper
- Use cases
- Quickstart
- Modes
- Input reference
- Output reference
- Example output records
- Run via API and CLI
- Fetch results
- Billing and limits
- FAQ and troubleshooting
What it does
The actor reads the official MLB Stats API and writes one normalized record per item to the run's dataset. Choose one of ten modes:
teamsreturns all 30 MLB clubs for a season with league, division, venue and location.rosterreturns every player on one or several teams, and whenwithDetailsis on adds each player's season hitting, pitching or fielding line, career totals, year-by-year history and full bio.playersreturns a profile plus season and career stats for the specific player IDs you pass.schedulereturns games, final scores, line scores and probable pitchers for a date or a full date range.standingsreturns division standings with wins, losses, pct, games back, run differential, streaks and the full playoff race (magic and elimination numbers, wild card, clinch flags).gamereturns the box score for a game: line score by inning, run/hit/error totals, winning, losing and save pitchers, and the complete per-player batting and pitching lines for both teams.venuesreturns MLB ballparks with capacity, surface, roof, coordinates and time zone.leagues,divisions,seasonsreturn MLB reference data.
Each mode uses a different subset of the parameters below and returns the fields relevant to that mode. Missing source values are returned as null, never invented.
Why this scraper
The most complete MLB scraper on Apify. It is a strict superset of the other MLB stats actors: it accepts every input they take and returns every field they return, plus more.
| Capability | This actor | Typical MLB actors |
|---|---|---|
| Teams, rosters, player stats, schedule, standings | Yes | Yes |
Box score / live game detail (game mode) | Yes, with full per-player batting and pitching lines | Some (summary only) |
Batch rosters (teamIds) and batch players (playerIds) | Yes | Some |
| Game type filter (regular, postseason, spring, all-star) | Yes | Some |
Schedule date range (startDate to endDate) | Yes | Rarely (single date only) |
| Venues, leagues, divisions, seasons reference data | Yes | Some (separate actor) |
| Hitting, pitching and fielding stat groups | Yes | Usually hitting/pitching only |
| Career totals and year-by-year history per player | Yes | Rarely |
| Full playoff race (magic/elimination numbers, clinch flags) | Yes | Rarely |
| Line score by inning + weather + attendance | Yes | Rarely |
| Player headshot image URL and MLB.com links | Yes | Some |
| No API key required | Yes | Varies |
Use cases
- Fantasy baseball data: pull rosters, hitting and pitching lines, and daily box scores to feed lineups and projections.
- Betting and odds models: probable pitchers, standings, run differential and per-inning line scores.
- Sports analytics and dashboards: season and career stats, splits and playoff race tracking.
- Media and content: scores, standings and recaps by date or date range.
- Research and data science: historical seasons, venues and reference data as tidy rows.
Quickstart
Open the actor, paste this into the input, and press Run. It returns 3 New York Yankees players with full season stats and bio.
{"mode": "roster","teamId": "147","maxRecords": 3,"withDetails": true,"statGroup": "hitting"}
- Standings:
{"mode":"standings","leagueId":"103,104","season":2025} - A day's scores:
{"mode":"schedule","date":"2025-07-04"} - A box score:
{"mode":"game","gamePks":["776500"]} - A player's stats:
{"mode":"players","playerIds":["592450","660271"]}
Modes
| Mode | Returns | Key parameters |
|---|---|---|
teams | All 30 MLB clubs | season |
roster | Players on one or more teams | teamId, teamIds, season, withDetails, statGroup |
players | Player profile + season and career stats | playerIds, playerId, season, statGroup, gameType |
schedule | Games, scores, line scores, probable pitchers | date, startDate, endDate, gameType, seasonType |
standings | Division standings + playoff race | leagueId, season |
game | Box score, line score, decisions, per-player lines | gamePks, gamePk, date, withDetails |
venues | MLB ballparks | season |
leagues | AL and NL | season |
divisions | MLB divisions | none |
seasons | MLB season calendar | none |
Input reference
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
mode | enum | no | standings | teams, roster, players, schedule, standings, game, venues, leagues, divisions, seasons. |
season | integer | no | current | Season year (teams, roster, players, standings, venues, leagues). |
teamId | enum | for roster | (none) | MLB team ID whose roster to fetch, for example 147 (New York Yankees). |
teamIds | string[] | no | (none) | Batch of team IDs for roster mode, merged with teamId. |
playerIds | string[] | for players | ["592450","660271"] | MLB player IDs, for example 592450 (Aaron Judge), 660271 (Shohei Ohtani). |
playerId | string | no | (none) | Single MLB player ID, merged with playerIds. |
statGroup | enum | no | hitting | Stat line to attach in players/roster: hitting, pitching or fielding. |
date | string | for schedule/game | today | Date in YYYY-MM-DD, for example 2025-07-04. |
startDate | string | no | (none) | Start of a schedule date range (YYYY-MM-DD). |
endDate | string | no | (none) | End of a schedule date range (YYYY-MM-DD). |
gameType | string | no | (none) | MLB game type: R regular, S spring, A all-star, F wild card, D division series, L league championship, W World Series, E exhibition. Combine with commas. |
seasonType | enum | no | any | Shortcut for gameType: regular, post, spring. |
gamePks | string[] | for game | (none) | MLB game IDs (gamePk) for game mode. |
gamePk | string | no | (none) | Single MLB game ID, merged with gamePks. |
leagueId | enum | no | 103,104 | Standings league: 103,104 (both), 103 (American), 104 (National). |
withDetails | boolean | no | true | Roster: also fetch each player's stats and bio. Game: also fetch the full per-player box score. |
maxRecords | integer | no | (none) | Maximum records per run. Free plans are capped at 10. |
Output reference
One dataset item per team, player, game, standings row, venue, league, division or season depending on mode. Fields present depend on the mode. Types: string, integer, number, boolean, object, object[], or null when absent.
| Field | Type | Description |
|---|---|---|
title | string | Name of the team, player, game, venue, league, division or season. |
id | integer | MLB ID. |
url | string | Official MLB.com URL when available. |
teamName | string | Team name (player and standings modes). |
abbreviation, league, division, venueName | string | Team reference (teams mode). |
position / positionName | string | Player position code and name (roster/players). |
imageUrl | string | Player headshot URL (roster/players). |
primaryNumber | string | Jersey number. |
active, currentAge, birthDate, birthCity, birthStateProvince, birthCountry, height, weight, batSide, pitchHand, mlbDebutDate, draftYear | mixed | Player bio (roster/players). |
statSeason / statGroup | string | Season and group of the attached stat line. |
gamesPlayed, atBats, runs, hits, doubles, triples, homeRuns, rbi, totalBases, baseOnBalls, strikeOuts, stolenBases, ... | integer | Season stat counters (full hitting, pitching or fielding set as reported by MLB). |
battingAverage, onBasePercentage, sluggingPercentage, ops, babip, era, whip, ... | string | Season rate stats (as MLB formats them). |
careerStats | object | Career totals with the same stat keys. |
yearByYear | object[] | Per-season history, each with season, teamId, teamName, leagueName and a stats object. |
wins, losses, winningPct, divisionRank, leagueRank, sportRank, gamesBack | mixed | Team record and ranks (standings). |
runsScored, runsAllowed, runDifferential, streak, clinchIndicator | mixed | Run totals, streak and clinch (standings). |
homeRecord, awayRecord, lastTenRecord, divisionRecord, oneRunRecord, extraInningsRecord, dayRecord, nightRecord, vsLeftRecord, vsRightRecord, expectedRecord | object | Split records, each with wins, losses, pct (standings). |
wildCardRank, magicNumber, eliminationNumber, clinched, divisionLeader, divisionChamp, hasWildcard | mixed | Playoff race fields (standings). |
status, gameType, gameDate, homeTeam, awayTeam, homeScore, awayScore | mixed | Game summary (schedule/game). |
homeProbablePitcher / awayProbablePitcher | object | Probable starters (schedule/game). |
homeTeamRecord / awayTeamRecord | object | Each side's season record in the matchup. |
linescore | object | Line score: per-inning runs, plus R/H/E totals and left-on-base for both teams. |
winningPitcher / losingPitcher / savePitcher | object | Pitching decisions (finished games). |
weatherCondition, weatherTemp, weatherWind, attendance, firstPitch | mixed | Game-day context when available. |
seriesDescription, seriesGameNumber, gamesInSeries | mixed | Series context (postseason). |
homeTeamTotals / awayTeamTotals | object | Team batting and pitching totals (game mode, details). |
homeBatters / awayBatters / homePitchers / awayPitchers | object[] | Per-player box score lines (game mode, details). |
city, state, country, latitude, longitude, timeZone, capacity, turfType, roofType | mixed | Venue reference (venues mode). |
observedAt | string | ISO 8601 timestamp of when the record was collected. |
error | string | null on success. On a failed run, a single item with a populated error field is written instead. |
Example output records
A real standings record (input {"mode":"standings","season":2025,"leagueId":"103,104"}):
{"title": "Blue Jays","id": 141,"url": "https://www.mlb.com/team/141","teamName": "Blue Jays","season": "2025","wins": 94,"losses": 68,"winningPct": ".580","divisionRank": "1","gamesBack": "-","runsScored": 798,"runsAllowed": 721,"runDifferential": 77,"streak": "W4","clinchIndicator": "z","clinched": true,"divisionChamp": true,"homeRecord": { "wins": 54, "losses": 27, "pct": ".667" },"lastTenRecord": { "wins": 5, "losses": 5, "pct": ".500" },"expectedRecord": { "wins": 88, "losses": 74, "pct": ".543" },"observedAt": "2026-08-10T14:40:45.707Z","error": null}
A schedule record with line score and decisions (input {"mode":"schedule","date":"2025-07-04"}):
{"title": "Boston Red Sox @ Washington Nationals","id": 776500,"status": "Final","homeTeam": "Washington Nationals","awayTeam": "Boston Red Sox","homeScore": 2,"awayScore": 11,"awayIsWinner": true,"venueName": "Nationals Park","linescore": { "homeRuns": 2, "homeHits": 6, "homeErrors": 1, "awayRuns": 11, "awayHits": 15, "awayErrors": 0, "innings": [ { "inning": 1, "homeRuns": 0, "awayRuns": 3 } ] },"winningPitcher": { "id": 657053, "name": "Example Pitcher" },"observedAt": "2026-09-06T00:00:00.000Z","error": null}
Roster and players records add the full bio, season line (hitting, pitching or fielding), careerStats and a yearByYear array. Game mode with withDetails adds homeTeamTotals, awayTeamTotals and the per-player homeBatters, awayBatters, homePitchers and awayPitchers arrays.
Run via API and CLI
Start a run and read the dataset. Replace <TOKEN> with your Apify API token.
Run synchronously and get dataset items in one call:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~mlb-stats-scraper/run-sync-get-dataset-items?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"mode":"roster","teamId":"147","maxRecords":25,"withDetails":true,"statGroup":"hitting"}'
Start a run asynchronously:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~mlb-stats-scraper/runs?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"mode":"game","gamePks":["776500"],"withDetails":true}'
Apify CLI:
apify call scrapers_lat/mlb-stats-scraper \--input '{"mode":"standings","leagueId":"103,104","season":2025}'
Fetch results
Every run writes to a dataset. Fetch items as JSON, CSV or Excel by changing format:
# JSONcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"# CSVcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"# Paginate large datasetscurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&offset=1000&limit=1000"
<DATASET_ID> is returned as defaultDatasetId in the run object. Use offset and limit to page through large result sets. clean=true drops empty and internal fields.
Billing and limits
- Pay per result. You are charged per record returned (
resultevent). See the pricing tab for the current per-result price. - Details add-on. In
rostermode withwithDetailson, adetailscharge applies once per player whose full stats and bio are fetched. Ingamemode withwithDetailson, adetailscharge applies once per game whose full per-player box score is fetched. Turn it off for a faster, listing-only run. - No charge on failure. If a run errors, the actor writes a single item with a populated
errorfield and does not charge for it. Empty runs cost nothing. - Spend cap respected. Set
maxTotalChargeUsdon the run. Once reached, the actor stops emitting and charging further billable results. - Free Apify plans are capped at 10 records per run. Upgrade for higher
maxRecords.
FAQ and troubleshooting
Do I need an MLB API key? No. There is no API key, token or login. Pick a mode and run.
How do I find a player ID or game ID?
Run teams or roster mode for player IDs, and schedule mode for game IDs (the id field is the gamePk). Pass those to players or game mode.
Do I get hitting, pitching or fielding stats?
Set statGroup to hitting, pitching or fielding in roster or players mode. The chosen line is attached to each player.
Can I pull postseason only?
Yes. Set seasonType to post, or set gameType to F,D,L,W.
Can I pull a whole month of games?
Yes. Use startDate and endDate in schedule mode for a date range.
Why are some fields null or empty?
Fields depend on the mode and on game state. A standings record has no batting stats; a game before first pitch has no line score. Missing source values are returned as null, never invented.
Which season does it use by default?
The current MLB season when season is empty. Set season to pull historical data.
Is this an official MLB tool? No. This actor is independent and has no affiliation with Major League Baseball. It reads only data that is publicly available through the MLB Stats API. Use it in accordance with MLB's terms.
Related scrapers
- ESPN Soccer Scraper: soccer scores, standings and teams.
- FIFA World Cup Scraper: World Cup matches and standings.
- ESPN and league sports data: more sports scrapers in the catalog.
- Kalshi Markets Scraper: event and sports prediction markets.
- Eventbrite Scraper: live events and tickets.
- Google News Scraper: sports and general news coverage.
More scrapers at scrapers.lat
Built and maintained by scrapers.lat, where we publish scrapers for US and Latin American public platforms: company registries, government data, finance, e-commerce and more. Browse the catalog or request a custom scraper at scrapers.lat.
Independent tool, not affiliated with Major League Baseball. Accesses only publicly available MLB Stats API data. Use in accordance with MLB's terms.
MLB Stats Scraper: API de Estadisticas, Marcadores, Posiciones y Box Score
Extrae estadisticas de MLB sin clave de API. Este scraper de la API de MLB Stats obtiene datos de estadisticas de beisbol de los 30 equipos de las Grandes Ligas: equipos, rosters, estadisticas de jugadores de MLB (bateo, pitcheo y fildeo), el calendario y marcadores de MLB completos, las posiciones de MLB, box scores con line score, y datos de referencia de estadios, ligas, divisiones y temporadas. Filas limpias para datos de fantasy baseball, modelos de apuestas, analitica deportiva, tableros e investigacion. Exporta a JSON, CSV, Excel o XML.
Sin clave de API. Sin token. Sin codigo de scraping que mantener. Elige un modo, ajusta unos filtros y presiona Run.
📥 Entrada · 📤 Salida · 💰 Precios · ▶️ Ejemplos
Tabla de contenidos
- Que hace
- Por que este scraper
- Casos de uso
- Inicio rapido
- Modos
- Referencia de entrada
- Referencia de salida
- Registros de ejemplo
- Ejecutar via API y CLI
- Obtener resultados
- Facturacion y limites
- Preguntas frecuentes
Que hace
El actor lee la API oficial de MLB Stats y escribe un registro normalizado por elemento en el dataset de la ejecucion. Elige uno de diez modos:
teamsdevuelve los 30 clubes de MLB de una temporada con liga, division, estadio y ubicacion.rosterdevuelve cada jugador de uno o varios equipos, y conwithDetailsactivado agrega la linea de bateo, pitcheo o fildeo de temporada, los totales de carrera, el historial ano por ano y la biografia completa.playersdevuelve el perfil y las estadisticas de temporada y de carrera de los IDs de jugador que indiques.scheduledevuelve juegos, marcadores finales, line scores y lanzadores probables de una fecha o un rango de fechas.standingsdevuelve las posiciones por division con victorias, derrotas, porcentaje, juegos atras, diferencial de carreras, rachas y toda la carrera por los playoffs (numeros magicos y de eliminacion, comodin, banderas de clasificacion).gamedevuelve el box score de un juego: line score por entrada, totales de carreras/hits/errores, lanzadores ganador, perdedor y de salvamento, y las lineas completas de bateo y pitcheo por jugador de ambos equipos.venuesdevuelve los estadios de MLB con capacidad, superficie, techo, coordenadas y zona horaria.leagues,divisions,seasonsdevuelven datos de referencia de MLB.
Cada modo usa un subconjunto distinto de los parametros y devuelve los campos relevantes. Los valores ausentes en la fuente se devuelven como null, nunca inventados.
Por que este scraper
El scraper de MLB mas completo en Apify. Es un superconjunto estricto de los demas actores de estadisticas de MLB: acepta todas sus entradas y devuelve todos sus campos, y ademas mas.
| Capacidad | Este actor | Actores tipicos de MLB |
|---|---|---|
| Equipos, rosters, stats de jugador, calendario, posiciones | Si | Si |
Box score / detalle de juego en vivo (modo game) | Si, con lineas completas por jugador de bateo y pitcheo | Algunos (solo resumen) |
Rosters por lote (teamIds) y jugadores por lote (playerIds) | Si | Algunos |
| Filtro por tipo de juego (regular, postemporada, primavera, all-star) | Si | Algunos |
Rango de fechas del calendario (startDate a endDate) | Si | Rara vez (solo una fecha) |
| Estadios, ligas, divisiones, temporadas | Si | Algunos (actor aparte) |
| Grupos de estadisticas de bateo, pitcheo y fildeo | Si | Normalmente solo bateo/pitcheo |
| Totales de carrera e historial ano por ano por jugador | Si | Rara vez |
| Carrera completa por los playoffs (numeros magicos/eliminacion, banderas) | Si | Rara vez |
| Line score por entrada + clima + asistencia | Si | Rara vez |
| URL de foto del jugador y enlaces a MLB.com | Si | Algunos |
| Sin clave de API | Si | Varia |
Casos de uso
- Datos de fantasy baseball: obten rosters, lineas de bateo y pitcheo y box scores diarios para alineaciones y proyecciones.
- Modelos de apuestas y cuotas: lanzadores probables, posiciones, diferencial de carreras y line scores por entrada.
- Analitica deportiva y tableros: estadisticas de temporada y carrera, splits y seguimiento de la carrera por los playoffs.
- Medios y contenido: marcadores, posiciones y resumenes por fecha o rango de fechas.
- Investigacion y ciencia de datos: temporadas historicas, estadios y datos de referencia en filas ordenadas.
Inicio rapido
Abre el actor, pega esto en la entrada y presiona Run. Devuelve 3 jugadores de los New York Yankees con estadisticas de temporada y biografia completas.
{"mode": "roster","teamId": "147","maxRecords": 3,"withDetails": true,"statGroup": "hitting"}
- Posiciones:
{"mode":"standings","leagueId":"103,104","season":2025} - Marcadores de un dia:
{"mode":"schedule","date":"2025-07-04"} - Un box score:
{"mode":"game","gamePks":["776500"]} - Estadisticas de un jugador:
{"mode":"players","playerIds":["592450","660271"]}
Modos
| Modo | Devuelve | Parametros clave |
|---|---|---|
teams | Los 30 clubes de MLB | season |
roster | Jugadores de uno o varios equipos | teamId, teamIds, season, withDetails, statGroup |
players | Perfil + estadisticas de temporada y carrera | playerIds, playerId, season, statGroup, gameType |
schedule | Juegos, marcadores, line scores, lanzadores probables | date, startDate, endDate, gameType, seasonType |
standings | Posiciones por division + carrera de playoffs | leagueId, season |
game | Box score, line score, decisiones, lineas por jugador | gamePks, gamePk, date, withDetails |
venues | Estadios de MLB | season |
leagues | AL y NL | season |
divisions | Divisiones de MLB | ninguno |
seasons | Calendario de temporadas de MLB | ninguno |
Referencia de entrada
| Campo | Tipo | Requerido | Predeterminado | Descripcion |
|---|---|---|---|---|
mode | enum | no | standings | teams, roster, players, schedule, standings, game, venues, leagues, divisions, seasons. |
season | entero | no | actual | Ano de temporada (teams, roster, players, standings, venues, leagues). |
teamId | enum | para roster | (ninguno) | ID del equipo cuyo roster obtener, por ejemplo 147 (New York Yankees). |
teamIds | string[] | no | (ninguno) | Lote de IDs de equipo para roster, combinado con teamId. |
playerIds | string[] | para players | ["592450","660271"] | IDs de jugador de MLB, por ejemplo 592450 (Aaron Judge), 660271 (Shohei Ohtani). |
playerId | string | no | (ninguno) | Un ID de jugador, combinado con playerIds. |
statGroup | enum | no | hitting | Linea a adjuntar en players/roster: hitting, pitching o fielding. |
date | string | para schedule/game | hoy | Fecha en YYYY-MM-DD, por ejemplo 2025-07-04. |
startDate | string | no | (ninguno) | Inicio de un rango de fechas del calendario (YYYY-MM-DD). |
endDate | string | no | (ninguno) | Fin de un rango de fechas del calendario (YYYY-MM-DD). |
gameType | string | no | (ninguno) | Tipo de juego de MLB: R regular, S primavera, A all-star, F comodin, D serie divisional, L campeonato de liga, W Serie Mundial, E exhibicion. Combina con comas. |
seasonType | enum | no | cualquiera | Atajo para gameType: regular, post, spring. |
gamePks | string[] | para game | (ninguno) | IDs de juego (gamePk) para el modo game. |
gamePk | string | no | (ninguno) | Un ID de juego, combinado con gamePks. |
leagueId | enum | no | 103,104 | Liga para standings: 103,104 (ambas), 103 (Americana), 104 (Nacional). |
withDetails | boolean | no | true | Roster: tambien obtiene stats y biografia de cada jugador. Game: tambien obtiene el box score completo por jugador. |
maxRecords | entero | no | (ninguno) | Maximo de registros por ejecucion. Los planes gratuitos se limitan a 10. |
Referencia de salida
Un elemento del dataset por equipo, jugador, juego, fila de posiciones, estadio, liga, division o temporada segun el mode. Los campos presentes dependen del modo. Tipos: string, integer, number, boolean, object, object[], o null cuando esta ausente.
| Campo | Tipo | Descripcion |
|---|---|---|
title | string | Nombre del equipo, jugador, juego, estadio, liga, division o temporada. |
id | integer | ID de MLB. |
url | string | URL oficial de MLB.com cuando esta disponible. |
teamName | string | Nombre del equipo (modos player y standings). |
abbreviation, league, division, venueName | string | Referencia del equipo (modo teams). |
position / positionName | string | Codigo y nombre de la posicion (roster/players). |
imageUrl | string | URL de la foto del jugador (roster/players). |
primaryNumber | string | Numero de camiseta. |
active, currentAge, birthDate, birthCity, birthStateProvince, birthCountry, height, weight, batSide, pitchHand, mlbDebutDate, draftYear | mixto | Biografia del jugador (roster/players). |
statSeason / statGroup | string | Temporada y grupo de la linea adjunta. |
gamesPlayed, atBats, runs, hits, doubles, triples, homeRuns, rbi, totalBases, baseOnBalls, strikeOuts, stolenBases, ... | integer | Contadores de temporada (conjunto completo de bateo, pitcheo o fildeo segun MLB). |
battingAverage, onBasePercentage, sluggingPercentage, ops, babip, era, whip, ... | string | Estadisticas de tasa de temporada (segun el formato de MLB). |
careerStats | object | Totales de carrera con las mismas claves. |
yearByYear | object[] | Historial por temporada, cada uno con season, teamId, teamName, leagueName y un objeto stats. |
wins, losses, winningPct, divisionRank, leagueRank, sportRank, gamesBack | mixto | Record y rangos del equipo (standings). |
runsScored, runsAllowed, runDifferential, streak, clinchIndicator | mixto | Totales de carreras, racha y clasificacion (standings). |
homeRecord, awayRecord, lastTenRecord, divisionRecord, oneRunRecord, extraInningsRecord, dayRecord, nightRecord, vsLeftRecord, vsRightRecord, expectedRecord | object | Records por split, cada uno con wins, losses, pct (standings). |
wildCardRank, magicNumber, eliminationNumber, clinched, divisionLeader, divisionChamp, hasWildcard | mixto | Campos de la carrera de playoffs (standings). |
status, gameType, gameDate, homeTeam, awayTeam, homeScore, awayScore | mixto | Resumen del juego (schedule/game). |
homeProbablePitcher / awayProbablePitcher | object | Lanzadores probables (schedule/game). |
homeTeamRecord / awayTeamRecord | object | Record de temporada de cada lado en el enfrentamiento. |
linescore | object | Line score: carreras por entrada, mas totales R/H/E y embasados de ambos equipos. |
winningPitcher / losingPitcher / savePitcher | object | Decisiones de pitcheo (juegos finalizados). |
weatherCondition, weatherTemp, weatherWind, attendance, firstPitch | mixto | Contexto del dia de juego cuando esta disponible. |
seriesDescription, seriesGameNumber, gamesInSeries | mixto | Contexto de serie (postemporada). |
homeTeamTotals / awayTeamTotals | object | Totales de bateo y pitcheo por equipo (modo game, detalles). |
homeBatters / awayBatters / homePitchers / awayPitchers | object[] | Lineas del box score por jugador (modo game, detalles). |
city, state, country, latitude, longitude, timeZone, capacity, turfType, roofType | mixto | Referencia del estadio (modo venues). |
observedAt | string | Marca de tiempo ISO 8601 de la recoleccion. |
error | string | null en exito. En una ejecucion fallida se escribe un unico elemento con el campo error poblado. |
Registros de ejemplo
Un registro real de posiciones (entrada {"mode":"standings","season":2025,"leagueId":"103,104"}):
{"title": "Blue Jays","id": 141,"url": "https://www.mlb.com/team/141","teamName": "Blue Jays","season": "2025","wins": 94,"losses": 68,"winningPct": ".580","divisionRank": "1","gamesBack": "-","runsScored": 798,"runsAllowed": 721,"runDifferential": 77,"streak": "W4","clinchIndicator": "z","clinched": true,"divisionChamp": true,"homeRecord": { "wins": 54, "losses": 27, "pct": ".667" },"lastTenRecord": { "wins": 5, "losses": 5, "pct": ".500" },"expectedRecord": { "wins": 88, "losses": 74, "pct": ".543" },"observedAt": "2026-08-10T14:40:45.707Z","error": null}
Los registros de roster y players agregan la biografia completa, la linea de temporada (bateo, pitcheo o fildeo), careerStats y un arreglo yearByYear. El modo game con withDetails agrega homeTeamTotals, awayTeamTotals y los arreglos por jugador homeBatters, awayBatters, homePitchers y awayPitchers.
Ejecutar via API y CLI
Inicia una ejecucion y lee el dataset. Reemplaza <TOKEN> con tu token de API de Apify.
Ejecucion sincrona que devuelve los elementos del dataset en una llamada:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~mlb-stats-scraper/run-sync-get-dataset-items?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"mode":"roster","teamId":"147","maxRecords":25,"withDetails":true,"statGroup":"hitting"}'
Iniciar una ejecucion asincrona:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~mlb-stats-scraper/runs?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"mode":"game","gamePks":["776500"],"withDetails":true}'
Apify CLI:
apify call scrapers_lat/mlb-stats-scraper \--input '{"mode":"standings","leagueId":"103,104","season":2025}'
Obtener resultados
Cada ejecucion escribe en un dataset. Obten los elementos en JSON, CSV o Excel cambiando format:
# JSONcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"# CSVcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"# Paginar datasets grandescurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&offset=1000&limit=1000"
<DATASET_ID> se devuelve como defaultDatasetId en el objeto de la ejecucion. Usa offset y limit para paginar. clean=true elimina campos vacios e internos.
Facturacion y limites
- Pago por resultado. Se cobra por registro devuelto (evento
result). Consulta la pestana de precios para el precio actual por resultado. - Complemento de detalles. En modo
rosterconwithDetailsactivado, se aplica un cargodetailspor cada jugador cuyas estadisticas y biografia se obtienen. En modogameconwithDetailsactivado, se aplica un cargodetailspor cada juego cuyo box score completo por jugador se obtiene. Desactivalo para una ejecucion mas rapida solo de listado. - Sin cargo en caso de fallo. Si una ejecucion falla, el actor escribe un unico elemento con el campo
errorpoblado y no cobra por el. Las ejecuciones vacias no cuestan nada. - Limite de gasto respetado. Ajusta
maxTotalChargeUsden la ejecucion. Al alcanzarlo, el actor deja de emitir y cobrar mas resultados facturables. - Los planes gratuitos de Apify se limitan a 10 registros por ejecucion. Mejora tu plan para un
maxRecordsmayor.
Preguntas frecuentes
Necesito una clave de API de MLB? No. No hay clave de API, token ni inicio de sesion. Elige un modo y ejecuta.
Como encuentro un ID de jugador o de juego?
Ejecuta el modo teams o roster para los IDs de jugador, y el modo schedule para los IDs de juego (el campo id es el gamePk). Pasalos al modo players o game.
Obtengo estadisticas de bateo, pitcheo o fildeo?
Ajusta statGroup a hitting, pitching o fielding en modo roster o players. La linea elegida se adjunta a cada jugador.
Puedo obtener solo postemporada?
Si. Ajusta seasonType a post, o gameType a F,D,L,W.
Puedo obtener un mes entero de juegos?
Si. Usa startDate y endDate en modo schedule para un rango de fechas.
Por que algunos campos son null o vacios?
Los campos dependen del modo y del estado del juego. Un registro de posiciones no tiene estadisticas de bateo; un juego antes del primer lanzamiento no tiene line score. Los valores ausentes en la fuente se devuelven como null, nunca inventados.
Que temporada usa por defecto?
La temporada actual de MLB cuando season esta vacio. Ajusta season para datos historicos.
Es una herramienta oficial de MLB? No. Este actor es independiente y no tiene afiliacion con Major League Baseball. Lee unicamente datos disponibles publicamente en la API de MLB Stats. Usalo conforme a los terminos de MLB.
Scrapers relacionados
- ESPN Soccer Scraper: marcadores, posiciones y equipos de futbol.
- FIFA World Cup Scraper: partidos y posiciones del Mundial.
- Datos deportivos de ESPN y ligas: mas scrapers deportivos en el catalogo.
- Kalshi Markets Scraper: mercados de prediccion de eventos y deportes.
- Eventbrite Scraper: eventos en vivo y boletos.
- Google News Scraper: cobertura deportiva y noticias generales.
Mas scrapers en scrapers.lat
Creado y mantenido por scrapers.lat, donde publicamos scrapers de plataformas publicas de EE. UU. y America Latina: registros de empresas, datos de gobierno, finanzas, e-commerce y mas. Explora el catalogo o solicita un scraper a medida en scrapers.lat.
Herramienta independiente, sin afiliacion con Major League Baseball. Accede unicamente a datos disponibles publicamente en la API de MLB Stats. Usala conforme a los terminos de MLB.
