MLB Stats 💰$2/1K — Rosters & Season Stats avatar

MLB Stats 💰$2/1K — Rosters & Season Stats

Pricing

from $2.00 / 1,000 record returneds

Go to Apify Store
MLB Stats 💰$2/1K — Rosters & Season Stats

MLB Stats 💰$2/1K — Rosters & Season Stats

Scrape statsapi.mlb.com for every MLB player in a season: full roster with batting, pitching and fielding stats, plus club, league, division, venue, position, birth city and country, and debut year. One row per player as structured JSON or CSV.

Pricing

from $2.00 / 1,000 record returneds

Rating

0.0

(0)

Developer

Black Falcon Data

Black Falcon Data

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 days ago

Last modified

Share

What does MLB Stats do?

MLB Stats extracts structured player data from statsapi.mlb.com. It supports keyword search and controllable result limits, so you can run the same query consistently over time. The actor also offers detail enrichment (extra per-record fields the search results omit).

New to Apify? Sign up free and use the included $5 monthly platform credit to test this actor.

Key features

  • ⚾ Whole-season roster in one run — leave the search box empty and you get every player on the season roster — 1,373 for the 2026 MLB season — not a keyword slice. Pick any past season, or point it at Triple-A, Double-A, High-A or Single-A instead.
  • 📊 Full batting, pitching and fielding lines — each player carries the complete season stat line as the source publishes it — 34 batting fields, 62 pitching fields, plus fielding — alongside the headline columns (AVG, OBP, SLG, OPS, HR, RBI, ERA, WHIP, IP, W-L, SV) as flat top-level fields you can sort a spreadsheet by.
  • 🏟️ Club context joined onto every player — club, league, division, venue, abbreviation and franchise are attached to each player, including players optioned to a minor-league affiliate — not just the ones on a major-league active roster.
  • ♻️ Incremental mode — recurring runs emit only players who are new or whose club, position or status changed — roster churn without re-fetching the league. Seasons never share state, so a 2026 run cannot mark 2025 players as gone.
  • 🧹 Empty-field stripping — drop null, empty-string, and empty-array fields from each record before push. Smaller payloads for AI agents and dashboards that already handle missing fields gracefully.
  • 📤 Export anywhere — Download the dataset as JSON, CSV, or Excel from the Apify Console, or stream live via the Apify API and integrations (Make, Zapier, Google Sheets, n8n, …).

What data can you extract from statsapi.mlb.com?

Each result includes Core player fields (listingId, statsSeason, hittingStats, pitchingStats, fieldingStats, gamesPlayed, atBats, and hits, and more) and detail fields when enrichment is enabled (detailFetched). In standard mode, all fields are always present — unavailable data points are returned as null, never omitted. In compact mode, only core fields are returned.

Enable detail enrichment in the input to fetch each record's detail page — extra fields the search results omit.

Input

The main inputs are a search keyword and a result limit. Additional filters and options are available in the input schema.

Key parameters:

  • query — Name to match against the season roster — a full or partial player name (e.g. "Ohtani", "Aaron Judge", "Rodriguez"). Matching is case-insensitive and substring-based. LEAVE EMPTY to get the complete roster for the season.
  • season — Season year to pull, e.g. 2026. Defaults to the current year. Historical seasons are served the same way.
  • sportId — 1 = Major League Baseball (default). 11 = Triple-A, 12 = Double-A, 13 = High-A, 14 = Single-A.
  • startUrls — Paste raw search URLs from the target site. Each URL becomes its own search task; results are merged and deduped by record ID across all URLs. When provided AND parseable, startUrls REPLACE the query field (each URL becomes one task). Implement parseStartUrl() in src/searchTasks.ts for your target site — without it, all URLs are skipped and the actor falls back to query. (default: [])
  • maxResults — Maximum total records (0 = unlimited — the whole roster). (default: 25)
  • includeDetails — Fetch full records — season stats, biography, position, handedness and current club. Turn off for a faster, name-only run. (default: true)
  • includeRosterStatus — Add each player's current roster status — Active, Injured 10-Day, Injured 60-Day, Reassigned to Minors, Released — plus the date it took effect. Roughly doubles the amount of data fetched per player. Requires 📋 Include Full Details; without it this option is skipped and not charged. (default: false)
  • includeAwards — Add All-Star and Futures Game selections and similar honours, with the season each was won. Adds about 60% to the data fetched per player. Needs 📋 Include Full Details switched on — otherwise it is skipped, and not charged. (default: false)
  • includeTransactions — Add signings, trades and injured-list placements with their dates and the league's own wording. This is where injury dates come from. Substantially increases the data fetched per player — leave off unless you need the history. Only runs when 📋 Include Full Details is on; skipped and not charged otherwise. (default: false)
  • compact — Core fields only (for AI-agent/MCP workflows). (default: false)
  • excludeEmptyFields — Drop null, empty-string, and empty-array fields from each record before push. Smaller payloads for AI agents and dashboards. (default: false)
  • incrementalMode — Compare against previous run state. stateKey is optional — defaults to a value derived from search inputs (queries, startUrls) so different filter sets never share state. (default: false)
  • ...and 18 more parameters

Input examples

Whole 2026 season roster — undefined

→ undefined

{
"season": 2026,
"maxResults": 0,
"includeDetails": true
}

One player by name — undefined

→ undefined

{
"query": "Ohtani",
"season": 2026,
"includeDetails": true
}

A past season — undefined

→ undefined

{
"query": "",
"season": 2019,
"maxResults": 500,
"includeDetails": true
}

Triple-A instead of the majors — undefined

→ undefined

{
"query": "",
"sportId": 11,
"season": 2026,
"maxResults": 1000
}

Weekly roster-change monitor — undefined

→ undefined

{
"query": "",
"season": 2026,
"maxResults": 0,
"incrementalMode": true,
"emitExpired": true
}

Output

Each run produces a dataset of structured player records. Results can be downloaded as JSON, CSV, or Excel from the Dataset tab in Apify Console.

Example player record

{
"listingId": "0fac9d9cfbdd954979ad050d3e051c6c67ad493ad02fc9a0331b5393c940824d",
"statsSeason": 2026,
"pitchingStats": {
"age": 27,
"gamesPlayed": 24,
"gamesStarted": 24,
"groundOuts": 118,
"airOuts": 157,
"runs": 60,
"doubles": 15,
"triples": 1,
"homeRuns": 17,
"strikeOuts": 99,
"baseOnBalls": 61,
"intentionalWalks": 0,
"hits": 118,
"hitByPitch": 0,
"avg": ".242",
"atBats": 487,
"obp": ".324",
"slg": ".382",
"ops": ".706",
"caughtStealing": 4,
"stolenBases": 21,
"stolenBasePercentage": ".840",
"caughtStealingPercentage": ".160",
"groundIntoDoublePlay": 6,
"numberOfPitches": 2223,
"era": "3.92",
"inningsPitched": "128.2",
"wins": 6,
"losses": 7,
"saves": 0,
"saveOpportunities": 0,
"holds": 0,
"blownSaves": 0,
"earnedRuns": 56,
"whip": "1.39",
"battersFaced": 555,
"outs": 386,
"gamesPitched": 24,
"completeGames": 0,
"shutouts": 0,
"strikes": 1388,
"strikePercentage": ".620",
"hitBatsmen": 0,
"balks": 0,
"wildPitches": 0,
"pickoffs": 2,
"totalBases": 186,
"groundOutsToAirouts": "0.75",
"winPercentage": ".462",
"pitchesPerInning": "17.28",
"gamesFinished": 0,
"strikeoutWalkRatio": "1.62",
"strikeoutsPer9Inn": "6.92",
"walksPer9Inn": "4.27",
"hitsPer9Inn": "8.25",
"runsScoredPer9": "4.20",
"homeRunsPer9": "1.19",
"inheritedRunners": 0,
"inheritedRunnersScored": 0,
"catchersInterference": 2,
"sacBunts": 0,
"sacFlies": 5
},
"fieldingStats": {
"age": 27,
"gamesPlayed": 24,
"gamesStarted": 24,
"assists": 9,
"putOuts": 1,
"errors": 1,
"chances": 11,
"fielding": ".909",
"position": {
"code": "1",
"name": "Pitcher",
"type": "Pitcher",
"abbreviation": "P"
},
"rangeFactorPerGame": "0.42",
"rangeFactorPer9Inn": "0.70",
"innings": "128.2",
"games": 24,
"doublePlays": 0,
"triplePlays": 0,
"throwingErrors": 1
},
"gamesPlayed": 24,
"strikeOuts": 99,
"baseOnBalls": 61,
"era": "3.92",
"inningsPitched": "128.2",
"wins": 6,
"losses": 7,
"saves": 0,
"whip": "1.39",
"college": "Virginia",
"highSchool": "Halifax County",
"rosterStatus": "Active",
"rosterStatusCode": "A",
"rosterStatusDate": "2026-04-16",
"isActiveRoster": true,
"isOn40Man": true,
"awards": [
{
"id": "FUTURES",
"name": "Futures Game Selection",
"season": "2022",
"date": "2022-07-07"
},
{
"id": "AASPOMP",
"name": "SOU Pitcher of the Month",
"season": "2022",
"date": "2022-09-18"
},
{
"id": "MILBORGAS",
"name": "MiLB.com Organization All-Star",
"season": "2022",
"date": "2022-11-07"
},
{
"id": "SOUPOWP",
"name": "SOU Pitcher of the Week",
"season": "2023",
"date": "2023-04-16"
},
{
"id": "BAMLART",
"name": "Baseball America Major League All-Rookie Team",
"season": "2023",
"date": "2023-10-05"
},
"... 4 more items"
],
"transactions": [
{
"date": "2016-07-15",
"effectiveDate": "2016-07-15",
"typeDesc": "Assigned",
"description": "LHP Andrew Abbott assigned to Evoshield Canes."
},
{
"date": "2019-02-14",
"effectiveDate": "2019-02-14",
"typeDesc": "Assigned",
"description": "LHP Andrew Abbott assigned to Virginia Cavaliers."
},
{
"date": "2021-07-20",
"effectiveDate": "2021-07-20",
"typeDesc": "Signed",
"description": "Cincinnati Reds signed LHP Andrew Abbott."
},
{
"date": "2021-08-17",
"effectiveDate": "2021-08-17",
"typeDesc": "Assigned",
"description": "LHP Andrew Abbott assigned to ACL Reds from Reds Organization."
},
{
"date": "2021-08-17",
"effectiveDate": "2021-08-17",
"typeDesc": "Assigned",
"description": "LHP Andrew Abbott assigned to Reds Organization."
},
"... 22 more items"
],
"recordType": "player",
"teamId": 113,
"name": "Andrew Abbott",
"teamName": "Cincinnati Reds",
"clubName": "Reds",
"franchiseName": "Cincinnati",
"abbreviation": "CIN",
"teamCode": "cin",
"locationName": "Cincinnati",
"league": "National League",
"leagueId": 104,
"division": "National League Central",
"divisionId": 205,
"venueId": 2602,
"venueName": "Great American Ball Park",
"springVenueId": 3834,
"fileCode": "cin",
"springLeagueId": 114,
"springLeague": "Cactus League",
"firstYearOfPlay": 1882,
"season": 2026,
"active": true,
"url": "https://www.mlb.com/player/andrew-abbott-671096",
"portalUrl": "https://www.mlb.com/player/andrew-abbott-671096",
"playerId": 671096,
"fullName": "Andrew Abbott",
"firstName": "Andrew",
"middleName": "Cole",
"lastName": "Abbott",
"useName": "Andrew",
"useLastName": "Abbott",
"boxscoreName": "Abbott, A",
"nameSlug": "andrew-abbott-671096",
"primaryNumber": "41",
"primaryPosition": {
"code": "1",
"name": "Pitcher",
"type": "Pitcher",
"abbreviation": "P"
},
"batSide": {
"code": "L",
"description": "Left"
},
"pitchHand": {
"code": "L",
"description": "Left"
},
"currentTeam": {
"id": 113,
"name": "Cincinnati Reds",
"link": "https://statsapi.mlb.com/api/v1/teams/113"
},
"birthDate": "1999-06-01",
"currentAge": 27,
"birthCity": "Lynchburg",
"birthStateProvince": "VA",
"birthCountry": "USA",
"height": "6' 0\"",
"weight": 192,
"gender": "M",
"isPlayer": true,
"isVerified": true,
"draftYear": 2021,
"mlbDebutDate": "2023-06-05",
"strikeZoneTop": 3.37,
"strikeZoneBottom": 1.54,
"link": "https://statsapi.mlb.com/api/v1/people/671096",
"headshotUrl": "https://midfield.mlbstatic.com/v1/people/671096/spots/120",
"contentQuality": "full",
"detailFetched": true,
"scrapedAt": "2026-08-11T18:26:29.012Z",
"source": "statsapi.mlb.com"
}

Incremental fields

When incremental mode is on, each record also carries:

  • changeType — one of NEW, UPDATED, UNCHANGED, REAPPEARED, EXPIRED. Default output covers NEW / UPDATED / REAPPEARED; set emitUnchanged: true or emitExpired: true to opt into the others.
  • isRepost, repostOfId, repostDetectedAt — populated when a new listing matches the tracked content of a previously expired one. Set skipReposts: true to drop detected reposts from the output.

How to scrape statsapi.mlb.com

  1. Go to MLB Stats in Apify Console.
  2. Enter a search keyword.
  3. Set maxResults to control how many results you need.
  4. Enable includeDetails if you need the extra detail-page fields.
  5. Click Start and wait for the run to finish.
  6. Export the dataset as JSON, CSV, or Excel.

Use cases

  • Extract player data from statsapi.mlb.com for market research and competitive analysis.
  • Monitor new and changed players on scheduled runs without processing the full dataset every time.
  • Feed structured data into AI agents, MCP tools, and automated pipelines using compact mode.
  • Export clean, structured data to dashboards, spreadsheets, or data warehouses.

How much does it cost to scrape statsapi.mlb.com?

MLB Stats uses pay-per-event pricing. You pay a small fee when the run starts and then for each result that is actually produced.

  • Run start: $0.01 per run
  • Per record returned (primary event): $0.002

