A full-stack web app for analyzing MLB pitching data. Built on pitch-level Statcast data with custom-computed statistics and machine learning pitch grades.
The goal of this project is to get information into the hands of players, coaches, and fans. For players and coaches, that means removing the what and the why — so the only remaining question is how. That's the focus of stockyardbaseball.com — a coaching service that helps players achieve the things necessary to get to the big leagues.
8.9M+
Pitches Tracked
3,400+
Pitchers
11
Seasons
180+
Statistics
Statcast (Primary Source)
Every pitch thrown since 2015 — velocity, spin, movement, location, outcomes, and extended tracking data (arm angle, bat speed, game situation). The majority of stats on this site are computed directly from this pitch-level data, including K%, BB%, FIP, xFIP, BABIP, batted ball stats, plate discipline, contact quality, pitch movement, and more.
MLB Stats API
Official scorer data that can't be derived from pitch tracking alone — ERA (requires earned/unearned run distinction), games started, wins, losses, saves, and holds.
FanGraphs
A small set of advanced metrics that require park factors or complex modeling beyond what pitch data alone can produce: WAR, SIERA, xERA, park-adjusted stats (ERA-, FIP-), leverage/clutch metrics (WPA, RE24, Clutch), and run values per pitch type.
Three-tier merge priority
FanGraphs provides the baseline, then self-computed Statcast aggregations override where possible, then MLB official stats take highest priority. This ensures maximum accuracy at every level.
Frontend
Next.js 14, React, Tailwind CSS, TanStack Query, Recharts
Backend
Python FastAPI, SQLAlchemy, SQLite
ML Models
XGBoost for pitch grades (Stuff+, DLoc+, Pitching+), RidgeCV for Arsenal Synergy, ElasticNet and XGBoost for projections
Data Ingestion
pybaseball for Statcast, MLB Stats API for official records, FanGraphs API for advanced metrics
Every line of code in this project — frontend, backend, data pipelines, machine learning models, and deployment infrastructure — was written by AI using Claude by Anthropic, with code review assistance from Codex by OpenAI. A human guides the direction, designs the models, and makes product decisions, but the implementation is 100% AI-generated. No hand-written code.
Rather than relying on third-party leaderboards, the majority of statistics on this site are aggregated directly from raw Statcast pitch data. This gives us full control over methodology and lets us offer stats that aren't available elsewhere.
Rate Stats
K%, BB%, K-BB%, HR%, TTO%, BABIP, AVG, OBP, SLG, WHIP, K/9, BB/9, HR/9
ERA Estimators
FIP and xFIP computed with year-specific constants and league HR/FB rates
Batted Ball
GB%, FB%, LD%, IFFB%, Pull%, Cent%, Oppo%, FB Pull% — spray angles from hit coordinates
Contact Quality
Hard Hit%, Soft%, Barrel%, Sweet Spot%, Avg/Max Exit Velo, Avg Launch Angle
Plate Discipline
O-Swing%, Z-Swing%, Swing%, O-Contact%, Z-Contact%, Contact%, SwStr%, CStr%, CSW%
Pitch Movement
iVB and iHB from raw Statcast pfx data — more accurate than FanGraphs, which measures at a shorter distance
Arm-Slot Adjusted
Movement and acceleration adjusted for arm angle via regression, with submarine outlier detection
Per-Pitch-Type
Velocity, usage, CSW%, Barrel%, and xRV per 100 for each of 7 pitch types
Stockyard Originals
xRV (BABIP-neutral expected run value), Stockyard Stuff+, DLoc+ descriptive command grades, Pitching+ grades for every pitch, Arsenal Synergy per season, count-normalized variants