NBA.Stats.ShotChartLeagueWide (nba_api_ex v0.1.0)

View Source

Provides functions to interact with the NBA stats API for ShotChartLeagueWide.

See get/2 for parameter and usage details.

Summary

Functions

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

(since 0.1.0)

Fetches ShotChartLeagueWide data.

Parameters

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

    • Season: (Required) The season.

      • Type(s): String
      • Example: Season: "2024-25"
      • Default: nil
    • LeagueID: The league ID. Defaults to "00" (NBA). Not required.

      • Type(s): String
      • Example: LeagueID: "00"
      • Default: "00"
  • opts: A keyword list of additional options for the request, such as headers or timeout settings.

Returns

  • {:ok, data}: On success, returns the data from the API.
  • {:error, reason}: On failure, returns an error tuple with the reason.

Example

iex> NBA.Stats.ShotChartLeagueWide.get(Season: "2024-25")
{:ok, %{"ShotChartLeagueWide" => [%{...}, ...]}}

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

(since 0.1.0)