MLB box score API

Team totals and every player's batting and pitching line for an MLB game, live or final, in one call per game.

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.

AvailableReturned MLB data when checked.

Endpoint

  • GET/api/v1/sports/baseball/leagues/mlb/events/{eventId}/boxscore

Live MLB example

Request

curl -H "Authorization: Bearer $RSA_API_KEY" \
  "https://www.realtimesportsapi.com/api/v1/sports/baseball/leagues/mlb/events/401908046/boxscore"

Response captured from live data at 2026-11-07 14:05 UTC (refreshed every few minutes). Long arrays are trimmed; meta.rateLimit values are illustrative for a Free key. Box score for Milwaukee Brewers at Tampa Bay Rays; player lists trimmed to 2 of 11 (home) and 9 (away).

Response

{
  "success": true,
  "data": {
    "homeTeam": {
      "id": "30",
      "name": "Tampa Bay Rays",
      "abbreviation": "TB",
      "score": 1
    },
    "awayTeam": {
      "id": "8",
      "name": "Milwaukee Brewers",
      "abbreviation": "MIL",
      "score": 4
    },
    "homePlayers": [
      {
        "id": "33481",
        "name": "Yandy Diaz",
        "position": "DH",
        "starter": true,
        "points": 0,
        "hits-atBats": "0-3",
        "atBats": "3",
        "runs": "0",
        "hits": "0",
        "RBIs": "0",
        "homeRuns": "0",
        "walks": "1",
        "strikeouts": "1",
        "pitches": "18",
        "avg": ".254",
        "onBasePct": ".302",
        "slugAvg": ".441"
      },
      {
        "id": "40810",
        "name": "Jonathan Aranda",
        "position": "1B",
        "starter": true,
        "points": 0,
        "hits-atBats": "0-4",
        "atBats": "4",
        "runs": "0",
        "hits": "0",
        "RBIs": "0",
        "homeRuns": "0",
        "walks": "0",
        "strikeouts": "1",
        "pitches": "16",
        "avg": ".245",
        "onBasePct": ".310",
        "slugAvg": ".321"
      }
    ],
    "awayPlayers": [
      {
        "id": "4917869",
        "name": "Jackson Chourio",
        "position": "LF",
        "starter": true,
        "points": 1,
        "hits-atBats": "1-4",
        "atBats": "4",
        "runs": "0",
        "hits": "1",
        "RBIs": "0",
        "homeRuns": "0",
        "walks": "0",
        "strikeouts": "3",
        "pitches": "20",
        "avg": ".288",
        "onBasePct": ".306",
        "slugAvg": ".424"
      },
      {
        "id": "35013",
        "name": "Jake Bauers",
        "position": "1B",
        "starter": true,
        "points": 0,
        "hits-atBats": "0-4",
        "atBats": "4",
        "runs": "0",
        "hits": "0",
        "RBIs": "0",
        "homeRuns": "0",
        "walks": "0",
        "strikeouts": "2",
        "pitches": "15",
        "avg": ".191",
        "onBasePct": ".345",
        "slugAvg": ".277"
      }
    ],
    "periodScores": {
      "home": [
        0,
        0,
        0,
        "... 6 more"
      ],
      "away": [
        0,
        1,
        0,
        "... 6 more"
      ]
    }
  },
  "meta": {
    "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/boxscore"

JavaScript (fetch)

const res = await fetch("https://www.realtimesportsapi.com/api/v1/sports/baseball/leagues/mlb/events/401908046/boxscore", {
  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/boxscore",
    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_box_score with sport "baseball" and league "mlb" and pick a finished game from get_events and list the top performers 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

FieldTypeNotes
homeTeamobject
awayTeamobject
homePlayersobject[]
awayPlayersobject[]
periodScoresobject

Rate limits and pricing

PlanPriceCallsRateWebSocketWebhooks
Free$0125/mo (1,000 first 30 days)1/s500 msgs/moNo
Starter$29/mo ($290/yr)10,000/mo5/sShares monthly poolShares monthly pool
Growth$49/mo ($490/yr)25,000/mo10/sShares monthly poolShares monthly pool
Pro$99/mo ($990/yr)50,000/mo20/s100,000 msgs/mo25,000/mo
Business$179/mo ($1,790/yr)150,000/mo40/s300,000 msgs/mo75,000/mo
Scale$299/mo ($2,990/yr)500,000/mo100/s500,000 msgs/mo100,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 box score 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.
Can I get MLB player stats per game?
Yes. The box score lists each player's stat line for that game. Get the game id from /events (or /events?date=YYYY-MM-DD), then call /events/{eventId}/boxscore.
Are MLB box scores live?
They update while the game is in progress and are final afterwards. Data typically runs 20-30 seconds behind live play, so it suits apps, alerts, dashboards and bots, not in-play betting.

Related