statcast_batter_expected_stats
Calculate expected batting statistics (xBA, xSLG, xwOBA) to identify hitters whose performance aligns with or deviates from their quality of contact.
Instructions
Get expected batting stats (xBA, xSLG, xwOBA vs actual) from Statcast.
Returns xBA, xSLG, xwOBA and the gap from actual stats — what a batter deserves based on quality of contact.
Args: year: Season year (e.g. 2024). min_plate_appearances: Minimum PA to qualify (default 50). player_name: Optional. If set (e.g. 'Aaron Judge'), returns only that player's row — use this so a star is not cut off by the 50-row leaderboard limit.
Great for identifying lucky/unlucky hitters or a single player's expected line.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | ||
| min_plate_appearances | No | ||
| player_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |