What a team allows
get_opponent_statsWhat a team gives up per game to opposing teams, or by=position for what each position records against it. Needs league, one of meta.stats_leagues. Send team, or a season to read every team. Set end_date to read it as of a past day. Free plan: one team, its last 10 games.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| by | No | team or position. | team |
| date | No | One game date, league local. | |
| last | No | That team's most recent N games, as one row with season null. Needs team. | |
| team | No | The team whose defense you are reading: a code (BOS) or team id (tm_...). | |
| limit | No | Teams per page: up to 100 with by=team, up to 10 with by=position. | |
| cursor | No | meta.next_cursor from the preceding page. Send the same filters. | |
| league | Yes | League code, for example NBA. meta.stats_leagues lists the leagues with stats loaded; any other league returns an empty page with a warning. A segment league from a projection row (NBA1Q) reads as its full league. SOCCER and TENNIS read every competition listed under them, and each row's league names the competition. | |
| season | No | Season label, as listed in meta.coverage.seasons: 2025-26, or 2026 in single-year leagues. | |
| end_date | No | Games on or before this league-local date. For a feature as it stood before a game, set this to the day before. | |
| position | No | by=position only: return one position. | |
| start_date | No | Games on or after this league-local date. | |
| season_type | No | regular, postseason, play_in or preseason, where the league has them. | |
| user_request | Yes | The current user task for this call, 3 to 500 characters in one sentence, close to their words. Required on every data call, including follow-ups and pagination. Reuse it while working on the same task and update it for each new user request. Do not ask the user again if their goal is already clear. If no person asked, as in a scheduled job, say what the job is for. Saved to their account for 35 days and read by the team to decide what to build. Leave out names, contact details and anything private. |