NBA.Stats.LeagueDashPlayerStats (nba_api_ex v0.1.0)
View SourceProvides functions to interact with the NBA stats API for league player stats.
See get/2 for parameter and usage details.
Summary
Functions
Fetches league player stats data.
Functions
Fetches league player stats data.
Parameters
params: A keyword list of parameters to filter the data.College: The college of the player.- Type(s):
String - Example:
College: "Duke" - Default:
nil
- Type(s):
Conference: The conference of the team.- Type(s):
String - Example:
Conference: "West" - Default:
nil - Valueset:
"East""West"
- Type(s):
Country: The country of the player.- Type(s):
String - Example:
Country: "USA" - Default:
nil
- 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):
DraftPick: The draft pick of the player.- Type(s):
String - Example:
DraftPick: "1" - Default:
nil
- Type(s):
DraftYear: The draft year of the player.- Type(s):
String - Example:
DraftYear: "2018" - Default:
nil
- Type(s):
GameScope: The scope of games.- Type(s):
String - Example:
GameScope: "Last 10" - Default:
nil
- 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):
Height: The height of the player.- Type(s):
String - Example:
Height: "6-7" - Default:
nil
- 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""10""20"
- Type(s):
Location: The location of the game.- Type(s):
String - Example:
Location: "Home" - Default:
nil - Valueset:
"Home""Away"
- 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 of the season.- Type(s):
Integer - Example:
Month: 1 - Default:
0
- Type(s):
OpponentTeamID: The ID of the opponent team.Outcome: The outcome of the game.- Type(s):
String - Example:
Outcome: "W" - Default:
nil - Valueset:
"W""L"
- Type(s):
PaceAdjust: Whether to adjust for pace.- Type(s):
String - Example:
PaceAdjust: "Y" - Default:
"N" - Valueset:
"Y""N"
- Type(s):
PerMode: How stats are aggregated.- Type(s):
String - Example:
PerMode: "PerGame" - Default:
"PerGame" - Valueset:
"Totals""PerGame""Per48""Per40""Per36""PerMinute""PerPossession""PerPlay""Per100Possessions""Per100Plays"
- Type(s):
Period: The period of the game.- Type(s):
Integer - Example:
Period: 1 - Default:
0
- Type(s):
PlayerExperience: The experience level of the player.- Type(s):
String - Example:
PlayerExperience: "Rookie" - Default:
nil - Valueset:
"Rookie""Sophomore""Veteran"
- Type(s):
PlayerPosition: The position of the player.- Type(s):
String - Example:
PlayerPosition: "F" - Default:
nil - Valueset:
"F""C""G"
- Type(s):
PlusMinus: Whether to include plus/minus stats.- Type(s):
String - Example:
PlusMinus: "Y" - Default:
"N" - Valueset:
"Y""N"
- Type(s):
PORound: The playoff round.- Type(s):
Integer - Example:
PORound: 1 - Default:
0
- Type(s):
Rank: Whether to include rank.- Type(s):
String - Example:
Rank: "Y" - Default:
"N" - Valueset:
"Y""N"
- Type(s):
Season: (Required) The season for which to fetch data.- Type(s):
String - Example:
Season: "2024-25" - Default:
nil
- 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):
ShotClockRange: The range of the shot clock.- Type(s):
String - Example:
ShotClockRange: "24+" - Default:
nil - Valueset:
"24+""14-24""7-14""4-7""0-4"
- 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 ID of the team.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):
Weight: The weight of the player.- Type(s):
String - Example:
Weight: "220" - 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.LeagueDashPlayerStats.get(Season: "2024-25")
{:ok, %{"LeagueDashPlayerStats" => [%{...}, ...]}}