NBA.Stats.ScoreboardV2 (nba_api_ex v0.1.0)

View Source

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

See get/2 for parameter and usage details.

Summary

Functions

get(params \\ [DayOffset: 0, GameDate: nil, LeagueID: "00"], opts \\ [])

(since 0.1.0)

Fetches ScoreboardV2 data.

Parameters

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

    • GameDate: (Required) The game date (YYYY-MM-DD).

      • Type(s): String
      • Example: GameDate: "2025-03-01"
      • Default: nil
    • DayOffset: The day offset (can be negative or positive integer).

      • Type(s): Integer | String

      • Example: DayOffset: 0
      • Default: 0
      • Pattern: ^-{0,1}+$
    • LeagueID: The league ID. Defaults to "00" (NBA). Not required.

      • Type(s): String
      • Example: LeagueID: "00"
      • Default: "00"
      • Pattern: ^{2}$
  • 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.ScoreboardV2.get(GameDate: "2025-03-01")
{:ok, %{"ScoreboardV2" => [%{...}, ...]}}

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

(since 0.1.0)