NBA.Stats.PlayerGameStreakFinder (nba_api_ex v0.1.0)
View SourceProvides functions to interact with the NBA stats API for league game finder.
See get/2 for parameter and usage details.
Summary
Functions
get(params \\ [ActiveStreaksOnly: nil, Conference: nil, DateFrom: nil, DateTo: nil, Division: nil, DraftNumber: nil, DraftRound: nil, DraftTeamID: nil, DraftYear: nil, GameID: nil, LeagueID: "00", Location: nil, MinGames: 0, Outcome: nil, PlayerID: nil, PORound: 0, RookieYear: nil, Season: nil, SeasonSegment: nil, SeasonType: "Regular Season", StarterBench: nil, TeamID: 0, VsConference: nil, VsDivision: nil, VsTeamID: nil, YearsExperience: nil, LtAST: nil, LtBLK: nil, LtDD: nil, LtDREB: nil, LtFG3A: nil, LtFG3M: nil, LtFG3_PCT: nil, LtFGA: nil, LtFGM: nil, LtFG_PCT: nil, LtFTA: nil, LtFTM: nil, LtFT_PCT: nil, LtMINUTES: nil, LtOREB: nil, LtPF: nil, LtPTS: nil, LtREB: nil, LtSTL: nil, LtTD: nil, LtTOV: nil, GtAST: nil, GtBLK: nil, GtDD: nil, GtDREB: nil, GtFG3A: nil, GtFG3M: nil, GtFG3_PCT: nil, GtFGA: nil, GtFGM: nil, GtFG_PCT: nil, GtFTA: nil, GtFTM: nil, GtFT_PCT: nil, GtMINUTES: nil, GtOREB: nil, GtPF: nil, GtPTS: nil, GtREB: nil, GtSTL: nil, GtTD: nil, GtTOV: nil, EqAST: nil, EqBLK: nil, EqDD: nil, EqDREB: nil, EqFG3A: nil, EqFG3M: nil, EqFG3_PCT: nil, EqFGA: nil, EqFGM: nil, EqFG_PCT: nil, EqFTA: nil, EqFTM: nil, EqFT_PCT: nil, EqMINUTES: nil, EqOREB: nil, EqPF: nil, EqPTS: nil, EqREB: nil, EqSTL: nil, EqTD: nil, EqTOV: nil], opts \\ [])
(since 0.1.0)Fetches league game finder data.
Parameters
params: A keyword list of parameters to filter the data.Note: This endpoint also supports a wide range of advanced stat filters in the form of
LtX,GtX, andEqX(e.g.,LtPTS,GtAST,EqREB), whereXis a stat name. These acceptIntegerorFloatvalues and default tonil.PlayerID: (Required) The NBA player ID.Season: (Required) The season for which to fetch data.- Type(s):
String - Example:
Season: "2024-25" - Default:
nil
- Type(s):
ActiveStreaksOnly: Filter for active streaks only.- Type(s):
String - Example:
ActiveStreaksOnly: "Y" - Default:
"N" - Valueset:
"Y"(Yes)"N"(No)
- Type(s):
Conference: The conference of the team.- Type(s):
String - Example:
Conference: "West" - Default:
nil - Valueset:
"East""West"
- Type(s):
DateFrom: Start date filter (format: "MM/DD/YYYY").- Type(s):
String - Example:
DateFrom: "01/01/2024" - Default:
nil
- Type(s):
DateTo: End date filter (format: "MM/DD/YYYY").- Type(s):
String - Example:
DateTo: "01/31/2024" - 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):
DraftNumber: The draft number.- Type(s):
Integer - Example:
DraftNumber: 1 - Default:
nil
- Type(s):
DraftRound: The draft round.- Type(s):
Integer - Example:
DraftRound: 1 - Default:
nil
- Type(s):
DraftTeamID: The draft team ID.DraftYear: The draft year of the player.- Type(s):
Integer - Example:
DraftYear: 2019 - Default:
nil
- Type(s):
GameID: The NBA game ID.- Type(s):
String - Example:
GameID: "0022100001" - 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):
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: Game location ("Home", "Away", or nil for all).- Type(s):
String - Example:
Location: "Home" - Default:
nil - Valueset:
"Home""Away"
- Type(s):
MinGames: Minimum number of games played.- Type(s):
Integer - Example:
MinGames: 5 - Default:
0
- Type(s):
Outcome: Game outcome ("W", "L", or nil for all).- Type(s):
String - Example:
Outcome: "W" - Default:
nil - Valueset:
"W""L"
- Type(s):
PORound: The playoff round (0 for regular season).- Type(s):
Integer - Example:
PORound: 0 - Default:
0
- Type(s):
RookieYear: The rookie year of the player.- Type(s):
String - Example:
RookieYear: "2019" - Default:
nil
- Type(s):
SeasonSegment: Season segment ("Post All-Star", "Pre All-Star", or nil).- Type(s):
String - Example:
SeasonSegment: "Post All-Star" - Default:
nil - Valueset:
"Post All-Star""Pre All-Star"
- Type(s):
SeasonType: The type of season.- Type(s):
String - Example:
SeasonType: "Regular Season" - Default:
"Regular Season" - Valueset:
"Regular Season""Playoffs""Pre Season""All Star"
- 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: Team ID (0 for all teams).VsConference: Opponent conference filter ("East", "West", or nil).- Type(s):
String - Example:
VsConference: "West" - Default:
nil - Valueset:
"East""West"
- Type(s):
VsDivision: Opponent division filter (e.g., "Atlantic", "Central", etc., or nil).- Type(s):
String - Example:
VsDivision: "Central" - Default:
nil - Valueset:
"Atlantic""Central""Southeast""Northwest""Pacific""Southwest"
- Type(s):
VsTeamID: The opposing team ID.YearsExperience: Years of NBA experience.- Type(s):
Integer - Example:
YearsExperience: 5 - 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.LeagueGameFinder.get(LeagueID: "00", PlayerOrTeam: "P")
{:ok, %{"LeagueGameFinder" => [%{...}, ...]}}