NBA.Stats.CommonTeamRoster (nba_api_ex v0.1.0)

View Source

Fetches the roster for a specific NBA team.

Summary

Functions

Fetches the roster for a specific NBA team. This function retrieves the roster details based on the provided parameters.

Functions

get(params \\ [LeagueID: "00"], opts \\ [])

(since 0.1.0)

Fetches the roster for a specific NBA team. This function retrieves the roster details based on the provided parameters.

Parameters

  • params: A keyword list of parameters to filter the team roster.
    • TeamID: (Required) The unique identifier for the team.
      • Type(s): Integer, Numeric String.
      • Example: TeamID: 1610612747 (for Los Angeles Lakers).
    • Season: (Required) The season for which to retrieve the roster.
      • Type(s): String.
      • Example: Season: "2022-23".
    • 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)
  • 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.CommonTeamRoster.get(TeamID: 1610612747, Season: "2022-23")
{:ok, %{"Coaches" => [%{...}, ...], "CommonTeamRoster" => [%{"PlayerID" => 237, "FirstName" => "LeBron", "LastName" => "James", ...}, ...]}}

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

(since 0.1.0)