NBA.Stats.TeamVsPlayer (nba_api_ex v0.1.0)

View Source

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

See get/2 for parameter and usage details.

Summary

Functions

get(params \\ [LastNGames: 0, MeasureType: "Base", Month: 0, OpponentTeamID: 0, PaceAdjust: "N", PerMode: "PerGame", Period: 0, PlusMinus: "N", Rank: "N", Season: nil, SeasonType: "Regular Season", TeamID: 0, VsPlayerID: 0, VsDivision: "", VsConference: "", SeasonSegment: "", PlayerID: 0, Outcome: "", Location: "", LeagueID: "00", GameSegment: "", DateTo: "", DateFrom: ""], opts \\ [])

(since 0.1.0)

Parameters

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

    • LastNGames: The number of last games to include.

    • MeasureType: The measure type for detailed defense.

      • Type(s): String
      • Default: "Base"
      • Valueset:
        • "Base"
        • "Advanced"
        • "Misc"
        • "Four Factors"
        • "Scoring"
        • "Opponent"
        • "Usage"
        • "Defense"
    • Month: The month of the season.

    • OpponentTeamID: The opposing team ID.

    • PaceAdjust: Whether to adjust for pace.

      • Type(s): String
      • Default: "N"
      • Valueset:
        • "Y"
        • "N"
    • PerMode: The per mode for detailed stats.

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

    • PlusMinus: Whether to include plus/minus data.

      • Type(s): String
      • Default: "N"
      • Valueset:
        • "Y"
        • "N"
    • Rank: Whether to include rank data.

      • Type(s): String
      • Default: "N"
      • Valueset:
        • "Y"
        • "N"
    • Season: The NBA season.

      • Type(s): String
      • Default: "2024-25"
    • SeasonType: The season type for playoffs.

      • Type(s): String
      • Default: "Regular Season"
      • Valueset:
        • "Regular Season"
        • "Pre Season"
        • "Playoffs"
    • TeamID: The team ID.

    • VsPlayerID: The opposing player ID.

    • VsDivision: The opposing division.

      • Type(s): String
      • Default: ""
      • Valueset:
        • "Atlantic"
        • "Central"
        • "Northwest"
        • "Pacific"
        • "Southeast"
        • "Southwest"
        • "East"
        • "West"
    • VsConference: The opposing conference.

      • Type(s): String
      • Default: ""
      • Valueset:
        • "East"
        • "West"
    • SeasonSegment: The season segment.

      • Type(s): String
      • Default: ""
      • Valueset:
        • "Post All-Star"
        • "Pre All-Star"
    • PlayerID: The player ID.

    • Outcome: The game outcome.

      • Type(s): String
      • Default: ""
      • Valueset:
        • "W"
        • "L"
    • Location: The game location.

      • Type(s): String
      • Default: ""
      • Valueset:
        • "Home"
        • "Road"
    • LeagueID: The league ID.

    • GameSegment: The game segment.

      • Type(s): String
      • Default: ""
      • Valueset:
        • "First Half"
        • "Overtime"
        • "Second Half"
    • DateTo: The end date for filtering games.

    • DateFrom: The start date for filtering games.

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

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

(since 0.1.0)