NBA.Stats.LeagueGameLog (nba_api_ex v0.1.0)
View SourceProvides functions to interact with the NBA stats API for league game logs.
See get/2 for parameter and usage details.
Summary
Functions
Fetches league game log data.
Parameters
params: A keyword list of parameters to filter the data.Counter: The number of records to return (default: 1000).- Type(s):
Integer - Example:
Counter: 1000 - Default:
1000
- Type(s):
Direction: The sort direction.- Type(s):
String - Example:
Direction: "DESC" - Default:
"DESC" - Valueset:
- "ASC"
- "DESC"
- Type(s):
LeagueID: The league ID.- Type(s):
String - Example:
LeagueID: "00" - Default:
"00"
- Type(s):
PlayerOrTeam: Whether to return player or team logs.- Type(s):
String - Example:
PlayerOrTeam: "P" - Default:
"P" - Valueset:
- "P" (Player)
- "T" (Team)
- Type(s):
Season: The season for which to fetch data.- Type(s):
String - Example:
Season: "2024-25" - Default:
nil
- Type(s):
SeasonType: The type of season.- Type(s):
String - Example:
SeasonType: "Regular Season" - Default:
"Regular Season" - Valueset:
- "Regular Season"
- "Pre Season"
- "Playoffs"
- "All Star"
- "All-Star"
- Type(s):
Sorter: The stat or field to sort by.- Type(s):
String - Example:
Sorter: "DATE" - Default:
"DATE" - Valueset:
"FGM""FGA""FG_PCT""FG3M""FG3A""FG3_PCT""FTM""FTA""FT_PCT""OREB""DREB""AST""STL""BLK""TOV""REB""PTS""DATE"
- 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):
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.LeagueGameLog.get(Season: "2024-25", PlayerOrTeam: "P")
{:ok, %{"LeagueGameLog" => [%{...}, ...]}}