NBA.Stats.LeagueDashTeamShotLocations (nba_api_ex v0.1.0)

View Source

Provides functions to interact with the NBA stats API for league dash team shot locations stats.

See get/2 for parameter and usage details.

Summary

Functions

get(params \\ [MeasureType: "Base", PerMode: "PerGame", PlusMinus: "Y", PaceAdjust: "Y", Rank: "Y", LeagueID: "00", SeasonType: "Regular Season", PORound: 0, Month: 0, OpponentTeamID: 0, TeamID: 0, Period: 0, LastNGames: 0, DistanceRange: "By Zone"], opts \\ [])

(since 0.1.0)

Fetches league dash team shot locations stats data.

Parameters

  • params: A keyword list of parameters to filter the data.

    • Season: (Required) The season for which to fetch data.

      • Type(s): String
      • Example: Season: "2024-25"
      • Default: nil
    • DistanceRange: The distance range for shots.

      • Type(s): String
      • Example: DistanceRange: "By Zone"
      • Default: "By Zone"
      • Valueset:
        • "By Zone"
        • "Less Than 8 ft."
        • "8-16 ft."
        • "16-24 ft."
        • "24+ ft."
        • "Backcourt"
    • PerMode: How stats are aggregated.

      • Type(s): String
      • Example: PerMode: "PerGame"
      • Default: "PerGame"
      • Valueset:
        • "Totals"
        • "PerGame"
        • "Per48"
        • "Per40"
        • "Per36"
        • "PerMinute"
        • "PerPossession"
        • "PerPlay"
        • "Per100Possessions"
        • "Per100Plays"
    • MeasureType: The type of measure to return.

      • Type(s): String
      • Example: MeasureType: "Base"
      • Default: "Base"
      • Valueset:
        • "Base"
        • "Advanced"
        • "Misc"
        • "Four Factors"
        • "Scoring"
        • "Opponent"
        • "Usage"
    • PlusMinus: Whether to include plus/minus splits.

      • Type(s): String
      • Example: PlusMinus: "Y"
      • Default: "Y"
      • Valueset:
        • "Y"
        • "N"
    • PaceAdjust: Whether to adjust stats for pace.

      • Type(s): String
      • Example: PaceAdjust: "Y"
      • Default: "Y"
      • Valueset:
        • "Y"
        • "N"
    • Rank: Whether to include team rank.

      • Type(s): String
      • Example: Rank: "Y"
      • Default: "Y"
      • Valueset:
        • "Y"
        • "N"
    • LeagueID: The league ID ("00" for NBA, "20" for G-League).

      • Type(s): String
      • Example: LeagueID: "00"
      • Default: "00"
      • Valueset:
        • "00"
        • "20"
    • SeasonType: The type of season.

      • Type(s): String
      • Example: SeasonType: "Regular Season"
      • Default: "Regular Season"
      • Valueset:
        • "Regular Season"
        • "Pre Season"
        • "Playoffs"
        • "All Star"
    • PORound: Playoff round (0 for regular season).

      • Type(s): Integer
      • Example: PORound: 0
      • Default: 0
    • Month: Month filter (0 for all months).

      • Type(s): Integer
      • Example: Month: 0
      • Default: 0
    • OpponentTeamID: Opponent team ID (0 for all teams).

    • TeamID: Team ID (0 for all teams).

    • Period: Period filter (0 for all periods).

      • Type(s): Integer
      • Example: Period: 0
      • Default: 0
    • LastNGames: Number of most recent games to include (0 for all).

      • Type(s): Integer
      • Example: LastNGames: 0
      • Default: 0
    • Conference: Conference filter ("East", "West", or empty for all).

      • Type(s): String
      • Example: Conference: "East"
      • Default: ""
      • Valueset:
        • "East"
        • "West"
        • "" (all)
    • Division: Division filter (e.g., "Atlantic", "Central", "Northwest", etc.).

      • Type(s): String
      • Example: Division: "Atlantic"
      • Default: ""
    • GameScope: Game scope (e.g., "Season", "Last 10", "Yesterday").

      • Type(s): String
      • Example: GameScope: "Season"
      • Default: ""
    • GameSegment: Game segment ("First Half", "Second Half", "Overtime", or empty).

      • Type(s): String
      • Example: GameSegment: "First Half"
      • Default: ""
      • Valueset:
        • "First Half"
        • "Second Half"
        • "Overtime"
        • "" (all)
    • DateFrom: Start date filter (format: "MM/DD/YYYY").

      • Type(s): String
      • Example: DateFrom: "01/01/2024"
      • Default: ""
    • DateTo: End date filter (format: "MM/DD/YYYY").

      • Type(s): String
      • Example: DateTo: "01/31/2024"
      • Default: ""
    • Location: Game location ("Home", "Road", or empty for all).

      • Type(s): String
      • Example: Location: "Home"
      • Default: ""
      • Valueset:
        • "Home"
        • "Road"
        • "" (all)
    • Outcome: Game outcome ("W", "L", or empty for all).

      • Type(s): String
      • Example: Outcome: "W"
      • Default: ""
      • Valueset:
        • "W"
        • "L"
        • "" (all)
    • SeasonSegment: Season segment ("Post All-Star", "Pre All-Star", or empty).

      • Type(s): String
      • Example: SeasonSegment: "Post All-Star"
      • Default: ""
      • Valueset:
        • "Post All-Star"
        • "Pre All-Star"
        • "" (all)
    • StarterBench: Filter by starters or bench ("Starters", "Bench", or empty).

      • Type(s): String
      • Example: StarterBench: "Starters"
      • Default: ""
      • Valueset:
        • "Starters"
        • "Bench"
        • "" (all)
    • VsConference: Opponent conference filter ("East", "West", or empty).

      • Type(s): String
      • Example: VsConference: "West"
      • Default: ""
      • Valueset:
        • "East"
        • "West"
        • "" (all)
    • VsDivision: Opponent division filter (e.g., "Atlantic", "Central", etc., or empty).

      • Type(s): String
      • Example: VsDivision: "Central"
      • Default: ""
  • opts: A keyword list of additional options for the request, such as headers or timeout settings.

Returns

  • {:ok, data}: On success, returns the data from the API.
  • {:error, reason}: On failure, returns an error tuple with the reason.

Example

iex> NBA.Stats.LeagueDashTeamShotLocations.get(Season: "2024-25")
{:ok, %{"LeagueDashTeamShotLocations" => [%{...}, ...]}}

get!(params \\ [], opts \\ [])

(since 0.1.0)