MLB API
Realtime Sports API serves MLB games through the same REST endpoints and JSON schema as every other league, using sport=baseball and league=mlb. You get the current scoreboard, live scores, game detail, play-by-play, teams, rosters and news, plus current odds and line history from a single source book and the injury report. Data is aggregated from public sources and is typically 20-30 seconds behind live play (about 1 second after our source). There is no SLA.
- Slugs
- sport=baseball
league=mlb - Teams
- 30
- Season (from data)
- 2026 Postseason
- In the scoreboard now
- 1 games
Recent MLB results
| Date | Away | Home | Time / Result | TV | Venue |
|---|---|---|---|---|---|
| Wed, Oct 28 | Milwaukee Brewers | atTampa Bay Rays | 4 - 1 Final | TV: Fox, ERADM | Tropicana Field · St. Petersburg, Florida |
From the /events endpoint for this league, refreshed every few minutes. Times are US Eastern. Full MLB schedule · MLB team APIs · Free MLB scoreboard widget
Live example
Request
curl -H "Authorization: Bearer $RSA_API_KEY" \
"https://www.realtimesportsapi.com/api/v1/sports/baseball/leagues/mlb/events?limit=1"Response captured from live data at 2026-11-21 20:36 UTC (refreshed every few minutes). Long arrays are trimmed; meta.rateLimit values are illustrative for a Free key.
Response
{
"success": true,
"data": [
{
"id": "401908046",
"uid": "s:1~l:10~e:401908046",
"name": "Milwaukee Brewers at Tampa Bay Rays",
"shortName": "MIL @ TB",
"date": "2026-10-29T00:00Z",
"status": {
"state": "post",
"completed": true,
"period": 9,
"clock": "0:00",
"detail": "Final",
"halftime": false,
"firstHalfEnded": true,
"inning": {
"number": 9,
"half": null,
"outs": null,
"balls": null,
"strikes": null,
"onFirst": null,
"onSecond": null,
"onThird": null
}
},
"homeTeam": {
"id": "30",
"name": "Tampa Bay Rays",
"abbreviation": "TB",
"logo": "https://realtimesportsapi.com/api/images/proxy?id=GgcVSgNPTUMITUgaFFQVVVQXBVwOHV5LRQBZD1lbBllDXR4NWF9AUlxGF09HFFQR",
"color": "092c5c",
"alternateColor": "8fbce6",
"winner": false,
"score": 1
},
"awayTeam": {
"id": "8",
"name": "Milwaukee Brewers",
"abbreviation": "MIL",
"logo": "https://realtimesportsapi.com/api/images/proxy?id=GgcVSgNPTUMITUgaFFQVVVQXBVwOHV5LRQBZD1lbBllDXR4NWF9AUlxGDkQFSkoYVg",
"color": "13294b",
"alternateColor": "ffc72c",
"winner": true,
"score": 4
},
"competition": {
"attendance": 40489,
"neutralSite": false,
"conferenceCompetition": false,
"divisionCompetition": false,
"playByPlayAvailable": true,
"highlightsAvailable": true
},
"venue": {
"id": "31",
"name": "Tropicana Field",
"city": "St. Petersburg",
"state": "Florida",
"indoor": true,
"grass": false
},
"notes": [
"World Series - Game 5"
],
"season": {
"year": 2026,
"displayName": "2026",
"type": {
"id": "3",
"name": "Postseason",
"abbreviation": "post"
},
"week": {}
},
"broadcasts": [
{
"network": "Fox",
"type": "TV"
},
{
"network": "ERADM",
"type": "Radio"
}
],
"officials": [
{
"displayName": "Vic Carapazza",
"order": 1,
"position": "Home Plate Umpire"
},
{
"displayName": "Tripp Gibson",
"order": 2,
"position": "First Base Umpire"
},
{
"displayName": "Gabe Morales",
"order": 3,
"position": "Second Base Umpire"
},
"... 3 more"
]
}
],
"meta": {
"rateLimit": {
"limit": 125,
"remaining": 124,
"reset": 1796083200000
}
}
}MLB endpoints
Checked against live data on 2026-10-04. Paths are relative to /api/v1/sports/baseball/leagues/mlb.
| Endpoint | Path | MLB | Notes |
|---|---|---|---|
| Live scores | /events/live | Available | |
| Events (scoreboard) | /events | Available | |
| Event detail | /events/{eventId} | Available | |
| Play-by-play | /events/{eventId}/plays | Available | |
| Box score | /events/{eventId}/boxscore | Available | |
| Odds | /events/{eventId}/odds | Available | |
| Win probability | /events/{eventId}/winprobability | Available | |
| Teams | /teams | Available | |
| Rosters | /teams/{teamId}/roster | Available | |
| Athletes | /athletes/search | Available | |
| Injuries | /injuries | Available | |
| News | /news | Available | |
| Schedule / weeks | /seasons/{season}/schedule | Available | |
| NCAA tournament | /seasons/{season}/tournament | Not available | |
| Rankings | /rankings | Not available | |
| Webhooks | /webhooks | Available | |
| WebSocket | /websocket/auth | Available |
- Schedules are by date, not week: use /events for the current scoreboard and /seasons/{season}/schedule for a season. Week parameters return SCHEDULE_WEEKS_NOT_SUPPORTED.
Every MLB game in the events, live and schedule endpoints uses the same Event object as other leagues: Event object field reference.
MLB API in Python, JavaScript and curl
curl
curl -H "Authorization: Bearer $RSA_API_KEY" \
"https://www.realtimesportsapi.com/api/v1/sports/baseball/leagues/mlb/events?limit=5"JavaScript (fetch)
const res = await fetch("https://www.realtimesportsapi.com/api/v1/sports/baseball/leagues/mlb/events?limit=5", {
headers: { Authorization: `Bearer ${process.env.RSA_API_KEY}` }
});
const { success, data, meta } = await res.json();
console.log(data, meta.rateLimit);Python (requests)
import os, requests
res = requests.get(
"https://www.realtimesportsapi.com/api/v1/sports/baseball/leagues/mlb/events?limit=5",
headers={"Authorization": f"Bearer {os.environ['RSA_API_KEY']}"},
timeout=10,
)
body = res.json()
print(body["data"])MCP prompt (Claude, Cursor, ChatGPT)
Using the Realtime Sports MCP server (https://www.realtimesportsapi.com/api/mcp), call get_events with sport "baseball" and league "mlb" and list the games it returns with start times, status and scores for MLB.Connect the hosted MCP server first: setup guide. Each tool call counts as one API call.
Each request above is 1 call. Free covers 125 calls a month after a 1,000-call first month, at 1 request/second. Starter is $29/month for 10,000 calls (about 333 a day) plus webhooks and WebSocket, so you stop polling for changes; 7-day free trial. Compare plans
Real-time MLB push: WebSocket and webhooks
Instead of polling, paid plans can receive every MLB game start, score change and final as it is detected (typically 20-30 seconds behind live play): a MLB WebSocket feed for live dashboards and apps, or MLB webhooks that POST each event to your server. On the Free plan you can watch the stream and send yourself a sample webhook from the dashboard.
Shipping a product with MLB data?
Polling works on every plan. Production apps usually also want events pushed to them, by webhook or WebSocket, as soon as we detect them (typically 20-30 seconds behind live play). These guides show the setup and the plan each one needs.
- Score alerts for your sports app, without pollingWebhooks into your backend, then FCM/APNs · Starter ($29/mo)
- Live scoreboards and game pages for news and media sitesCached REST on your server; optional WebSocket for live ticks · Starter ($29/mo)
- Player stats and box scores for fantasy platformsREST box scores during games, webhooks for finals and plays · Growth ($49/mo)
- Live scores on the screens in your venueFree widget, or one WebSocket feeding every screen · Starter ($29/mo)
- A play-by-play feed for your analytics stackWebSocket for live plays, REST to backfill and reconcile · Growth ($49/mo)
- Stream live scores to your backend over WebSocketWebSocket (server to server) · Starter ($29/mo)
- Sports data for a startup, from prototype to scaleREST, WebSocket and webhooks on one key · Starter ($29/mo)
MLB API pricing and rate limits
The MLB API is included in every plan, Free included: one key covers all leagues. Free starts with 1,000 calls in your first 30 days (no card); paid plans start at $29/month with a 7-day free trial.
| Plan | Price | Calls | Rate | WebSocket | Webhooks |
|---|---|---|---|---|---|
| Free | $0 | 125/mo (1,000 first 30 days) | 1/s | 500 msgs/mo | No |
| Starter | $29/mo ($290/yr) | 10,000/mo | 5/s | Shares monthly pool | Shares monthly pool |
| Growth | $49/mo ($490/yr) | 25,000/mo | 10/s | Shares monthly pool | Shares monthly pool |
| Pro | $99/mo ($990/yr) | 50,000/mo | 20/s | 100,000 msgs/mo | 25,000/mo |
| Business | $179/mo ($1,790/yr) | 150,000/mo | 40/s | 300,000 msgs/mo | 75,000/mo |
| Scale | $299/mo ($2,990/yr) | 500,000/mo | 100/s | 500,000 msgs/mo | 100,000/mo |
Every successful REST call counts as one call. Over the limit you get HTTP 429 with a Retry-After header. No SLA. Full pricing.
29 leagues monitored live: NFL, college football, NBA, men's college basketball, MLB, NHL and 23 soccer competitions.
FAQ
- Is there a free MLB API?
- Yes. The Free plan is $0 with 125 calls per month (1,000 in the first 30 days) at 1 request per second, no card required. The same key works for all 29 leagues.
- How fresh is the MLB data?
- Data is aggregated from public sources and is typically 20-30 seconds behind live play (about 1 second after our source). There is no SLA. It is not intended for in-play betting that needs sub-second data.
- Which MLB endpoints are available?
- Available: live scores, events (scoreboard), event detail, play-by-play, box score, odds, win probability, teams, rosters, athletes, injuries, news, schedule / weeks. Not available or not verified: ncaa tournament (not available), rankings (not available).
- Does the MLB API include betting odds?
- Yes. Upcoming MLB games returned a spread, moneyline and total when we checked, from a single source book, with line history. It is not a multi-book comparison feed and not suited to sub-second in-play betting.
- Does it include MLB injuries?
- Yes. The injuries endpoint returned current MLB designations grouped by team, and player-availability normalizes them to values like OUT and QUESTIONABLE. Pass team for a complete team report.
- Can I get MLB score updates pushed instead of polling?
- Yes. Webhooks are included on every paid plan (Starter, Growth, Pro, Business, Scale). WebSocket is included on paid plans, and the Free plan gets a 500-message monthly preview. Both can be filtered to mlb.