NBA.Stats.TeamInfoCommon (nba_api_ex v0.1.0)

View Source

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

See get/2 for parameter and usage details.

Summary

Functions

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

(since 0.1.0)

Fetches TeamInfoCommon data.

Parameters

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

    • TeamID: (Required) The team ID.

    • LeagueID: The league ID (2-digit string).

    • SeasonType: The season type.

      • Type(s): String
      • Default: nil
      • Valueset:
        • "Regular Season"
        • "Pre Season"
        • "Playoffs"
        • "All-Star"
        • "All Star"
        • "Preseason"
    • Season: The season.

  • 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.TeamInfoCommon.get(TeamID: 1610612744)
{:ok, %{"TeamInfoCommon" => [%{...}, ...]}}

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

(since 0.1.0)