Tutorial · 9 min · endpoints verified 2026-09-20
How to build an MLB live scoreboard
Render team identity, game status, runs and a growing inning table from one canonical MLB match response.
API coverage and endpoint overview: Explore the MLB API
Why this is hard
A baseball score is a sequence, not one number
A useful scoreboard explains how the total formed while keeping the match row authoritative.
- Inning arrays can grow beyond nine.
- Scheduled games have no runs yet.
- A correction can change an earlier inning.
- Team logos must stay attached to canonical team ids.
Path 1 · recommended
Have your AI agent build it
MCP can resolve MLB games; use the stored-match REST view for its explicit linescore arrays.
1. Connect the MCP server
Add the server in your MCP client and sign in with your Big Balls account. Your client registers itself and handles the token exchange — there is no key to copy.
{
"mcpServers": {
"bigballs-sports-data": {
"url": "https://mcp.bigballsdata.com/mcp"
}
}
}2. Tools your agent gets
get_matchesLive, upcoming or historical matches for a sport or league.
get_coverageMachine-readable map of what we hold and what we do not.
3. Ask for what you want
Paste this at your agent. It is written to make the model check coverage before it designs anything, which is what stops it inventing a field we do not serve.
Build an MLB scoreboard. Check baseball coverage, list MLB games, then call the stored match REST route for inning linescores. Render null innings as unavailable and do not invent a demo score.What the agent cannot reach
MCP does not expose the stored linescore-specific response. Use REST for the inning table and keep the API key on the server.
Path 2 · hand-coded
Build it yourself
Start with the list response, retain match_id, then render the detail response defensively.
- 01
List MLB games
Filter explicitly to baseball and MLB so another sport can never enter the board.
Stored MLB gamesbashcurl -s "https://api.bigballsdata.com/v1/stored/matches?sport=baseball&league=mlb&limit=20" \ -H "x-api-key: $BBS_API_KEY" - 02
Open one game
Use the returned canonical match id for the detail view.
Match detailbashcurl -s "https://api.bigballsdata.com/v1/stored/matches/$MATCH_ID?sport=baseball" \ -H "x-api-key: $BBS_API_KEY" - 03
Render every inning
Use the longer linescore array as the column count; extra innings then work without another layout.
Linescore columnstypescriptconst innings = Math.max(game.linescore.home.length, game.linescore.away.length); const columns = Array.from({ length: innings }, (_, i) => i + 1);
Reference
Every endpoint this tutorial uses
All on the gateway at api.bigballsdata.com. Verified against production on 2026-09-20.
| Method | Path | Returns | Why you need it | Plan |
|---|---|---|---|---|
| GET | /v1/stored/matches?sport=baseball&league=mlb | MLB games with totals and inning arrays | Populates the scoreboard and supplies canonical match ids. | Free |
| GET | /v1/stored/matches/:id?sport=baseball | One canonical game and its freshest stored detail | Drives the game view without matching on team names. | Free |
Pricing, honestly
The scoreboard works on Free
Free covers current-season scores and linescores. Higher plans add depth and delivery rather than changing the inning shape.
Free key
Current MLB games and inning arrays.Solo
More history, higher quota, deeper statistics, and paid betting data.- Handle extra innings.
- Keep null distinct from zero.
- Cache finished games.
More tutorials
Other build guides
- How to build a fantasy hockey app
- How to build a fantasy basketball app
- How to build a soccer xG app
- How to build a cricket app
- NFL fantasy football API tutorial
- How to build an NFL scouting tool
- How to build an NFL conditions analytics tool
- NFL betting model API tutorial
- NFL live game center API tutorial
- How to build an NCAAF scoreboard and live game center
- How to build college football rankings and conference standings
- How to build an NCAAF fantasy football app
- How to build a fantasy baseball app
- How to build an MLB pitching dashboard
- How to build an MLB betting model
- How to build an MLB standings dashboard
- How to build a soccer fantasy app
- How to build a soccer betting model
- How to build a soccer live match center
- How to build a soccer scouting tool
- How to build an NCAAF betting model
- How to build an NCAAF conditions analytics tool
- How to build a WNBA live scoreboard
- How to build a WNBA quarter tracker
- How to build a WNBA odds board
- How to build a WNBA schedule browser
- How to build a WNBA team-form tool
- How to build an NCAAB scoreboard
- How to build a March Madness archive
- How to build an NCAAB game-detail view
- How to build an NCAAB team-form dashboard
- How to build an NCAAB head-to-head tool
Known gaps
Production checks
Treat availability and corrections as normal states.
- Revalidate live games on the documented cadence.
- Stop aggressive polling after final.
- Preserve canonical team and match ids.
Questions
- Does the linescore always have nine entries?
- No. Scheduled games can be empty and extra-inning games can exceed nine, so derive the column count from the response.
- Should I sum innings for the score?
- Display the served total as authoritative and use inning values as the explanation, so later corrections do not create two truths.
- How should this update during a game?
- Poll the REST response conservatively, display its update time, and slow down after final. This tutorial does not claim an MLB WebSocket surface.