Tutorial · 8 min · endpoints verified 2026-09-20

How to build an MLB standings dashboard

Render the current table exactly as served, retain team identity, and avoid inventing division fields the response does not expose.

API coverage and endpoint overview: Explore the MLB API

Why this is hard

A standings table should not add structure it did not receive

The MLB response serves one league group with team rows; division membership is not exposed on each row.

  • Use the nested standings group.
  • Sort by served rank.
  • Keep wins, losses and win percentage distinct.
  • Do not infer divisions from team names.

Path 1 · recommended

Have your AI agent build it

MCP can fetch the current standings and team Elo context.

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.

MCP client configjson
{
  "mcpServers": {
    "bigballs-sports-data": {
      "url": "https://mcp.bigballsdata.com/mcp"
    }
  }
}

2. Tools your agent gets

  • get_standings

    League table with wins, losses, win_pct, games_played.

  • get_team_elo

    Team Elo rating, rank and optional rating history.

  • get_coverage

    Machine-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.

Prompttext
Build an MLB standings dashboard. Fetch MLB standings, render the nested rows in served rank order, retain team ids and logos, and do not create AL/NL divisions unless a served field provides them.

What the agent cannot reach

The standings row does not expose division or games-behind. Team Elo is optional context, not standings rank.

Path 2 · hand-coded

Build it yourself

Read the nested group and fail visibly if its shape changes.

  1. 01

    Fetch the current table

    Use the exact MLB league filter.

    MLB standingsbash
    curl -s "https://api.bigballsdata.com/v1/standings?league=MLB" \
      -H "x-api-key: $BBS_API_KEY"
  2. 02

    Read the nested rows

    The table is data.standings[0].rows, not a flat data array.

    Shape-safe tabletypescript
    const group = response.data.standings?.[0];
    const rows = Array.isArray(group?.rows) ? group.rows : [];
    const ordered = [...rows].sort((a, b) => a.rank - b.rank);
  3. 03

    Add recent team form

    Use canonical team_id for optional form detail.

    Team formbash
    curl -s "https://api.bigballsdata.com/v1/teams/$TEAM_ID/form?sport=baseball" \
      -H "x-api-key: $BBS_API_KEY"

Reference

Every endpoint this tutorial uses

All on the gateway at api.bigballsdata.com. Verified against production on 2026-09-20.

MethodPathReturnsWhy you need itPlan
GET/v1/standings?league=MLBCurrent nested MLB standings group and team rowsDrives rank, W-L, win percentage, games played and streak.Free
GET/v1/teams/:id/form?sport=baseballRecent results for one canonical teamAdds detail without changing the standings rank.Free

Pricing, honestly

The current table is Free

Free covers current standings and form. Paid plans add history, quota and other capabilities, not hidden division fields.

Free key

jsonjson
Current MLB rows and team form.

Solo

jsonjson
More history and production scale.
  • Keep rank authoritative.
  • Show updated_at.
  • Do not derive divisions.

More tutorials

Other build guides

Known gaps

Table boundaries

The first version follows the response rather than a hand-maintained league model.

  • Division membership is not on the row.
  • Games-behind is not exposed.
  • Historical standings are not implied by game history.

Questions

Does the endpoint return AL and NL divisions?
No. The current row does not expose division membership, so the tutorial renders one served table.
Should I calculate rank from win percentage?
No. Use the served rank; the response is the authority for its table order.
Can I show recent form?
Yes. Follow each canonical team id to the team-form endpoint and keep that display separate from standings rank.

Related APIs

Other APIs you can build with:

Stats reference

Build the current table

Render the served rows first, then add team detail by canonical id.