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

How to build an MLB pitching dashboard

Separate pitching rows, preserve source precision, and compare innings, strikeouts, walks and run prevention over time.

API coverage and endpoint overview: Explore the MLB API

Why this is hard

Pitching lines need baseball-aware parsing

Innings pitched is not an ordinary decimal and a player response can contain more than one statistical role.

  • Use position and pitching-only fields together.
  • Preserve display precision.
  • Do not add missing innings.
  • Keep game and season populations distinct.

Path 1 · recommended

Have your AI agent build it

MCP can retrieve a known pitcher’s player stats; REST supplies match and game-log 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

  • find_players

    Find canonical player IDs by name for use with player-stat tools.

  • get_player_stats

    Per-player career or per-season totals and per-game rates.

  • 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 pitching dashboard for player ids I provide. Show only returned pitching fields, retain string precision for IP and ERA, and label missing fields unavailable.

What the agent cannot reach

MCP has no rolling-stats or match-stat tool. Use REST for those surfaces.

Path 2 · hand-coded

Build it yourself

Use pitching-specific keys without assuming every provider populated the same line.

  1. 01

    Open one finished game box score

    The match-stat response attaches players, teams, headshots and stat maps to one game id.

    Game pitching linesbash
    curl -s "https://api.bigballsdata.com/v1/stored/matches/$MATCH_ID/stats?sport=baseball" \
      -H "x-api-key: $BBS_API_KEY"
  2. 02

    Select pitching rows

    Prefer position P and confirm the row carries pitching fields such as IP, ERA or WHIP.

    Pitcher guardtypescript
    const pitchers = data.players.filter((p) =>
      p.position === 'P' || ['IP', 'ERA', 'WHIP'].some((key) => p.stats[key])
    );
  3. 03

    Load the player history

    Use the canonical player id for season and game-log comparisons.

    Pitcher game logbash
    curl -s "https://api.bigballsdata.com/v1/players/$PLAYER_ID/game-log?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/stored/matches/:id/stats?sport=baseballTeam and player match stat mapsProvides factual pitching lines for one game.Free
GET/v1/players/:id/stats?sport=baseballPitcher season fields where populatedDrives the profile summary.Free
GET/v1/players/:id/game-log?sport=baseballPer-game pitching historySupports trend charts and recent starts.Free

Pricing, honestly

The first pitching dashboard is Free

Core match and player lines are Free. Paid plans add quota, history and deeper production capabilities rather than changing baseball notation.

Free key

jsonjson
Current match stats and player game logs.

Solo

jsonjson
More seasons, rolling form and production scale.
  • Retain IP as served.
  • Show the source timestamp.
  • Do not infer pitch-level fields.

More tutorials

Other build guides

Known gaps

What this is not

This guide is a box-score dashboard, not a public pitch-tracking product.

  • Pitch-level data remains a separate in-development public surface.
  • Pitcher role can vary.
  • Historical player lines are narrower than game history.

Questions

Can I parse innings pitched as a normal decimal?
No. Baseball notation uses the fractional digit for outs, so preserve the served display value unless you deliberately convert it.
Does every pitcher have ERA and WHIP?
No. Render only populated fields and keep missing distinct from zero.
Does this include every pitch?
No. This uses box-score and game-log surfaces; the public pitch-level endpoint is still in development.

Related APIs

Other APIs you can build with:

Stats reference

Build the pitching view

Start with one finished game and preserve the stat line exactly.