MLB play-by-play API
MLB play-by-play for any game, live or final, in order: each play's text, type, inning and half-inning, outs, and the score after the play.
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.
Endpoint
- GET/api/v1/sports/baseball/leagues/mlb/events/{eventId}/plays
Live MLB example
Request
curl -H "Authorization: Bearer $RSA_API_KEY" \
"https://www.realtimesportsapi.com/api/v1/sports/baseball/leagues/mlb/events/401908046/plays?limit=3"Response captured from live data at 2026-11-07 13:57 UTC (refreshed every few minutes). Long arrays are trimmed; meta.rateLimit values are illustrative for a Free key. Plays from Milwaukee Brewers at Tampa Bay Rays.
Response
{
"success": true,
"data": [
{
"id": "4019080460000000059",
"sequenceNumber": "1",
"text": "Top of the 1st inning",
"shortText": "Top of the 1st inning",
"alternativeText": "Top of the 1st inning",
"type": {
"id": "59",
"text": "Start Inning",
"slug": "start-inning"
},
"period": 1,
"halfInning": "top",
"outs": 0,
"clock": {},
"wallClock": "2026-10-29T00:08:58Z",
"homeScore": 0,
"awayScore": 0,
"scoringPlay": false,
"scoreValue": 0,
"situation": null,
"endSituation": null,
"athletes": [],
"priority": false,
"modified": "2026-10-29T00:13Z"
},
{
"id": "4019080460001010001",
"sequenceNumber": "1",
"text": "Drew Rasmussen pitches to Jackson Chourio",
"shortText": "Drew Rasmussen pitches to Jackson Chourio",
"alternativeText": "Drew Rasmussen pitches to Jackson Chourio",
"type": {
"id": "1",
"text": "Start Batter/Pitcher",
"slug": "start-batterpitcher"
},
"period": 1,
"halfInning": "top",
"outs": 1,
"clock": {},
"wallClock": "2026-10-29T00:09:15Z",
"homeScore": 0,
"awayScore": 0,
"scoringPlay": false,
"scoreValue": 0,
"situation": null,
"endSituation": null,
"athletes": [
{
"id": "42584",
"name": "Drew Rasmussen",
"displayName": "Drew Rasmussen",
"shortName": "D. Rasmussen",
"position": "SP",
"team": {
"id": "30"
},
"role": "pitcher",
"type": "pitcher",
"order": 1
},
{
"id": "4917869",
"name": "Jackson Chourio",
"displayName": "Jackson Chourio",
"shortName": "J. Chourio",
"position": "LF",
"team": {
"id": "8"
},
"role": "batter",
"type": "batter",
"order": 2
}
],
"priority": false,
"modified": "2026-10-29T01:13Z"
},
{
"id": "4019080460001020021",
"sequenceNumber": "2",
"text": "Pitch 1 : Strike 1 Foul",
"shortText": "Pitch 1 : Strike 1 Foul",
"alternativeText": "Pitch 1 : Strike 1 Foul",
"type": {
"id": "21",
"text": "Foul Ball",
"abbreviation": "F",
"slug": "foul-ball"
},
"period": 1,
"halfInning": "top",
"outs": 1,
"clock": {},
"wallClock": "2026-10-29T00:09:15Z",
"homeScore": 0,
"awayScore": 0,
"scoringPlay": false,
"scoreValue": 0,
"situation": null,
"endSituation": null,
"athletes": [
{
"id": "42584",
"name": "Drew Rasmussen",
"displayName": "Drew Rasmussen",
"shortName": "D. Rasmussen",
"position": "SP",
"team": {
"id": "30"
},
"role": "pitcher",
"type": "pitcher",
"order": 1
},
{
"id": "4917869",
"name": "Jackson Chourio",
"displayName": "Jackson Chourio",
"shortName": "J. Chourio",
"position": "LF",
"team": {
"id": "8"
},
"role": "batter",
"type": "batter",
"order": 2
}
],
"priority": false,
"modified": "2026-10-29T01:13Z"
}
],
"meta": {
"pagination": {
"page": 1,
"pageSize": 3,
"total": 516,
"totalPages": 172,
"hasNextPage": true,
"hasPreviousPage": false
},
"rateLimit": {
"limit": 125,
"remaining": 124,
"reset": 1796083200000
}
}
}Code samples
curl
curl -H "Authorization: Bearer $RSA_API_KEY" \
"https://www.realtimesportsapi.com/api/v1/sports/baseball/leagues/mlb/events/401908046/plays?limit=3"JavaScript (fetch)
const res = await fetch("https://www.realtimesportsapi.com/api/v1/sports/baseball/leagues/mlb/events/401908046/plays?limit=3", {
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/401908046/plays?limit=3",
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_plays with sport "baseball" and league "mlb" and pick a finished game from get_events and summarize its scoring plays 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
Fields
| Field | Type | Notes |
|---|---|---|
| id | string | |
| sequenceNumber | string | |
| text | string | |
| shortText | string | |
| alternativeText | string | |
| type | object | |
| period | integer | |
| clock | object | |
| wallClock | string | |
| homeScore | integer | |
| awayScore | integer | |
| scoringPlay | boolean | |
| scoreValue | integer | |
| scoringType | string | |
| situation | object | |
| endSituation | object | |
| yardsGained | integer | |
| teamId | string | |
| athletes | PlayAthlete[] | |
| priority | boolean | |
| modified | string |
Rate limits and pricing
| 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.
FAQ
- Is there a free MLB play-by-play API?
- Yes. A free key (no card) includes every endpoint and league: 1,000 calls in the first 30 days, then 125 a month at 1 request per second. Paid plans start at $29/month for 10,000 calls and add webhooks and WebSocket.
- Does it work in the off-season?
- Past games stay available by event id, so you can build and test against last season's games now; live games return again when the season starts.
- Can I get MLB plays pushed live?
- On paid plans, each new play is also pushed to you: webhooks send event.play and the WebSocket stream sends event_play, so you don't have to poll the plays endpoint during a game.