Ratings API

First-party JSON endpoints for the shipped ratings product. These routes are meant for product consumers who want the same adjusted team, player, and matchup data that powers the UI without recreating BigQuery queries manually.

Team Rankings
/api/ratings/teams

Returns the adjusted team rankings feed with raw and adjusted component context.

Params
division, season, limit
Example
/api/ratings/teams?division=NAIA&season=2025&limit=25
Team Detail
/api/ratings/teams/[teamId]

Returns the team summary plus per-game ratings detail for a single team-season row.

Params
division, season, detail_limit
Example
/api/ratings/teams/team_123?division=NAIA&season=2025&detail_limit=100
Player Rankings
/api/ratings/players

Returns hitters, pitchers, baserunners, or all three groups for a season.

Params
division, season, group, limit
Example
/api/ratings/players?division=NCAA-DII&season=2025&group=hitters&limit=50
Player Detail
/api/ratings/players/[playerId]

Returns all available player rating groups for one player across seasons.

Params
None
Example
/api/ratings/players/player_456
Matchups
/api/ratings/matchups

Returns upcoming matchup cards with adjusted rating context, audit lines, and interest score.

Params
division, season, from, to, limit
Example
/api/ratings/matchups?division=NJCAA-DI&season=2025&from=2026-04-10&to=2026-04-17&limit=25

Usage Notes

`division` and `season` follow the same selection model as the product UI. If omitted, the API resolves to the current default season context used by the app.

`limit` values are clamped server-side so these routes stay useful for product consumers without turning into unconstrained export endpoints.

Matchup feeds return upcoming games only. Team and player endpoints include fallback behavior when newer marts are not materialized, matching the product's ship-first approach.