Back to Blog
Tutorials2025-10-21

Build a Baseball Live Scores & Game Center

Real-time innings, box scores, and UI patterns for baseball scoreboards.

Baseball data model

Structure your data around baseball-specific entities: leagues, teams, players, games, and inning-by-inning scores.

  • Leagues: MLB, NPB, KBO with season dates
  • Teams: Name, logo, venue, roster
  • Games: Date, status, home/away teams, venue
  • Scores: Runs per inning, total R/H/E

The /baseball/live endpoint

Fetch all currently live baseball games grouped by league:

Live game data structure

Ingestion cadence for baseball

  • Pre-game: Refresh every 30 minutes for lineup changes
  • During at-bats: Poll every 10-15 seconds for live action
  • Between innings: Poll every 30-60 seconds
  • Post-game: Final stats available immediately after last out

Building the baseball line score

Create the classic baseball scoreboard showing innings 1-9 (plus extras) with R/H/E:

Detecting current inning

Caching layers

  • CDN: Cache team logos and static assets indefinitely
  • Edge KV: Store live game summaries for 10-second reads
  • Application: Cache /baseball/games response for schedule data

UI patterns for baseball

  • Sticky header with current score and inning indicator
  • Inning-by-inning breakdown with current inning highlighted
  • R/H/E display in traditional baseball format
  • Team logos and colors for quick identification
  • Extra innings section that expands as needed

Score change animations

Flash or highlight score changes when runs are scored. Use subtle animations to draw attention without being distracting.

Accessibility

  • Announce score changes to screen readers
  • Use high contrast colors for score displays
  • Provide text alternatives for team logos
  • Ensure keyboard navigation for game selection