NBA.Stats.LeagueDashTeamStats (nba_api_ex v0.1.0)

View Source

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

Summary

Functions

get(params \\ [Conference: "", DateFrom: "", DateTo: "", Division: "", GameScope: "", GameSegment: "", LastNGames: 0, LeagueID: "00", Location: "", MeasureType: "Base", Month: 0, OpponentTeamID: 0, Outcome: "", PaceAdjust: "N", PerMode: "PerGame", Period: 0, PlayerExperience: "", PlayerPosition: "", PlusMinus: "N", PORound: 0, Rank: "N", SeasonSegment: "", SeasonType: "Regular Season", ShotClockRange: "", StarterBench: "", TeamID: 0, TwoWay: "", VsConference: "", VsDivision: ""], opts \\ [])

(since 0.1.0)

Fetches league dash team 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
    • PerMode: How stats are aggregated.
      • Type(s): String
      • Default: "PerGame"
      • Valueset:
        • "Totals"
        • "PerGame"
        • "Per48"
        • "Per40"
        • "Per36"
        • "PerMinute"
        • "PerPossession"
        • "PerPlay"
        • "Per100Possessions"
        • "Per100Plays"
    • MeasureType: The type of measure to return.
      • Type(s): String
      • Default: "Base"
      • Valueset:
        • "Base"
        • "Advanced"
        • "Misc"
        • "Four Factors"
        • "Scoring"
        • "Opponent"
        • "Usage"
    • PlusMinus: Whether to include plus/minus splits.
      • Type(s): String
      • Default: "N"
      • Valueset:
        • "Y"
        • "N"
    • PaceAdjust: Whether to adjust stats for pace.
      • Type(s): String
      • Default: "N"
      • Valueset:
        • "Y"
        • "N"
    • Rank: Whether to include team rank.
      • Type(s): String
      • Default: "N"
      • Valueset:
        • "Y"
        • "N"
    • LeagueID: The league ID ("00" for NBA, "20" for G-League).
      • Type(s): String
      • Default: "00"
      • Valueset:
        • "00"
        • "20"
    • SeasonType: The type of season.
      • Type(s): String
      • Default: "Regular Season"
      • Valueset:
        • "Regular Season"
        • "Pre Season"
        • "Playoffs"
        • "All Star"
    • PORound: Playoff round (0 for regular season).
    • Month: Month filter (0 for all months).
    • OpponentTeamID: Opponent team ID (0 for all teams).
    • TeamID: Team ID (0 for all teams).
    • Period: Period filter (0 for all periods).
    • LastNGames: Number of most recent games to include (0 for all).
    • Conference, Division, GameScope, GameSegment, DateFrom, DateTo, Location, Outcome, SeasonSegment, PlayerExperience, PlayerPosition, ShotClockRange, StarterBench, TwoWay, VsConference, VsDivision: See official NBA API docs for accepted values and usage.
  • 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.LeagueDashTeamStats.get(Season: "2024-25")
{:ok, %{"LeagueDashTeamStats" => [%{...}, ...]}}

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

(since 0.1.0)