NBA.Stats.TeamGameLogs (nba_api_ex v0.1.0)
View SourceProvides functions to interact with the NBA stats API for TeamGameLogs.
See get/2 for parameter and usage details.
Summary
Functions
get(params \\ [DateFrom: nil, DateTo: nil, GameSegment: nil, LastNGames: nil, LeagueID: "00", Location: nil, MeasureType: nil, Month: nil, OppTeamID: nil, Outcome: nil, PerMode: nil, Period: nil, PlayerID: nil, PORound: nil, Season: nil, SeasonSegment: nil, SeasonType: nil, ShotClockRange: nil, TeamID: nil, VsConference: nil, VsDivision: nil], opts \\ [])
(since 0.1.0)Fetches TeamGameLogs data.
Parameters
params: A keyword list of parameters to filter the data. All parameters are optional and default tonilunless otherwise noted.DateFrom: The start date (YYYY-MM-DD).- Type(s):
String - Default:
nil
- Type(s):
DateTo: The end date (YYYY-MM-DD).- Type(s):
String - Default:
nil
- Type(s):
GameSegment: The game segment.- Type(s):
String - Default:
nil - Valueset:
"First Half""Overtime""Second Half"
- Type(s):
LastNGames: Number of last games to include.- Type(s):
Integer - Default:
nil
- Type(s):
LeagueID: The league ID.- Type(s):
String - Default:
"00"
- Type(s):
Location: The game location.- Type(s):
String - Default:
nil - Valueset:
"Home""Road"
- Type(s):
MeasureType: The measure type.- Type(s):
String - Default:
nil - Valueset:
"Base""Advanced""Misc""Four Factors""Scoring""Opponent""Usage""Defense"
- Type(s):
Month: The month (1-12).- Type(s):
Integer - Default:
nil
- Type(s):
OppTeamID: The opponent team ID.- Type(s):
Integer - Default:
nil
- Type(s):
Outcome: The game outcome.- Type(s):
String - Default:
nil - Valueset:
"W""L"
- Type(s):
PerMode: The per mode.- Type(s):
String - Default:
nil - Valueset:
"Totals""PerGame""MinutesPer""Per48""Per40""Per36""PerMinute""PerPossession""PerPlay""Per100Possessions""Per100Plays"
- Type(s):
Period: The period.- Type(s):
Integer - Default:
nil
- Type(s):
PlayerID: The player ID.- Type(s):
Integer - Default:
nil
- Type(s):
PORound: The playoff round.- Type(s):
Integer - Default:
nil
- Type(s):
Season: The season.- Type(s):
String - Default:
nil
- Type(s):
SeasonSegment: The segment of the season.- Type(s):
String - Default:
nil - Valueset:
"Post All-Star""Pre All-Star"
- Type(s):
SeasonType: The season type.- Type(s):
String - Default:
nil - Valueset:
"Regular Season""Pre Season""Playoffs""All Star"
- Type(s):
ShotClockRange: The shot clock range.- Type(s):
String - 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):
TeamID: The team ID.- Type(s):
Integer - Default:
nil
- Type(s):
VsConference: The opposing conference.- Type(s):
String - Default:
nil - Valueset:
"East""West"
- Type(s):
VsDivision: The opposing division.- Type(s):
String - Default:
nil - Valueset:
"Atlantic""Central""Northwest""Pacific""Southeast""Southwest""East""West"
- 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.TeamGameLogs.get(Season: "2024-25", TeamID: 1610612744)
{:ok, %{"TeamGameLogs" => [%{...}, ...]}}