Skip to contents

A thin wrapper around the pbpstats API’s “get-top-results” endpoint.

Usage

get_top_results(
  league = "nba",
  season_type = "Regular Season",
  entity_type,
  stat,
  type,
  sort_order = NULL,
  min_cut_off = NULL
)

Arguments

league

Character. Which league to query; e.g., "nba" or "wnba"; defaults to "nba".

season_type

Character. One of:

  • "Regular Season"

  • "Playoffs"

  • "PlayIn"

  • "All"

; defaults to "Regular Season".

entity_type

Character. One of:

  • "Team"

  • "Opponent"

  • "Player"

  • "Lineup"

  • "LineupOpponent"

.

stat

Character. The statistic to rank by; one of:

  • "AtRimFGA"

  • "AtRimFGM"

  • "ShortMidRangeFGA"

  • "ShortMidRangeFGM"

  • "LongMidRangeFGA"

  • "LongMidRangeFGM"

  • "Corner3FGA"

  • "Corner3FGM"

  • "Arc3FGA"

  • "Arc3FGM"

  • "UnassistedAtRim"

  • "AssistedAtRim"

  • "UnassistedShortMidRange"

  • "AssistedShortMidRange"

  • "UnassistedLongMidRange"

  • "AssistedLongMidRange"

  • "UnassistedCorner3"

  • "AssistedCorner3"

  • "UnassistedArc3"

  • "AssistedArc3"

  • "Fg3aBlocked"

  • "Fg2aBlocked"

  • "LiveBallTurnovers"

  • "DeadBallTurnovers"

  • "Turnovers"

  • "AssistedFG2M"

  • "UnassistedFG2M"

  • "AssistedFG3M"

  • "UnassistedFG3M"

  • "Putbacks"

  • "FG2A"

  • "FG2M"

  • "FG3A"

  • "FG3M"

  • "AtRimAssists"

  • "Corner3Assists"

  • "Arc3Assists"

  • "TwoPtAssists"

  • "ThreePtAssists"

  • "AssistPoints"

  • "OffThreePtRebounds"

  • "OffTwoPtRebounds"

  • "FTOffRebounds"

  • "DefThreePtRebounds"

  • "DefTwoPtRebounds"

  • "FTDefRebounds"

  • "ShootingFouls"

  • "FoulsDrawn"

  • "TwoPtShootingFoulsDrawn"

  • "ThreePtShootingFoulsDrawn"

  • "NonShootingFoulsDrawn"

  • "Offensive Fouls"

  • "Offensive FoulsDrawn"

  • "Charge Fouls"

  • "Charge FoulsDrawn"

  • "Blocked2s"

  • "Blocked3s"

  • "TotalPoss"

  • "Minutes"

  • "PtsPer100Poss"

  • "AtRimFrequency"

  • "AtRimAccuracy"

  • "AtRimPctAssisted"

  • "ShortMidRangeFrequency"

  • "ShortMidRangeAccuracy"

  • "ShortMidRangePctAssisted"

  • "LongMidRangeFrequency"

  • "LongMidRangeAccuracy"

  • "LongMidRangePctAssisted"

  • "Corner3Frequency"

  • "Corner3Accuracy"

  • "Corner3PctAssisted"

  • "Arc3Frequency"

  • "Arc3Accuracy"

  • "Arc3PctAssisted"

  • "EfgPct"

  • "AssistPointsPer100Poss"

  • "DefFTReboundPct"

  • "OffFTReboundPct"

  • "DefTwoPtReboundPct"

  • "OffTwoPtReboundPct"

  • "DefThreePtReboundPct"

  • "OffThreePtReboundPct"

  • "DefFGReboundPct"

  • "OffFGReboundPct"

.

type

Character. Whether to fetch "season" or "game" results.

sort_order

Character. Sort order; "Asc" for ascending or "Desc" for descending.

min_cut_off

Numeric. Minimum cutoff value for inclusion.

Value

A tibble of the top results as returned by the API.

References

Darryl Blackport (2020). PBPStats API, MIT License. https://api.pbpstats.com/docs