NBA.Stats.CommonPlayerInfo (nba_api_ex v0.1.0)

View Source

Provides functions to fetch common player information from the NBA Stats API.

Summary

Functions

Fetches common player information from the NBA Stats API. This function retrieves player details based on the provided parameters.

Functions

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

(since 0.1.0)

Fetches common player information from the NBA Stats API. This function retrieves player details based on the provided parameters.

Parameters

  • params: A keyword list of parameters to filter the player information.

    • PlayerID: (Required) The unique identifier for the player.

      • Type(s): Integer | String

      • Example: PlayerID: 2544 or PlayerID: "2544" (for LeBron James).
    • 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.CommonPlayerInfo.get(PlayerID: 2544)
{:ok, %{"name" => "LeBron James", ...}}

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

(since 0.1.0)