$npx -y skills add machina-sports/sports-skills --skill nba-dataNBA data via ESPN public endpoints — scores, standings, rosters, schedules, game summaries, play-by-play, win probability, injuries, transactions, futures, depth charts, team/player stats, leaders, and news. Zero config, no API keys. Use when: user asks about NBA scores, standing
| 1 | # NBA Data |
| 2 | |
| 3 | Before writing queries, consult `references/api-reference.md` for endpoints, ID conventions, and data shapes. |
| 4 | |
| 5 | ## Setup |
| 6 | |
| 7 | Before first use, check if the CLI is available: |
| 8 | ```bash |
| 9 | which sports-skills || pip install sports-skills |
| 10 | ``` |
| 11 | If `pip install` fails with a Python version error, the package requires Python 3.10+. Find a compatible Python: |
| 12 | ```bash |
| 13 | python3 --version # check version |
| 14 | # If < 3.10, try: python3.12 -m pip install sports-skills |
| 15 | # On macOS with Homebrew: /opt/homebrew/bin/python3.12 -m pip install sports-skills |
| 16 | ``` |
| 17 | No API keys required. |
| 18 | |
| 19 | ## Quick Start |
| 20 | |
| 21 | Prefer the CLI — it avoids Python import path issues: |
| 22 | ```bash |
| 23 | sports-skills nba get_scoreboard |
| 24 | sports-skills nba get_standings --season=2025 |
| 25 | sports-skills nba get_teams |
| 26 | ``` |
| 27 | |
| 28 | ## CRITICAL: Before Any Query |
| 29 | |
| 30 | CRITICAL: Before calling any data endpoint, verify: |
| 31 | - Season year is derived from the system prompt's `currentDate` — never hardcoded. |
| 32 | - If only a team name is provided, call `get_teams` to resolve the team ID before using team-specific commands. |
| 33 | |
| 34 | ## Choosing the Season |
| 35 | |
| 36 | Derive the current year from the system prompt's date (e.g., `currentDate: 2026-02-18` → current year is 2026). |
| 37 | |
| 38 | - **If the user specifies a season**, use it as-is. |
| 39 | - **If the user says "current", "this season", or doesn't specify**: The NBA season runs October–June. If the current month is October–December, the active season year matches the current year. If January–June, the active season started the previous calendar year (use that year as the season). |
| 40 | |
| 41 | ## Commands |
| 42 | |
| 43 | | Command | Description | |
| 44 | |---|---| |
| 45 | | `get_scoreboard` | Live/recent NBA scores | |
| 46 | | `get_standings` | Standings by conference | |
| 47 | | `get_teams` | All 30 NBA teams | |
| 48 | | `get_team_roster` | Full roster for a team | |
| 49 | | `get_team_schedule` | Schedule for a specific team | |
| 50 | | `get_game_summary` | Detailed box score and scoring plays | |
| 51 | | `get_leaders` | NBA statistical leaders | |
| 52 | | `get_news` | NBA news articles | |
| 53 | | `get_play_by_play` | Full play-by-play for a game | |
| 54 | | `get_win_probability` | Win probability chart data | |
| 55 | | `get_schedule` | Schedule for a specific date or season | |
| 56 | | `get_injuries` | Injury reports across all teams | |
| 57 | | `get_transactions` | Recent transactions | |
| 58 | | `get_futures` | Futures/odds markets | |
| 59 | | `get_depth_chart` | Depth chart for a team | |
| 60 | | `get_team_stats` | Team statistical profile | |
| 61 | | `get_player_stats` | Player statistical profile | |
| 62 | |
| 63 | See `references/api-reference.md` for full parameter lists and return shapes. |
| 64 | |
| 65 | ## Examples |
| 66 | |
| 67 | Example 1: Today's scores |
| 68 | User says: "What are today's NBA scores?" |
| 69 | Actions: |
| 70 | 1. Call `get_scoreboard()` |
| 71 | Result: All live and recent NBA games with scores and status |
| 72 | |
| 73 | Example 2: Conference standings |
| 74 | User says: "Show me the Western Conference standings" |
| 75 | Actions: |
| 76 | 1. Derive season year from `currentDate` |
| 77 | 2. Call `get_standings(season=<derived_year>)` |
| 78 | 3. Filter results for Western Conference |
| 79 | Result: Western Conference standings table with W-L, PCT, GB per team |
| 80 | |
| 81 | Example 3: Team roster |
| 82 | User says: "Who's on the Lakers roster?" |
| 83 | Actions: |
| 84 | 1. Call `get_team_roster(team_id="13")` |
| 85 | Result: Full Lakers roster with name, position, jersey number, height, weight |
| 86 | |
| 87 | Example 4: Game box score |
| 88 | User says: "Show me the full box score for last night's Celtics game" |
| 89 | Actions: |
| 90 | 1. Call `get_scoreboard(date="<yesterday>")` to find the event_id |
| 91 | 2. Call `get_game_summary(event_id=<id>)` for full box score |
| 92 | Result: Complete box score with per-player stats and scoring plays |
| 93 | |
| 94 | Example 5: Injury report |
| 95 | User says: "Who's injured on the Lakers?" |
| 96 | Actions: |
| 97 | 1. Call `get_injuries()` |
| 98 | 2. Filter results for Los Angeles Lakers (team_id=13) |
| 99 | Result: Lakers injury list with player name, position, status, and injury type |
| 100 | |
| 101 | Example 6: Player statistics |
| 102 | User says: "Show me LeBron's stats this season" |
| 103 | Actions: |
| 104 | 1. Derive season year from `currentDate` |
| 105 | 2. Call `get_player_stats(player_id="1966", season_year=<derived_year>)` |
| 106 | Result: Season stats by category with value, rank, and per-game averages |
| 107 | |
| 108 | ## Commands that DO NOT exist — never call these |
| 109 | |
| 110 | - ~~`get_odds`~~ / ~~`get_betting_odds`~~ — not available. For prediction market odds, use the polymarket or kalshi skill. |
| 111 | - ~~`search_teams`~~ — does not exist. Use `get_teams` instead. |
| 112 | - ~~`get_box_score`~~ — does not exist. Use `get_game_summary` instead. |
| 113 | - ~~`get_player_ratings`~~ — does not exist. Use `get_player_stats` instead. |
| 114 | |
| 115 | If a |