NBA.Stats.PlayerFantasyProfile (nba_api_ex v0.1.0)

View Source

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

See get/2 for parameter and usage details.

Summary

Functions

get(params \\ [MeasureType: "Base", PaceAdjust: "Y", PerMode: "Totals", PlayerID: nil, PlusMinus: "Y", Rank: "Y", Season: nil, SeasonType: "Regular Season", LeagueID: "00"], opts \\ [])

(since 0.1.0)

Fetches PlayerFantasyProfile 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
    • MeasureType: The type of measure.

      • Type(s): String
      • Example: MeasureType: "Base"
      • Default: "Base"
      • Valueset:
        • "Base"
    • PaceAdjust: Whether to adjust for pace.

      • Type(s): String
      • Example: PaceAdjust: "N"
      • Default: "N"
      • Valueset:
        • "N"
    • PerMode: How to aggregate stats.

      • Type(s): String
      • Example: PerMode: "Totals"
      • Default: "Totals"
      • Valueset:
        • "Totals"
        • "PerGame"
        • "Per36"
    • PlusMinus: Whether to include plus/minus.

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

      • Type(s): String
      • Example: Rank: "N"
      • Default: "N"
      • Valueset:
        • "N"
    • SeasonType: The type of season.

      • Type(s): String
      • Example: SeasonType: "Regular Season"
      • Default: "Regular Season"
      • Valueset:
        • "Regular Season"
        • "Pre Season"
        • "Playoffs"
    • LeagueID: The league ID.

      • Type(s): String
      • Example: LeagueID: "00"
      • Default: nil
      • Valueset:
        • "00" (NBA)
        • "01" (ABA)
        • "10" (WNBA)
        • "20" (G League)
  • 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.PlayerFantasyProfile.get(PlayerID: 201939, Season: "2024-25")
{:ok, %{"PlayerFantasyProfile" => [%{...}, ...]}}

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

(since 0.1.0)