NBA.Stats.CommonAllPlayers (nba_api_ex v0.1.0)

View Source

Fetches all players data from the NBA API.

Summary

Functions

get(params \\ [LeagueID: "00", IsOnlyCurrentSeason: "0", Season: "2024-25"], opts \\ [])

(since 0.1.0)

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)
    • 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)
    • Season: The season to fetch players for.
      • Type(s): String
      • Default: "2024-25"
      • Example: Season: "2021-22"
  • opts: A keyword list of additional options for the request, such as headers or timeout settings.

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", ...}, ...]}

get!(params \\ [], opts \\ [])

(since 0.1.0)