Imp Imp
← Back to Arsenal
MLB Stats API - Baseball Data

MLB Stats API - Baseball Data

Other

Comprehensive MLB baseball statistics including player stats, game logs, standings & historical data. Perfect for fantasy sports, betting & analytics.

MLB Stats API

"Complete MLB Data in Clean JSON" by John Rippy | johnrippy.link
🏆 2025 Zapier Automation Hero of the YearProject Phoenix: A 95-step AI sales pipeline cutting development time by 50%. Read more →

---

Simple Access to Official MLB Statistics

The MLB Stats API exists but is complex and poorly documented. Hundreds of endpoints, nested responses, and frequent changes make it frustrating to use. What if you could get clean, simple MLB data with one API call?

The MLB Stats API actor wraps the official MLB API and returns clean, structured data:

No API key required. No authentication needed. Just simple JSON responses.

---

Why Use This Instead of Direct API Access

1. Clean Data Structure

Raw MLB API returns inconsistent, deeply nested JSON. We normalize everything.

Raw MLB API:
{

"people": [{

"id": 660271,

"fullName": "Shohei Ohtani",

"stats": [{

"type": {"displayName": "season"},

"splits": [{

"stat": {"homeRuns": 54}

}]

}]

}]

}

Our API:
{

"player": "Shohei Ohtani",

"playerId": 660271,

"team": "Los Angeles Dodgers",

"homeRuns": 54,

"battingAverage": ".310"

}

2. No Authentication Needed

We handle all the complexity. You just make requests.

3. Stable Endpoints

MLB changes their API frequently. We maintain compatibility.

4. Both Batting and Pitching Stats

Get comprehensive stats for any player in one call.

---

Available Tasks

---

Quick Start Examples

Example 1: Get Current Standings

{

"task": "standings"

}

Example 2: Get Team Roster

{

"task": "team_roster",

"teamId": 119

}

Example 3: Get Player Stats

{

"task": "player_stats",

"playerId": 660271,

"season": "2024"

}

Example 4: Today's Schedule

{

"task": "schedule",

"date": "2025-04-15"

}

---

Team IDs Reference

---

Output Examples

Standings Response

{

"task": "standings",

"success": true,

"data": {

"season": "2024",

"standings": [

{

"division": "AL East",

"teams": [

{

"rank": 1,

"team": "Baltimore Orioles",

"teamId": 110,

"wins": 91,

"losses": 71,

"pct": ".562",

"gamesBack": "-",

"wildCard": "-",

"runsScored": 765,

"runsAllowed": 640,

"runDifferential": 125,

"streak": "W3",

"last10": "7-3"

}

]

}

]

}

}

Player Stats Response

{

"task": "player_stats",

"success": true,

"data": {

"player": {

"id": 660271,

"name": "Shohei Ohtani",

"team": "Los Angeles Dodgers",

"position": "DH",

"jerseyNumber": 17,

"bats": "L",

"throws": "R",

"batting": {

"gamesPlayed": 159,

"atBats": 636,

"runs": 134,

"hits": 197,

"doubles": 38,

"triples": 6,

"homeRuns": 54,

"rbi": 130,

"stolenBases": 59,

"battingAverage": ".310",

"obp": ".390",

"slg": ".646",

"ops": "1.036"

}

}

}

}

---

Pay-Per-Event Pricing

You only pay for what you use. No API key costs. No rate limit fees.

Cost Examples

Free tier available for testing.

---

Use Cases

Fantasy Baseball

Sports Analytics

Apps & Websites

Media & Content

---

API Integration

Using the Apify API (JavaScript)

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('localhowl/mlb-stats-api').call({

task: 'player_stats',

playerId: 660271

});

const { items } = await client.dataset(run.defaultDatasetId).listItems();

console.log(items[0].data.player);

Using cURL

curl -X POST "https://api.apify.com/v2/acts/localhowl~mlb-stats-api/runs?token=YOUR_API_TOKEN" \

-H "Content-Type: application/json" \

-d '{

"task": "standings"

}'

---

Webhook Integration

Webhook Payload Format

{

"event": "task_completed",

"timestamp": "2025-04-15T12:00:00.000Z",

"actor": "mlb-stats-api",

"task": "standings",

"success": true,

"data": { ... }

}

Automation Ideas

---

Limitations

---

Support

🏆 2025 Zapier Automation Hero of the YearProject Phoenix: A 95-step AI sales pipeline cutting development time by 50%. Read more →

---

Built by John Rippy | johnrippy.link
🏆 2025 Zapier Automation Hero of the YearProject Phoenix: A 95-step AI sales pipeline cutting development time by 50%. Read more →

---

Keywords

mlb api, baseball api, mlb stats, baseball statistics, mlb standings, mlb scores, baseball data, mlb player stats, fantasy baseball api, sports data api, mlb schedule, baseball scraper, mlb data feed, sports analytics, sabermetrics

149,000
KILLS
100%
HEALTH
Doomguy
274
ACTORS
0/3
SECRETS