Sessions 29-30: Content templates + PropLine 3-key adapter + MLB Stats API + ESPN summary (1694 tests)

This commit is contained in:
Kev
2026-06-14 22:29:01 -04:00
parent 927c4a5c65
commit a3351e2135
14 changed files with 1091 additions and 27 deletions
+18
View File
@@ -73,6 +73,24 @@ empty. NONE of these spend odds-api credits:
- Dead providers: set `status: 'dead'` in `config/providers.js` to drop a
provider from fallback chains + configured list (ParlayAPI host is dead).
## Provider Strategy (Session 30)
Player props now have abundance, not rationing.
- **Player props** — PRIMARY: PropLine (`proplineAdapter`, 3 keys
`PROPLINE_API_KEY_1/2/3`, 3,000 req/day FREE, rotates per-key; registry
`propline` priority 1). BACKUP: The Odds API (`ODDS_API_KEY`, 500/month,
priority 2, conserve). `getOdds()` tries PropLine first when keys present,
falls back to odds-api; the response + cache carry a `provider` field.
PropLine is The-Odds-API-compatible → reuses `utils/oddsNormalizer`.
MLB market keys (`batter_hits`, `pitcher_strikeouts`, …) were added to
`MARKET_MAP` — without them MLB props normalize to zero.
- **MLB stats** — `mlbStatsAdapter` → statsapi.mlb.com. FREE, no auth,
unlimited. Game logs, season averages, BvP, probable pitchers. Does NOT
use the gateway (no quota). Registry `mlb-stats` (`noAuth: true`).
- **Game enrichment** — `scheduleService.getGameSummary(sport, eventId)`
ESPN summary (injuries, ESPN Bet odds, ATS, leaders, box score). Free.
- **Game-level odds** — Tank01 (unchanged). Tank01 PLAYER PROPS = empty,
do not wire.
## Frontend ↔ Backend Wiring (Session 25 — non-obvious)
A new Express route under `/api/*` is NOT reachable from the browser until
a matching **Next.js proxy route** exists at `web/src/app/api/.../route.ts`