NBA.Stats.TeamGameLogs (nba_api_ex v0.1.0)

View Source

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

See get/2 for parameter and usage details.

Summary

Functions

get(params \\ [DateFrom: nil, DateTo: nil, GameSegment: nil, LastNGames: nil, LeagueID: "00", Location: nil, MeasureType: nil, Month: nil, OppTeamID: nil, Outcome: nil, PerMode: nil, Period: nil, PlayerID: nil, PORound: nil, Season: nil, SeasonSegment: nil, SeasonType: nil, ShotClockRange: nil, TeamID: nil, VsConference: nil, VsDivision: nil], opts \\ [])

(since 0.1.0)

Fetches TeamGameLogs data.

Parameters

  • params: A keyword list of parameters to filter the data. All parameters are optional and default to nil unless otherwise noted.

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

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

    • GameSegment: The game segment.

      • Type(s): String
      • Default: nil
      • Valueset:
        • "First Half"
        • "Overtime"
        • "Second Half"
    • LastNGames: Number of last games to include.

    • LeagueID: The league ID.

    • Location: The game location.

      • Type(s): String
      • Default: nil
      • Valueset:
        • "Home"
        • "Road"
    • MeasureType: The measure type.

      • Type(s): String
      • Default: nil
      • Valueset:
        • "Base"
        • "Advanced"
        • "Misc"
        • "Four Factors"
        • "Scoring"
        • "Opponent"
        • "Usage"
        • "Defense"
    • Month: The month (1-12).

    • OppTeamID: The opponent team ID.

    • Outcome: The game outcome.

      • Type(s): String
      • Default: nil
      • Valueset:
        • "W"
        • "L"
    • PerMode: The per mode.

      • Type(s): String
      • Default: nil
      • Valueset:
        • "Totals"
        • "PerGame"
        • "MinutesPer"
        • "Per48"
        • "Per40"
        • "Per36"
        • "PerMinute"
        • "PerPossession"
        • "PerPlay"
        • "Per100Possessions"
        • "Per100Plays"
    • Period: The period.

    • PlayerID: The player ID.

    • PORound: The playoff round.

    • Season: The season.

    • SeasonSegment: The segment of the season.

      • Type(s): String
      • Default: nil
      • Valueset:
        • "Post All-Star"
        • "Pre All-Star"
    • SeasonType: The season type.

      • Type(s): String
      • Default: nil
      • Valueset:
        • "Regular Season"
        • "Pre Season"
        • "Playoffs"
        • "All Star"
    • ShotClockRange: The shot clock range.

      • Type(s): String
      • Default: nil
      • Valueset:
        • "24-22"
        • "22-18 Very Early"
        • "18-15 Early"
        • "15-7 Average"
        • "7-4 Late"
        • "4-0 Very Late"
        • "ShotClock Off"
    • TeamID: The team ID.

    • VsConference: The opposing conference.

      • Type(s): String
      • Default: nil
      • Valueset:
        • "East"
        • "West"
    • VsDivision: The opposing division.

      • Type(s): String
      • Default: nil
      • Valueset:
        • "Atlantic"
        • "Central"
        • "Northwest"
        • "Pacific"
        • "Southeast"
        • "Southwest"
        • "East"
        • "West"
  • 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.TeamGameLogs.get(Season: "2024-25", TeamID: 1610612744)
{:ok, %{"TeamGameLogs" => [%{...}, ...]}}

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

(since 0.1.0)