NBA.Stats.SynergyPlayTypes (nba_api_ex v0.1.0)

View Source

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

See get/2 for parameter and usage details.

Summary

Functions

get(params \\ [LeagueID: "00", PerMode: "PerGame", PlayerOrTeam: "P", SeasonType: "Regular Season", SeasonYear: nil, TypeGrouping: nil, PlayType: nil], opts \\ [])

(since 0.1.0)

Fetches SynergyPlayTypes data.

Parameters

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

    • PerMode: (Required) The data aggregation mode.

      • Type(s): String
      • Example: PerMode: "PerGame"
      • Default: "PerGame"
      • Valueset:
        • "Totals"
        • "PerGame"
    • PlayerOrTeam: (Required) Whether to return player or team data.

      • Type(s): String
      • Example: PlayerOrTeam: "P"
      • Default: nil
      • Valueset:
        • "P"
        • "T"
    • SeasonType: (Required) The season type.

      • Type(s): String
      • Example: SeasonType: "Regular Season"
      • Default: "Regular Season"
      • Valueset:
        • "Regular Season"
        • "Pre Season"
        • "Playoffs"
        • "All Star"
        • "All-Star"
    • SeasonYear: (Required) The season year.

      • Type(s): String
      • Example: SeasonYear: "2024-25"
      • Default: nil
    • LeagueID: The league ID. Defaults to "00" (NBA). Not required.

      • Type(s): String
      • Example: LeagueID: "00"
      • Default: "00"
    • TypeGrouping: The type grouping.

      • Type(s): String
      • Example: TypeGrouping: "Offensive"
      • Default: nil
    • PlayType: The play type.

      • Type(s): String
      • Example: PlayType: "Transition"
      • 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.SynergyPlayTypes.get(PerMode: "PerGame", PlayerOrTeam: "P", SeasonType: "Regular Season", SeasonYear: "2024-25")
{:ok, %{"SynergyPlayTypes" => [%{...}, ...]}}

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

(since 0.1.0)