NBA.Stats.BoxScore (nba_api_ex v0.1.0)
View SourceFetches box score data for a specific game.
Summary
Functions
Fetches advanced box score data for a specific game.
Functions
Fetches advanced box score data for a specific game.
Parameters
type: The type of data to fetch (e.g., "Advanced").traditional: Fetches traditional box score data.advanced: Fetches advanced box score data.misc: Fetches miscellaneous box score data.scoring: Fetches scoring box score data.usage: Fetches usage box score data.fourfactors: Fetches four factors box score data.hustle: Fetches hustle box score data.defense: Fetches defensive box score data.matchups: Fetches matchups box score data.
params: A keyword list of parameters for the request.GameID: (Required) The unique identifier for the game.- Type(s): Numeric
String. - Example:
GameID: "0022200001"(for a specific game).
- Type(s): Numeric
LeagueID: The league ID.- Type(s): Numeric
String. - Default:
"00"(NBA). - Example:
LeagueID: "10"(for WNBA). - Valueset:
"00"(NBA)"01"(ABA)"10"(WNBA)"20"(G-League)
- Type(s): Numeric
endPeriod: The end period for the box score data.- Type(s):
Integer. - Default:
0(all periods). - Example:
endPeriod: 4.
- Type(s):
endRange: The end range for the box score data in seconds.- Type(s):
Integer. - Default:
31800(full game). - Example:
endRange: 3600(for the first hour).
- Type(s):
rangeType: The type of range for the box score data.- Type(s):
Integer. - Default:
0(full game). - Example:
rangeType: 1(for first half).
- Type(s):
startPeriod: The start period for the box score data.- Type(s):
Integer. - Default:
0(all periods). - Example:
startPeriod: 1.
- Type(s):
startRange: The start range for the box score data in seconds.- Type(s):
Integer. - Default:
0(start of game). - Example:
startRange: 1800(for the first 30 minutes).
- Type(s):
opts: A keyword list of additional options for the request, such as headers or timeout settings.- For a list of available options, see the Req documentation.
Example
iex> NBA.Stats.BoxScore.get(:traditional, GameID: "0022200001")
{:ok, [%{"gameId" => "0022200001", ...}, ...]}Returns
{:ok, box_score}: A map containing the box score data.{:error, reason}: An error tuple with the reason for failure.