NBA.Stats.TeamDashboard (nba_api_ex v0.1.0)
View SourceProvides functions to interact with the NBA stats API for TeamDashboard.
See get/2 for parameter and usage details.
Summary
Functions
get(type, params \\ [MeasureType: "Base", PerMode: "PerGame", PlusMinus: "N", PaceAdjust: "N", Rank: "N", LeagueID: "00", Season: nil, SeasonType: "Regular Season", PORound: 0, TeamID: nil, Outcome: nil, Location: nil, Month: 0, SeasonSegment: nil, DateFrom: nil, DateTo: nil, OpponentTeamID: 0, VsConference: nil, VsDivision: nil, GameSegment: nil, Period: 0, ShotClockRange: nil, LastNGames: 0, ISTRound: nil], opts \\ [])
(since 0.1.0)Fetches TeamDashboard data.
Parameters
type: The type of data to fetch.:general_splits: Fetches general splits stats.:opponent: Fetches opponent stats.:last_n_games: Fetches stats for the last N games.:game_splits: Fetches game splits stats.:clutch: Fetches clutch stats.:team_performance: Fetches team performance stats.:year_over_year: Fetches year-over-year stats.:shooting_splits: Fetches shooting splits stats.:players: Fetches player stats for a team.:on_off_detail: Fetches detailed on/off stats for players.:on_off_summary: Fetches summary on/off stats for players.
params: A keyword list of parameters to filter the data.TeamID: (Required) The team ID.Season: (Required) The season.- Type(s):
String - Example:
Season: "2024-25" - Default:
nil
- Type(s):
LastNGames: Number of last games to include.- Type(s):
Integer - Example:
LastNGames: 10 - Default:
0
- Type(s):
MeasureType: The type of measure.- Type(s):
String - Example:
MeasureType: "Base" - Default:
"Base" - Valueset:
"Base""Advanced""Misc""Four Factors""Scoring""Opponent""Usage"
- Type(s):
Month: The month number.- Type(s):
Integer - Example:
Month: 1 - Default:
0
- Type(s):
OpponentTeamID: The opponent team ID.PaceAdjust: Whether to adjust for pace.- Type(s):
String - Example:
PaceAdjust: "Y" - Default:
"N" - Valueset:
"Y""N"
- Type(s):
PerMode: How to aggregate stats.- Type(s):
String - Example:
PerMode: "PerGame" - Default:
"PerGame" - Valueset:
"Totals""PerGame""MinutesPer""Per48""Per40""Per36""PerMinute""PerPossession""PerPlay""Per100Possessions""Per100Plays"
- Type(s):
Period: The period number.- Type(s):
Integer - Example:
Period: 1 - Default:
0
- Type(s):
PlusMinus: Whether to include plus/minus.- Type(s):
String - Example:
PlusMinus: "Y" - Default:
"N" - Valueset:
"Y""N"
- Type(s):
Rank: Whether to include rank.- Type(s):
String - Example:
Rank: "Y" - Default:
"N" - Valueset:
"Y""N"
- Type(s):
SeasonType: The type of season.- Type(s):
String - Example:
SeasonType: "Regular Season" - Default:
"Regular Season" - Valueset:
"Regular Season""Pre Season""Playoffs"
- Type(s):
VsDivision: The vs division.- Type(s):
String - Example:
VsDivision: "Atlantic" - Default:
nil - Valueset:
"Atlantic""Central""Northwest""Pacific""Southeast""Southwest""East""West"
- Type(s):
VsConference: The vs conference.- Type(s):
String - Example:
VsConference: "East" - Default:
nil - Valueset:
"East""West"
- Type(s):
ShotClockRange: The shot clock range.- Type(s):
String - Example:
ShotClockRange: "24-22" - Default:
nil - Valueset:
"24-22""22-18 Very Early""18-15 Early""15-7 Average""7-4 Late""4-0 Very Late""ShotClock Off"
- Type(s):
SeasonSegment: The season segment.- Type(s):
String - Example:
SeasonSegment: "Pre All-Star" - Default:
nil - Valueset:
"Post All-Star""Pre All-Star"
- Type(s):
PORound: The playoff round.- Type(s):
Integer - Example:
PORound: 1 - Default:
nil
- Type(s):
Outcome: The outcome.- Type(s):
String - Example:
Outcome: "W" - Default:
nil - Valueset:
"W""L"
- Type(s):
Location: The location.- Type(s):
String - Example:
Location: "Home" - Default:
nil - Valueset:
"Home""Road"
- Type(s):
LeagueID: The league ID.- Type(s):
String - Example:
LeagueID: "00" - Default:
"00" - Valueset:
"00"(NBA)"01"(ABA)"10"(WNBA)"20"(G League)
- Type(s):
GameSegment: The game segment.- Type(s):
String - Example:
GameSegment: "First Half" - Default:
nil - Valueset:
"First Half""Overtime""Second Half"
- Type(s):
DateTo: The end date.- Type(s):
String - Example:
DateTo: "2024-01-31" - Default:
nil
- Type(s):
DateFrom: The start date.- Type(s):
String - Example:
DateFrom: "2024-01-01" - Default:
nil
- Type(s):
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.TeamDashboard.get(:clutch, TeamID: 1610612747, Season: "2024-25")
{:ok, %{"TeamDashboardByClutch" => [%{...}, ...]}}