NBA.Stats.TeamVsPlayer (nba_api_ex v0.1.0)
View SourceProvides functions to interact with the NBA stats API for TeamVsPlayer.
See get/2 for parameter and usage details.
Summary
Functions
get(params \\ [LastNGames: 0, MeasureType: "Base", Month: 0, OpponentTeamID: 0, PaceAdjust: "N", PerMode: "PerGame", Period: 0, PlusMinus: "N", Rank: "N", Season: nil, SeasonType: "Regular Season", TeamID: 0, VsPlayerID: 0, VsDivision: "", VsConference: "", SeasonSegment: "", PlayerID: 0, Outcome: "", Location: "", LeagueID: "00", GameSegment: "", DateTo: "", DateFrom: ""], opts \\ [])
(since 0.1.0)Parameters
params: A keyword list of parameters to filter the data.LastNGames: The number of last games to include.- Type(s):
Integer - Default:
0
- Type(s):
MeasureType: The measure type for detailed defense.- Type(s):
String - Default:
"Base" - Valueset:
"Base""Advanced""Misc""Four Factors""Scoring""Opponent""Usage""Defense"
- Type(s):
Month: The month of the season.- Type(s):
Integer - Default:
0
- Type(s):
OpponentTeamID: The opposing team ID.- Type(s):
Integer - Default:
0
- Type(s):
PaceAdjust: Whether to adjust for pace.- Type(s):
String - Default:
"N" - Valueset:
"Y""N"
- Type(s):
PerMode: The per mode for detailed stats.- Type(s):
String - Default:
"PerGame" - Valueset:
"Totals""PerGame""MinutesPer""Per48""Per40""Per36""PerMinute""PerPossession""PerPlay""Per100Possessions""Per100Plays"
- Type(s):
Period: The period of the game.- Type(s):
Integer - Default:
0
- Type(s):
PlusMinus: Whether to include plus/minus data.- Type(s):
String - Default:
"N" - Valueset:
"Y""N"
- Type(s):
Rank: Whether to include rank data.- Type(s):
String - Default:
"N" - Valueset:
"Y""N"
- Type(s):
Season: The NBA season.- Type(s):
String - Default:
"2024-25"
- Type(s):
SeasonType: The season type for playoffs.- Type(s):
String - Default:
"Regular Season" - Valueset:
"Regular Season""Pre Season""Playoffs"
- Type(s):
TeamID: The team ID.- Type(s):
Integer - Default:
0
- Type(s):
VsPlayerID: The opposing player ID.- Type(s):
Integer - Default:
0
- Type(s):
VsDivision: The opposing division.- Type(s):
String - Default:
"" - Valueset:
"Atlantic""Central""Northwest""Pacific""Southeast""Southwest""East""West"
- Type(s):
VsConference: The opposing conference.- Type(s):
String - Default:
"" - Valueset:
"East""West"
- Type(s):
SeasonSegment: The season segment.- Type(s):
String - Default:
"" - Valueset:
"Post All-Star""Pre All-Star"
- Type(s):
PlayerID: The player ID.- Type(s):
Integer - Default:
0
- Type(s):
Outcome: The game outcome.- Type(s):
String - Default:
"" - Valueset:
"W""L"
- Type(s):
Location: The game location.- Type(s):
String - Default:
"" - Valueset:
"Home""Road"
- Type(s):
LeagueID: The league ID.- Type(s):
String - Default:
"00"
- Type(s):
GameSegment: The game segment.- Type(s):
String - Default:
"" - Valueset:
"First Half""Overtime""Second Half"
- Type(s):
DateTo: The end date for filtering games.- Type(s):
String - Default:
""
- Type(s):
DateFrom: The start date for filtering games.- Type(s):
String - Default:
""
- 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.TeamVsPlayer.get(TeamID: 1610612744, VsPlayerID: 201939)
{:ok, %{"TeamVsPlayer" => [%{...}, ...]}}