NBA.Stats.LeagueDashPtTeamDefend (nba_api_ex v0.1.0)
View SourceProvides functions to interact with the NBA stats API for league player tracking team defensive stats.
See get/2 for parameter and usage details.
Summary
Functions
Fetches league player tracking team defend stats data.
Functions
get(params \\ [PerMode: "PerGame", LeagueID: "00", SeasonType: "Regular Season", PORound: 0, TeamID: 0, Outcome: nil, Location: nil, Month: 0, SeasonSegment: nil, DateFrom: nil, DateTo: nil, OpponentTeamID: 0, VsConference: nil, VsDivision: nil, Conference: nil, Division: nil, GameSegment: nil, Period: 0, LastNGames: 0, StarterBench: nil, DefenseCategory: "Overall", ISTRound: nil], opts \\ [])
(since 0.1.0)Fetches league player tracking team defend stats data.
Parameters
params: A keyword list of parameters to filter the data.DefenseCategory: (Required) The defensive category.- Type(s):
String - Example:
DefenseCategory: "Overall" - Default:
"Overall" - Valueset:
"Overall""3 Pointers""2 Pointers""Less Than 6Ft""Less Than 10Ft""Greater Than 15Ft"
- Type(s):
Season: (Required) The season for which to fetch data.- Type(s):
String - Example:
Season: "2024-25" - Default:
nil
- Type(s):
Conference: The conference of the team.- Type(s):
String - Example:
Conference: "West" - Default:
nil - Valueset:
"East""West"
- Type(s):
DateFrom: The start date for filtering.- Type(s):
String - Example:
DateFrom: "2023-10-01" - Default:
nil
- Type(s):
DateTo: The end date for filtering.- Type(s):
String - Example:
DateTo: "2024-04-15" - Default:
nil
- Type(s):
Division: The division of the team.- Type(s):
String - Example:
Division: "Pacific" - Default:
nil - Valueset:
"Atlantic""Central""Southeast""Northwest""Pacific""Southwest"
- Type(s):
GameSegment: The segment of the game.- Type(s):
String - Example:
GameSegment: "First Half" - Default:
nil - Valueset:
"First Half""Second Half""Overtime"
- Type(s):
ISTRound: The round of the IST.- Type(s):
String - Example:
ISTRound: "All IST"(all IST rounds) - Default:
nil(no specific round) - Valueset:
"All IST"(All IST rounds)"Group Play"(Group stage)"Knockout - All"(Knockout stage)"Knockout Round - Quarter"(Quarterfinals of the knockout stage)"Knockout Round - Semi"(Semifinals of the knockout stage)"Knockout Round - Championship"(Finals of the knockout stage)"Group Play - East Group A"(Group A of the Eastern Conference)"Group Play - East Group B"(Group B of the Eastern Conference)"Group Play - East Group C"(Group C of the Eastern Conference)"Group Play - West Group A"(Group A of the Western Conference)"Group Play - West Group B"(Group B of the Western Conference)"Group Play - West Group C"(Group C of the Western Conference)
- Type(s):
LastNGames: The number of last games to consider.- Type(s):
Integer - Example:
LastNGames: 5 - Default:
0
- 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):
Location: The location of the game.- Type(s):
String - Example:
Location: "Home" - Default:
nil - Valueset:
"Home""Away"
- Type(s):
Month: The month of the season.- Type(s):
Integer - Example:
Month: 1 - Default:
0
- Type(s):
OpponentTeamID: The ID of the opposing team.Outcome: The outcome of the game.- Type(s):
String - Example:
Outcome: "W" - Default:
nil - Valueset:
"W""L"
- Type(s):
PerMode: How stats are aggregated.- Type(s):
String - Example:
PerMode: "PerGame" - Default:
"PerGame" - Valueset:
"Totals"(Total stats)"PerGame"(Per game stats)"MinutesPer"(Minutes per stats)"Per48"(Per 48 minutes stats)"Per40"(Per 40 minutes stats)"Per36"(Per 36 minutes stats)"PerMinute"(Per minute stats)"PerPossession"(Per possession stats)"PerPlay"(Per play stats)"Per100Possessions"(Per 100 possessions stats)"Per100Plays"(Per 100 plays stats)
- Type(s):
Period: The period of the game.- Type(s):
Integer - Example:
Period: 1 - Default:
0
- Type(s):
PORound: The playoff round (if applicable, else 0).- Type(s):
Integer - Example:
PORound: 1 - Default:
0
- Type(s):
SeasonSegment: The segment of the season.- Type(s):
String - Example:
SeasonSegment: "Post All Star" - Default:
nil - Valueset:
"Pre All Star""Post All Star"
- Type(s):
SeasonType: The type of season.- Type(s):
String - Example:
SeasonType: "Playoffs" - Default:
"Regular Season" - Valueset:
"Regular Season""Playoffs""Pre Season""All Star""Play In"
- Type(s):
StarterBench: Whether the player is a starter or bench.- Type(s):
String - Example:
StarterBench: "Bench" - Default:
nil - Valueset:
"Starter""Bench"
- Type(s):
TeamID: The NBA team ID (use0for all teams).VsConference: The conference of the opponent.- Type(s):
String - Example:
VsConference: "East" - Default:
nil - Valueset:
"East""West"
- Type(s):
VsDivision: The division of the opponent.- Type(s):
String - Example:
VsDivision: "Central" - Default:
nil - Valueset:
"Atlantic""Central""Southeast""Northwest""Pacific""Southwest"
- 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.LeagueDashPtTeamDefend.get(Season: "2024-25", DefenseCategory: "Overall")
{:ok, %{"LeagueDashPtTeamDefend" => [%{...}, ...]}}