NBA.Stats.PlayerDashPt (nba_api_ex v0.1.0)

View Source

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

See get/2 for parameter and usage details.

Summary

Functions

get(type, params \\ [LastNGames: 0, LeagueID: "00", Month: 0, OpponentTeamID: 0, PerMode: "Totals", Period: 0, PlayerID: nil, Season: nil, SeasonType: "Regular Season", TeamID: nil, VsDivision: nil, VsConference: nil, SeasonSegment: nil, Outcome: nil, Location: nil, GameSegment: nil, DateTo: nil, DateFrom: nil], opts \\ [])

(since 0.1.0)
@spec get(atom(), Keyword.t(), Keyword.t()) :: {:ok, map()} | {:error, any()}

Fetches PlayerDashPtPass data.

Parameters

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

    • type: The type of player tracking data to fetch.

      • Type(s): atom()
      • Example: :passing
      • Default: nil
      • Valueset:
        • :passing (Passing stats)
        • :rebounding (Rebounding stats)
        • :defense (Defensive stats)
        • :shooting (Shooting stats)
    • PlayerID: (Required) The player ID.

      • Type(s): Integer | String

      • Example: PlayerID: 201939
      • Default: nil
    • Season: (Required) The season.

      • Type(s): String
      • Example: Season: "2024-25"
      • Default: nil
    • DateTo: The end date.

      • Type(s): String
      • Example: DateTo: "2024-01-31"
      • Default: nil
    • DateFrom: The start date.

      • Type(s): String
      • Example: DateFrom: "2024-01-01"
      • Default: nil
    • LastNGames: Number of last games to include.

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

      • Type(s): String
      • Example: LeagueID: "00"
      • Default: "00"
      • Valueset:
        • "00" (NBA)
        • "01" (ABA)
        • "10" (WNBA)
        • "20" (G League)
    • Location: The location.

      • Type(s): String
      • Example: Location: "Home"
      • Default: nil
      • Valueset:
        • "Home"
        • "Road"
    • Month: The month number.

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

      • Type(s): Integer | String

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

      • Type(s): String
      • Example: Outcome: "W"
      • Default: nil
      • Valueset:
        • "W"
        • "L"
    • PerMode: How to aggregate stats.

      • Type(s): String
      • Example: PerMode: "Totals"
      • Default: "Totals"
      • Valueset:
        • "Totals"
        • "PerGame"
    • SeasonSegment: The season segment.

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

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

      • Type(s): Integer | String

      • Example: TeamID: 1610612737
      • Default: nil
    • VsDivision: The vs division.

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

      • Type(s): String
      • Example: VsConference: "East"
      • Default: nil
      • Valueset:
        • "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.PlayerDashPt.get(:passing, PlayerID: 201939, Season: "2024-25")
{:ok, %{"PlayerDashPtPass" => [%{...}, ...]}}

get!(type, params \\ [LastNGames: 0, LeagueID: "00", Month: 0, OpponentTeamID: 0, PerMode: "Totals", Period: 0, PlayerID: nil, Season: nil, SeasonType: "Regular Season", TeamID: nil, VsDivision: nil, VsConference: nil, SeasonSegment: nil, Outcome: nil, Location: nil, GameSegment: nil, DateTo: nil, DateFrom: nil], opts \\ [])

(since 0.1.0)