Documentation Index
Fetch the complete documentation index at: https://mintlify.com/gabriel1200/site_Data/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Theteam_shooting.py script collects team-level shooting statistics categorized by defender distance. This provides insight into team offensive shot quality, spacing effectiveness, and how defenses contest opposing teams’ shots.
Data Source
API: NBA.com Stats APIEndpoint:
leaguedashteamptshot with CloseDefDistRange parameter
Functions
get_teamshots()
Retrieves team shooting statistics grouped by defender distance.List of season years to collect (e.g.,
[2023, 2024])Set to
True for playoff data, False for regular season- Very Tight (0-2 feet) - Heavily contested shots
- Tight (2-4 feet) - Contested shots
- Open (4-6 feet) - Lightly contested shots
- Wide Open (6+ feet) - Uncontested shots
master_team_shooting()
Updates master team shooting files with new season data.Season year to update
Set to
True for playoff dataOutput Files
team_shooting.csv / team_shooting_ps.csv
Team offensive shooting by defender distance.NBA team ID
Team abbreviation (e.g., “LAL”, “GSW”)
Full team name
Games played
Games (same as GP for teams)
Frequency of shots in this coverage type (0-100%)
Field goals made
Field goal attempts
Field goal percentage (0-100%)
Effective field goal percentage (0-100%)
Two-point frequency within category
Two-point field goals made
Two-point attempts
Two-point percentage
Three-point frequency within category
Three-pointers made
Three-point attempts
Three-point percentage
Coverage type: “very_tight”, “tight”, “open”, “wide_open”
Season year
opp_team_shooting.csv / opp_team_shooting_ps.csv
Opponent shooting allowed by the defense (team defensive stats). Same schema asteam_shooting.csv but represents shots allowed by the defense.
Usage Examples
Collect Team Data
Update Master File
Analyze Shot Quality
Compare Offense vs Defense
Shot Quality Efficiency
Analysis Use Cases
Offensive Spacing
Measure team’s ability to generate open looks through ball movement and off-ball actions
Defensive Intensity
Evaluate how well a defense contests shots and limits open opportunities
Pace and Space
Identify teams that play faster and generate more wide open threes
Shot Quality vs Quantity
Balance between volume and quality of shot attempts
Configuration
Rate Limiting: Includes delays between API requests Season Format: UsesYYYY-YY format (e.g., “2023-24”)
API Headers: Requires standard NBA.com headers (User-Agent, Host, Referer)
Related Scripts
- player_shooting.py - Individual player shot quality data
- defense.py - Opponent field goal percentage when guarded