NBA.Stats.LeagueDashTeamStats (nba_api_ex v0.1.0)
View SourceProvides 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
- Type(s):
PerMode: How stats are aggregated.- Type(s):
String - Default:
"PerGame" - Valueset:
- "Totals"
- "PerGame"
- "Per48"
- "Per40"
- "Per36"
- "PerMinute"
- "PerPossession"
- "PerPlay"
- "Per100Possessions"
- "Per100Plays"
- Type(s):
MeasureType: The type of measure to return.- Type(s):
String - Default:
"Base" - Valueset:
- "Base"
- "Advanced"
- "Misc"
- "Four Factors"
- "Scoring"
- "Opponent"
- "Usage"
- Type(s):
PlusMinus: Whether to include plus/minus splits.- Type(s):
String - Default:
"N" - Valueset:
- "Y"
- "N"
- Type(s):
PaceAdjust: Whether to adjust stats for pace.- Type(s):
String - Default:
"N" - Valueset:
- "Y"
- "N"
- Type(s):
Rank: Whether to include team rank.- Type(s):
String - Default:
"N" - Valueset:
- "Y"
- "N"
- Type(s):
LeagueID: The league ID ("00" for NBA, "20" for G-League).- Type(s):
String - Default:
"00" - Valueset:
- "00"
- "20"
- Type(s):
SeasonType: The type of season.- Type(s):
String - Default:
"Regular Season" - Valueset:
- "Regular Season"
- "Pre Season"
- "Playoffs"
- "All Star"
- Type(s):
PORound: Playoff round (0 for regular season).- Type(s):
Integer - Default:
0
- Type(s):
Month: Month filter (0 for all months).- Type(s):
Integer - Default:
0
- Type(s):
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 - Default:
0
- Type(s):
LastNGames: Number of most recent games to include (0 for all).- Type(s):
Integer - Default:
0
- Type(s):
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.- For a full list of options, see the Req documentation.
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" => [%{...}, ...]}}