NBA.Stats.PlayerAwards (nba_api_ex v0.1.0)

View Source

Fetches award data for a specific NBA player.

Summary

Functions

get(params \\ [PlayerID: nil], opts \\ [])

(since 0.1.0)

Fetches awards for a specific player.

Parameters

  • params: A keyword list of parameters for the request.
    • PlayerID: (Required) The ID of the player to fetch awards for.
      • Type(s): Integer, Numeric String.
      • Example: PlayerID: 2544 (for LeBron James).
  • opts: A keyword list of options for the request, such as headers or timeout settings.

Returns

  • {:ok, awards}: A map of awards grouped by award name.
  • {:error, reason}: An error tuple with the reason for failure.

Example

iex> NBA.Stats.PlayerAwards.get(PlayerID: "2544")
{:ok, %{"All-NBA" => [%{"DESCRIPTION" => "All-NBA", ...}]}}

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

(since 0.1.0)