You are billed only for the events your run actually triggers. Prices below are the Free plan tier.

EventPrice (Free tier)Charged when
Run start$0.01 (one-time)Charged once when the run starts.
Record returned (primary)$0.002A record delivered to your dataset: a player, a team, or — in incremental mode with Include Expired on — an EXPIRED marker for a player who is no longer on the roster. All three are charged at this same rate, and team rows and EXPIRED markers are charged at this rate only: the enrichment fees below never apply to them.
Roster & injury status$0.0015Current roster or injury status, with the date it took effect. Charged once for every player returned while Include Roster & Injury Status is on — including players with no status to report, because the lookup ran either way. The fields stay on the record so you can see the result.
Awards$0.0015All-Star and Futures Game selections and similar honours. Charged once for every player returned while Include Awards is on — including players with no awards, because the lookup ran either way. The field stays on the record as an empty list so you can see the result.
Transaction history$0.0025Signings, trades and injured-list placements with their dates. Charged once for every player returned while Include Transaction History is on — including players with no transactions, because the lookup ran either way. An empty list on the record is how you tell that apart from never having asked.

Example costs (primary event only — other events above add cost when they fire):

  • 10 results: $0.03
  • 25 results: $0.06
  • 100 results: $0.21
  • 200 results: $0.41
  • 500 results: $1.01

Example: recurring monitoring savings

These examples compare full re-scrapes with incremental runs at different churn rates. Churn is the share of players that are new or whose tracked content changed since the previous run. Actual churn depends on your query breadth, source activity, and polling frequency — the scenarios below are examples, not predictions.

Example setup: 100 players per run, daily polling (30 runs/month). Costs scale linearly with the number of players.

Numbers below are for the primary Record returned event. Other events (Roster & injury status, Awards, Transaction history) are billed separately when they fire.

Churn rateFull re-scrape run costIncremental run costSavings vs full re-scrapeMonthly cost after baseline
5% — stable niche query$0.21$0.02$0.19 (90%)$0.60
15% — moderate broad query$0.21$0.04$0.17 (81%)$1.20
30% — high-volume aggregator$0.21$0.07$0.14 (67%)$2.10

Full re-scrape monthly cost at the same cadence: $6.30. First month with incremental costs $0.79 / $1.37 / $2.24 for the 5% / 15% / 30% scenarios because the first run builds baseline state at full cost before incremental savings apply.

Platform usage is included in the per-result fee shown above.

FAQ

How many results can I get from statsapi.mlb.com?

The number of results depends on the search query and available players on statsapi.mlb.com. Use the maxResults parameter to control how many results are returned per run.

Does MLB Stats support recurring monitoring?

Yes. Enable incremental mode to only receive new or changed players on subsequent runs. This is ideal for scheduled monitoring where you want to track changes over time without re-processing the full dataset.

Can I integrate MLB Stats with other apps?

Yes. MLB Stats works with Apify's integrations to connect with tools like Zapier, Make, Google Sheets, Slack, and more. You can also use webhooks to trigger actions when a run completes.

Can I use MLB Stats with the Apify API?

Yes. You can start runs, manage inputs, and retrieve results programmatically through the Apify API. Client libraries are available for JavaScript, Python, and other languages.

Can I use MLB Stats through an MCP Server?

Yes. Apify provides an MCP Server that lets AI assistants and agents call this actor directly. Use compact mode, a single descriptionFormat, and excludeEmptyFields to keep payloads manageable for LLM context windows.

This actor extracts publicly available data from statsapi.mlb.com. Web scraping of public information is generally considered legal, but you should always review the target site's terms of service and ensure your use case complies with applicable laws and regulations, including GDPR where relevant.

Your feedback

If you have questions, need a feature, or found a bug, please open an issue on the actor's page in Apify Console. Your feedback helps us improve.

You might also like

Getting started with Apify

New to Apify? Create a free account with $5 credit — no credit card required.

  1. Sign up — $5 platform credit included
  2. Open this actor and configure your input
  3. Click Start — export results as JSON, CSV, or Excel

Need more later? See Apify pricing.

Disclaimer

This actor accesses only publicly available data on statsapi.mlb.com. You are responsible for how you use the extracted data — in particular any personal information such as names, phone numbers, or email addresses — and for complying with MLB Stats's terms of use, applicable data-protection law (including the GDPR where it applies), and the anti-spam rules of your jurisdiction.

This actor is not affiliated with, endorsed by, or connected to MLB Stats.

Search keywords

mlb stats scraper, mlb stats api, apify mlb stats, mlb stats data extraction, statsapi.mlb.com scraper, statsapi.mlb.com data, statsapi.mlb.com api.