NBA.Stats.TeamGameLog (nba_api_ex v0.1.0)

View Source

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

See get/2 for parameter and usage details.

Summary

Functions

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

(since 0.1.0)

Fetches TeamGameLog data.

Parameters

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

    • Season: (Required) The season.

    • TeamID: (Required) The team ID.

    • SeasonType: The season type.

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

    • DateTo: The end date (MM/DD/YYYY).

    • DateFrom: The start date (MM/DD/YYYY).

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

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

(since 0.1.0)