NBA.Stats.VideoDetails (nba_api_ex v0.1.0)

View Source

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

See get/2 for parameter and usage details.

Summary

Functions

get(params \\ [ContextMeasure: "FGM", LastNGames: 0, Month: 0, OpponentTeamID: 0, Period: 0, PlayerID: nil, Season: nil, SeasonType: "Regular Season", TeamID: nil, VsDivision: nil, VsConference: nil, StartRange: nil, StartPeriod: nil, SeasonSegment: nil, RookieYear: nil, RangeType: nil, Position: nil, PointDiff: nil, Outcome: nil, Location: nil, LeagueID: "00", GameSegment: nil, GameID: nil, EndRange: nil, EndPeriod: nil, DateTo: nil, DateFrom: nil, ContextFilter: nil, ClutchTime: nil, AheadBehind: nil], opts \\ [])

(since 0.1.0)

Fetches VideoDetails data.

Parameters

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

    • PlayerID: (Required) The player ID.

    • Season: (Required) The season.

      • Type(s): String
      • Example: Season: "2024-25"
      • Default: nil
    • AheadBehind: The ahead/behind context.

      • Type(s): String
      • Example: AheadBehind: "Ahead or Tied"
      • Default: nil
    • ClutchTime: The clutch time.

      • Type(s): String
      • Example: ClutchTime: "Last 5 Minutes"
      • Default: nil
    • ContextFilter: The context filter.

      • Type(s): String
      • Example: ContextFilter: ""
      • Default: nil
    • ContextMeasure: The context measure.

      • Type(s): String
      • Example: ContextMeasure: "FGM"
      • Default: "FGM"
      • Valueset:
        • "FGM"
        • "FGA"
        • "FG_PCT"
        • "FG3M"
        • "FG3A"
        • "FG3_PCT"
        • "FTM"
        • "FTA"
        • "OREB"
        • "DREB"
        • "AST"
        • "FGM_AST"
        • "FG3_AST"
        • "STL"
        • "BLK"
        • "BLKA"
        • "TOV"
        • "PF"
        • "PFD"
        • "POSS_END_FT"
        • "PTS_PAINT"
        • "PTS_FB"
        • "PTS_OFF_TOV"
        • "PTS_2ND_CHANCE"
        • "REB"
        • "TM_FGM"
        • "TM_FGA"
        • "TM_FG3M"
        • "TM_FG3A"
        • "TM_FTM"
        • "TM_FTA"
        • "TM_OREB"
        • "TM_DREB"
        • "TM_REB"
        • "TM_TEAM_REB"
        • "TM_AST"
        • "TM_STL"
        • "TM_BLK"
        • "TM_BLKA"
        • "TM_TOV"
        • "TM_TEAM_TOV"
        • "TM_PF"
        • "TM_PFD"
        • "TM_PTS"
        • "TM_PTS_PAINT"
        • "TM_PTS_FB"
        • "TM_PTS_OFF_TOV"
        • "TM_PTS_2ND_CHANCE"
        • "TM_FGM_AST"
        • "TM_FG3_AST"
        • "TM_POSS_END_FT"
        • "OPP_FGM"
        • "OPP_FGA"
        • "OPP_FG3M"
        • "OPP_FG3A"
        • "OPP_FTM"
        • "OPP_FTA"
        • "OPP_OREB"
        • "OPP_DREB"
        • "OPP_REB"
        • "OPP_TEAM_REB"
        • "OPP_AST"
        • "OPP_STL"
        • "OPP_BLK"
        • "OPP_BLKA"
        • "OPP_TOV"
        • "OPP_TEAM_TOV"
        • "OPP_PF"
        • "OPP_PFD"
        • "OPP_PTS"
        • "OPP_PTS_PAINT"
        • "OPP_PTS_FB"
        • "OPP_PTS_OFF_TOV"
        • "OPP_PTS_2ND_CHANCE"
        • "OPP_FGM_AST"
        • "OPP_FG3_AST"
        • "OPP_POSS_END_FT"
        • "PTS"
    • DateFrom: The start date (YYYY-MM-DD).

      • Type(s): String
      • Example: DateFrom: "2025-01-01"
      • Default: nil
    • DateTo: The end date (YYYY-MM-DD).

      • Type(s): String
      • Example: DateTo: "2025-03-01"
      • Default: nil
    • EndPeriod: The end period.

      • Type(s): Integer
      • Example: EndPeriod: 4
      • Default: nil
    • EndRange: The end range.

    • GameID: The game ID. 10-digit string or nil.

      • Type(s): String
      • Example: GameID: "0022100001"
      • Default: nil
    • GameSegment: The game segment.

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

      • Type(s): Integer
      • Example: LastNGames: 0
      • Default: 0
    • LeagueID: The league ID.

      • Type(s): String
      • Example: LeagueID: "00"
      • Default: "00"
    • Location: The game location.

      • Type(s): String
      • Example: Location: "Home"
      • Default: nil
    • Month: The month (1-12, 0 for all).

      • Type(s): Integer
      • Example: Month: 0
      • Default: 0
    • OpponentTeamID: The opponent team ID.

      • Type(s): Integer | String

      • Example: OpponentTeamID: 1610612737
      • Default: 0
    • Outcome: The game outcome.

      • Type(s): String
      • Example: Outcome: "W"
      • Default: nil
    • Period: The period (0 for all).

      • Type(s): Integer
      • Example: Period: 0
      • Default: 0
    • PlayerPosition: The player position.

      • Type(s): String
      • Example: PlayerPosition: "Guard"
      • Default: nil
    • PointDiff: The point differential.

    • Position: The position.

      • Type(s): String
      • Example: Position: "Guard"
      • Default: nil
    • RangeType: The range type.

    • RookieYear: The rookie year.

      • Type(s): String
      • Example: RookieYear: "2019"
      • Default: nil
    • SeasonSegment: The season segment.

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

      • Type(s): String
      • Example: SeasonType: "Regular Season"
      • Default: "Regular Season"
    • StartPeriod: The start period.

      • Type(s): Integer
      • Example: StartPeriod: 1
      • Default: nil
    • StartRange: The start range.

    • TeamID: The team ID.

    • VsConference: The opposing conference.

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

      • Type(s): String
      • Example: VsDivision: "Pacific"
      • Default: nil
  • 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.VideoDetails.get(PlayerID: 201939, Season: "2024-25")
{:ok, %{"VideoDetails" => [%{...}, ...]}}

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

(since 0.1.0)