Skip to content

Add Statcast metrics ingestion from Baseball Savant #167

@grovecj

Description

@grovecj

Summary

The MLB Stats API provides sabermetric stats (WAR, wOBA, wRC+, FIP, xFIP) and expected statistics (xBA, xSLG, xwOBA), but does not include Statcast-specific metrics. These need to be sourced from Baseball Savant.

Missing Metrics

Batting

  • Exit Velocity (avg)
  • Launch Angle (avg)
  • Barrel %
  • Hard Hit %
  • Sprint Speed
  • Sweet Spot %

Pitching

  • Exit Velocity Against (avg)
  • Spin Rate (avg by pitch type)
  • Extension
  • Vertical/Horizontal Movement

Current State

  • Schema already has columns for these metrics in PlayerBattingStats and PlayerPitchingStats
  • Columns exist but are not populated
  • MLB Stats API tracking and metricAverages endpoints return empty/error responses

Proposed Solution

Investigate Baseball Savant data sources:

  1. CSV Downloads: https://baseballsavant.mlb.com/leaderboard/custom provides downloadable CSVs
  2. Statcast Search API: May have endpoints for individual player data
  3. Third-party libraries: Some wrapper libraries may provide access

Acceptance Criteria

  • Identify reliable data source for Statcast metrics
  • Create ingestion service for Statcast data
  • Populate existing schema columns with real data
  • Add tests for new ingestion logic

Related

  • Depends on: Advanced stats ingestion from MLB API (in progress)
  • Schema: PlayerBattingStats, PlayerPitchingStats advanced columns

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions