NBA.Stats.FranchisePlayers (nba_api_ex v0.1.0)

View Source

Handles requests to the franchiseplayers endpoint of the NBA stats API.

Summary

Functions

get(params \\ [LeagueID: "00", PerMode: "Totals", SeasonType: "Regular Season"], opts \\ [])

(since 0.1.0)

Fetches franchise player data for a specific team.

Parameters

  • params: A keyword list of parameters, including:
    • LeagueID: The league ID.
      • Type(s): Numeric String.
      • Default: "00" (NBA).
      • Example: LeagueID: "10" (for WNBA).
      • Valueset:
        • "00" (NBA)
        • "01" (ABA)
        • "10" (WNBA)
        • "20" (G-League)
    • PerMode: The mode for per-game stats (e.g., "PerGame", "Totals").
      • Type(s): String
      • Default: "Totals"
      • Example: PerMode: "PerGame"
      • Valueset:
        • "Totals" (Total stats)
        • "PerGame" (Per game stats)
        • "MinutesPer" (Per minute stats)
        • "Per48" (Per 48 minutes stats)
        • "Per40" (Per 40 minutes stats)
        • "Per36" (Per 36 minutes stats)
        • "PerMinute" (Per minute stats)
        • "PerPossession" (Per possession stats)
        • "PerPlay" (Per play stats)
        • "Per100Possessions" (Per 100 possessions stats)
        • "Per100Plays" (Per 100 plays stats)
    • SeasonType: Type of season (default is "Regular Season").
      • Type(s): String
      • Default: "Regular Season".
      • Example: SeasonType: "Playoffs".
      • Valueset:
        • "Regular Season"
        • "Playoffs"
        • "Pre Season"
        • "All Star"
    • TeamID: (Required) The team ID
  • 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.FranchisePlayers.get(TeamID: 1610612756)
{:ok, [%{"PlayerID" => 2544, "PlayerName" => "LeBron James", ...}]}

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

(since 0.1.0)