NBA.Stats.CommonAllPlayers (nba_api_ex v0.1.0)
View SourceFetches all players data from the NBA API.
Summary
Functions
Fetches all players with optional parameters.
Functions
Fetches all players with optional parameters.
Parameters
params: A keyword list of parameters for the request.LeagueID: The league ID.- Type(s):
String - Default:
"00"(NBA) - Example:
LeagueID: "10" - Valueset:
"00"(NBA)"01"(ABA)"10"(WNBA)"20"(G-League)
- Type(s):
IsOnlyCurrentSeason: Whether to fetch only current season players.- Type(s):
String - Default:
"0"(All Seasons) - Example:
IsOnlyCurrentSeason: "1" - Valueset:
"0"(All Seasons)"1"(Only Current Season)
- Type(s):
Season: The season to fetch players for.- Type(s):
String - Default:
"2024-25" - Example:
Season: "2021-22"
- 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.
Returns
{:ok, response}: A tuple containing the status and parsed response body.{:error, reason}: An error tuple with the reason for failure.
Example
iex> NBA.Stats.CommonAllPlayers.get()
{:ok, [%{"DISPLAY_FIRST_LAST" => "LeBron James", ...}, ...]}