hoopR 3.2.0
Breaking changes
These change what existing code gets back from 3.1.0; each is described in full in the sections below.
-
load_nba_stats_player_game_logs()returns player rows; the team rows it used to return are inload_nba_stats_team_game_logs(). Drop and rebuild anupdate_nba_stats_db()table built before this release. - The NBA Stats wrappers default
seasonto the previous season (97 arguments), not the current one. Passseasonto get the current season. -
nba_rapm()fits a different model (an intercept,standardize = FALSE); its values and player order are not comparable with earlier output. -
update_mbb_db(),update_nba_db()andupdate_nba_stats_db()defaultdbdirtotools::R_user_dir("hoopR", "data"), not the working directory. Passdbdir = "."to keep the old location. -
load_mbb_pbp()andload_nba_pbp()return the playidas exact character. Database tables built before hold rounded numeric ids; rebuild them. - Join ids are integer: ESPN
game_id/athlete_idin the roster and crosswalk loaders, and the NBA Stats ids inload_nba_*_crosswalk(). The live crosswalk builders (nba_team_crosswalk()and friends) still return character NBA Stats ids. -
nba_schedule()reads each league’s own CDN:league_id"00"(NBA, the default),"10"(WNBA) and"20"(G League). Any otherleague_idis an argument error.
International basketball
- New wrappers mirroring sportsdataverse-py’s international basketball families (same function names, arguments and columns): FIBA, Genius Sports, Sportradar Atrium, NBL (Rosetta), SCB (BBL), FEB, TBF, ABA, ACB, B.LEAGUE, BNXT, CBA, CEBL, Basketligaen, EASL, IBBA, KBL, KZS, LBA, LKL, P. LEAGUE+, TPBL and VTB, plus the men’s per-competition aliases. They share one polite transport (at least 1 s between requests to a host) and raise classed conditions instead of returning empty:
hoopR_no_data,hoopR_asset_fetch(with atransientfield) andhoopR_bad_request, all inheritinghoopR_error. In all, 667 new exports (23 families plus 148 per-competition aliases). Every route is tested at parity with sportsdataverse-py on the same fixtures (column names, types, every cell and the request sent). Python-only arguments (return_parsed,return_as_pandas) are not ported, and a whole-number double is accepted wherever sportsdataverse-py takes an integer. Live tests run only withHOOPR_INTL_LIVE_TESTS=1; Genius needsGENIUS_PROXYand CBACBA_PROXY. - The international parsers name each JSON field once per session instead of once per row, so a 300-row SCB season table parses in about 1 s instead of 4.5 s (LBA, NBL and the other families that use the same naming helper speed up too).
- The P. LEAGUE+ parsers trim and split each distinct cell text and class list once per call instead of once per node, so
pleague_pbp()for one game takes about 2 s of CPU instead of 4 s. The output is unchanged.
EuroLeague and EuroCup (euroleague_*)
- New EuroLeague / EuroCup family,
euroleague_*()(15 functions), wrapping the keyless, unofficial Competition Engine (api-live.euroleague.netv2 + v3) and live (live.euroleague.net/api) APIs:euroleague_competitions(),euroleague_seasons(),euroleague_rounds(),euroleague_clubs(),euroleague_people(),euroleague_games(),euroleague_game_stats(),euroleague_game_report(),euroleague_standings(kind =),euroleague_player_stats(mode =),euroleague_team_stats(mode =),euroleague_game_points()(the shot chart, in centimeters from the hoop),euroleague_game_pbp(),euroleague_game_boxscore()andeuroleague_game_header(). They mirror sportsdataverse-py’seuroleague_*wrappers (same arguments, defaults and snake_case columns) and raise the classedhoopR_no_data/hoopR_invalid_request/hoopR_fetch_errorconditions on a failed request; the live API’s empty “no such game” answer is a zero-row tibble with the documented columns. Wrap-only: payloads are not redistributed as release assets.
Warnings and errors from wrappers
- 277
tryCatch()blocks had awarning =handler (195 of them empty), so any warning raised while parsing (a coercion NA, a short-variable row-name notice) stopped the parse and the wrapper returned an empty or half-built result, silently when the handler was empty. Their bodies now run inside.hoopR_with_warnings(), which re-raises each warning as a classedhoopR_warningreading<function>(): <message>and lets the body finish. The original warning’s classes are kept, sosuppressWarnings(classes = ...)filters still match. A warning raised in an internal helper names the exported function you called. - The 126
.try_catch()blocks (the ESPN wrappers moved to it earlier in this release) use the same helper: 34 of them dropped warnings and 92 printed them as messages through.report_api_warning()..try_catch()and.report_api_warning()are removed. - What you see changes: 229 call sites that were silent and 174 that printed a
climessage now raise a real R warning. Code that hid them withsuppressMessages()needssuppressWarnings(classes = "hoopR_warning"). - Eight error handlers in the international families that re-raised a parse failure without its cause now keep it (
parent = e, or the parser’s message appended). - An HTTP error answer from CollegeBasketballData no longer comes back as data. A key below the endpoint’s tier (401) or a used-up monthly allowance
- used to be parsed like a normal response, so every
cbbd_*()function returned a one-rowhoopR_datatibble holding the errormessageand reported nothing; a server error’s HTML page failed with a JSON parse error that hid the status. The shared request helpers now check the status before parsing and raise a classedhoopR_http_error(also ahoopR_fetch_error) naming the status, the endpoint and CBBD’smessage, which the function’s error handler reports. The NBA Stats (request_with_proxy()), Bart Torvik, Basketball-Reference and HoopsHype / Spotrac / NBADraft.net helpers check it the same way. A 200 response, including an empty[], is parsed as before.
- used to be parsed like a normal response, so every
Behavior changes
load_nba_stats_player_game_logs()now returns one row per player-game, withplayer_id,player_nameandfantasy_pts. Until 2026-11-13 thenba_stats_player_game_logsrelease held team rows; those moved toload_nba_stats_team_game_logs(). A database table written byupdate_nba_stats_db(datasets = "player_game_logs")before this release holds team rows: dropnba_stats_player_game_logsand rebuild it, adding"team_game_logs"(now a validupdate_nba_stats_db()dataset).The ESPN release loaders, the NBA and MBB crosswalk loaders and
load_ncaa_mbb_rapm()/load_ncaa_mbb_rapm_within_team()no longer return an empty table when called with their default season before that season is published. The default,most_recent_*_season(), rolls over before every release tag has its file (on 2026-11-04 the standings, MBB crosswalk and NCAA RAPM tags stopped at 2026); the loader now checks that the file exists and, if not, reads the newest published season with a message, as wehoop and fastRhockey do. An explicit request for an unpublished season is kept as asked (#261).load_mbb_officials()accepts 2003-2024 (except 2010) andload_mbb_game_rosters()2003-2024: those seasons are published and were refused by the loader floors. After the 2026-11-13 backfill every one of them is also published as.rds, so they no longer need arrow. The same backfill publishedload_mbb_player_stats()2003-2024 (ESPN’s single-season player rows are sparse before about 2010) andload_nba_game_rosters()/load_nba_officials()1994-2001, and a new ESPN scrape publishedload_nba_team_stats()1994-2001; the loaders now accept them. The NBA crosswalk floors were already 2002, as published (#261, mirroring sportsdataverse-py#1091).update_mbb_db(),update_nba_db()andupdate_nba_stats_db()no longer write to the working directory by default.dbdirnow defaults to the per-user data directorytools::R_user_dir("hoopR", "data")(created on first use, with a message naming it). To keep using a database in the working directory, passdbdir = ".".-
The NBA Stats wrappers now default
seasonto the previous season. 97 season arguments defaulted to the current one,year_to_season(most_recent_nba_season() - 1), which stats.nba.com answers with empty tables until that season’s games begin. On 2026-10-05 the current season, 2026-27, leftnba_leaguedashplayerstats(),nba_leaguegamelog()andnba_teamgamelogs()empty; the previous season returns 582, 2,460 and 82 rows. They now default toyear_to_season(most_recent_nba_season() - 2). Passseasonfor the current season.most_recent_nba_season()rolls over in October, so from July to September the default is two seasons back from the one just finished. Unchanged:- the schedule functions (
nba_schedule(),nba_scheduleleaguev2int(),nbagl_schedule()), because a schedule is published before its season starts; - the draft and draft-combine functions, whose default (
most_recent_nba_season() - 1) is already the latest completed draft; -
nba_teams(), which reads the current season’s standings (they list all 30 teams before the season starts); - fixed defaults such as
"2020-21"and"22022".
wehoop’s WNBA Stats wrappers use the same previous-season rule, as does sportsdataverse-py. The examples and live tests pass the previous season too. The
nba_playoffpicture()error hint now namesseason_id, the argument it takes, and thenba_drafthistory()live test passesseasonrather than an unknownseason_year, which was silently ignored. - the schedule functions (
-
nba_rapm()now fits the same model as sportsdataverse-py (a ridge with an intercept, on unstandardized player indicators; glmnet and sklearn scale and choose the penalty differently), so its values and player order change:- It fits an intercept. Without one, the league-average points per possession leaked into the player coefficients: on the 2025-26 regular season the possession-weighted mean O-RAPM was +11.4 and D-RAPM -11.1. The average O-RAPM and D-RAPM over players are now 0 (the data do not fix each block’s level; the penalty does). Possession-weighted means are not fixed by the model; on 2025-26 they were +0.30 and +0.07.
- It no longer standardizes the indicators (
standardize = FALSE). glmnet’s default rescaled each player column, which shrank low-minute players less and, with the intercept, made cross-validation choose a penalty five times heavier.
On the 2025-26 regular season, for players with 1,000+ offensive possessions, the correlation of
rapmwith sportsdataverse-py’s fit rises from 0.960 to 0.989, and withload_nba_player_impact()RAPM from 0.955 to 0.986. The player order is not the same as before (Spearman 0.94 for those players, 0.83 for everyone), so earliernba_rapm()output is not comparable. Constantpoints(including a single possession), or the same ten players on every possession, now returns all-zero player values instead of an error, possessions with missingpointsare dropped like those with a missing lineup slot, and tiny inputs fall back to a fixedlambdainstead of erroring: silently with fewer than 3 possessions (too few for cross-validation), and with a warning when cross-validation fails on 3 or more.
New data loaders
-
load_nba_stats_team_game_logs()reads the newnba_stats_team_game_logsrelease: one row per team-game from stats.nba.comleaguegamelog, 1996-97 onward. - Eight new loaders read the
mbb_groupsandnba_groupsreleases on sportsdataverse-data, which record conference and division membership as it was each season rather than back-applying today’s alignment:load_mbb_groups()/load_nba_groups()(one row per lineage, with onegroup_idkept across renames),load_mbb_group_seasons()/load_nba_group_seasons()(names, parent group and member count as of each season),load_mbb_group_aliases()/load_nba_group_aliases()(the names and ids ESPN, NCAA, KenPom and NBA Stats use for each group) andload_mbb_team_group_seasons(seasons)(2002 onward) /load_nba_team_group_seasons(seasons)(1971 onward), one row per team per season. Seasons are ending years. The loaders read parquet, not the tags’ csv copies, soteam_idstays character. - Four more loaders read the provider alias tables in the same releases:
load_mbb_team_aliases()/load_nba_team_aliases()map a Fox, Yahoo, CBS, 247Sports, On3, KenPom, Torvik, NCAA or NBA Stats team id or name to the ESPNteam_id, andload_mbb_player_aliases()/load_nba_player_aliases()map an NCAA, Fox, Yahoo, KenPom or NBA Stats player id to the ESPNathlete_id. Each row carries the seasons it holds (valid_from/valid_to), how it was matched and where it came from. - Sixteen loaders for the NBA release tags that had none, with the names, arguments and season floors of their sportsdataverse-py twins:
load_nba_stats_synergy()(nba_stats_synergy, 2015 on;season_type,per_mode,type_groupingandplay_typepick among the 72 files of a season),load_nba_stats_hustle_player()/load_nba_stats_hustle_team()(nba_stats_hustle, 2015 on),load_nba_stats_matchups()/load_nba_stats_matchups_rollup()(nba_stats_matchups, 2017 on),load_nba_stats_game_matchups()(nba_stats_game_matchups, 2017 on),load_nba_stats_injury_report()(nba_stats_injury_report, the league’s official injury reports, 2018 on), the five draft-combine tablesload_nba_stats_draft_combine_stats()/_anthro()/_drills()/_spot_shooting()/_nonstationary_shooting()(nba_stats_draft_combine, 2000 on),load_nba_stats_metric_curves()(FG% by shot distance) andload_nba_stats_rolling_windows()(rolling shooting form), both 1996 on. Like everyload_nba_stats_*()loader they take the season’s START year. Two more take END years:load_nba_depthcharts()(espn_nba_depthcharts, daily ESPN depth-chart snapshots, 2027 on) andload_nba_current_impact()(nba_current_impact, weekly as-of player impact ratings, 2007 on). A file missing inside a published season (no playoffs file yet) is skipped quietly; a season with no file at all warns.
ESPN
ESPN wrappers no longer return an empty frame when parsing raises a harmless warning. Their
tryCatch(warning =)handlers unwound the whole parse, so adata.frame()“row names were found from a short variable” warning madeespn_nba_team_current_roster()return a 0 x 0 tibble; the warning is now re-raised naming the function and parsing carries on, across all 126 ESPN call sites (see “Warnings and errors from wrappers” above).espn_nba_game_team_roster()/espn_mbb_game_team_roster()(and theathlete_ids they feed) read the roster ESPN now serves inline asentries; they read only the old paginateditemsand always returned 0 rows.espn_nba_game_propbets()/espn_mbb_game_propbets()read ESPN’s prices, now nested as{value, open}; coercing that list errored and every call returned 0 rows.fox_nba_odds()/fox_mbb_odds()find the odds six-pack, which Fox now nests as a module undersectionList; they always returned 0 rows.The
espn_mbb_game_play()/espn_mbb_game_play_personnel()examples pass the 18-digit play id as a string: as a number it was rounded and 404ed. Theibba_leaders()example quotesstat_type = "pts".espn_nba_pbp(),espn_mbb_pbp(), thePlaysframe ofespn_nba_game_all()/espn_mbb_game_all(), andhelper_espn_nba_pbp()/helper_espn_mbb_pbp()now rebuildhome_score/away_scorefrom the scoring plays (in ESPN’s order, a made free throw shipped withscoreValue0 counting 1) and keep the rebuild only when its last row equals the official final; otherwise ESPN’s per-play scores are kept. A new last column,score_source("rebuilt"/"espn"), says which. This repairs plays keyed late (ESPN’s score ran backwards and could end short of the final), NBA 2013-2019 free throws, and college neutral-site games whose scores were stored on the wrong side. Mirrors sportsdataverse/sportsdataverse-py#830;load_nba_pbp()/load_mbb_pbp()carry the column once a season is republished.helper_espn_nba_pbp()/helper_espn_mbb_pbp(), which the R creation scripts ofhoopR-nba-data/hoopR-mbb-datarun on sportsdataverse-py’s processedjson/finalpayloads, no longer fail with “Names must be unique” on a payload whose plays already carrycoordinate.x.raw/coordinate.y.raw(sportsdataverse-py#844 and later). Such a payload is already transformed, so its coordinates are kept as they are; any other payload is transformed exactly as before, except that the transformed pair now puts every free throw on the line, matched case-insensitively: the college “MadeFreeThrow” type (made or missed) was transformed from ESPN’s (25, 0) (coordinate_x= +/-41.75) and now readscoordinate_x= +/-28,coordinate_y= 0, as in sportsdataverse-py; its raw pair still keeps ESPN’s (25, 0). A “MadeFreeThrow” row carrying ESPN’s “no location” sentinel (about -2.1e8) also lands at +/-28 on the transformed pair; its raw pair keeps the sentinel.espn_nba_pbp()/espn_mbb_pbp()share the helper. Seasons already published byload_mbb_pbp()(hoopR-mbb-data) keep “MadeFreeThrow”coordinate_xat +/-41.75 until they are republished; new processing gives +/-28.espn_mbb_pbp()/espn_nba_pbp(), thePlaysframe ofespn_{mbb,nba}_game_all()andhelper_espn_{mbb,nba}_pbp()add the clock, period and timeout columns theload_{mbb,nba}_pbp()releases carry:game_play_number,time,clock_minutes/clock_seconds,home_timeout_called/away_timeout_called,half(and NBAqtr,game_half,period), thelag_/lead_period and half columns, andstart_/end_seconds remaining in the period (NBA: quarter and half) and game, a period’s last play ending at 0:00. Values equal sportsdataverse-py’s row for row on seven real games. The pickcenter line columns (game_spread,home_favorite, …),*_team_name_altandathlete_name_1..3stay release-only.espn_mbb_team_roster()/espn_nba_team_roster()for a past season now build the roster from that season’s published player box scores (load_mbb_player_box()/load_nba_player_box()). When that season’s box scores cannot be read (none published, or no network) they warn and return an empty roster, like the other ESPN wrappers, instead of today’s roster or an error. ESPN’s roster endpoint ignores?season=, so a past season used to return today’s roster under the past season’s label, which also fedmbb_player_crosswalk()/nba_player_crosswalk(). Mirrors sportsdataverse/sportsdataverse-py#782.
NBA Stats, CDN and G League
nbagl_live_pbp()andnbagl_live_boxscore()returned nothing on every call. They sent no browser headers, and cdn-gleague.nba.com answered with a 403 “Access Denied” page. The NBA CDN wrappers (nba_live_pbp(),nba_live_boxscore(),nba_todays_scoreboard(),nba_schedule()and the two G League ones) now share one header set, which adds Chrome’s client hints and fetch metadata (verified on Windows R; Linux and macOS libcurl builds are unverified). The old set only worked over HTTP/2. Over HTTP/1.1, which is all cdn-gleague.nba.com speaks, cdn.nba.com answered it with the same 403 and cdn-gleague.nba.com with its home page. New offline tests parse captured payloads from both hosts. The live tests fornba_live_pbp(),nba_live_boxscore()andnba_todays_scoreboard()used to skip when the call came back empty, so a refused request passed as a skip. They fail now; the scoreboard test still skips when the feed lists no games.nba_schedule()returned the NBA schedule for everyleague_id."20"readscheduleLeagueV2_2.jsonon cdn.nba.com, which is a second copy of the NBA’s (leagueId“00”), and"10"read the NBA file itself. Each league now comes from its own CDN host:"10"from cdn.wnba.com,"20"from cdn-gleague.nba.com. A payload for another league is reported and returnsNULL, and any otherleague_idis an argument error.season_type_descriptionlabels a5game “Play-In Game” only for the NBA; the WNBA (Commissioner’s Cup final) and the G League use that digit for other events and getNA.nba_todays_scoreboard()printed an “Invalid arguments” error aboutunneston a day without games. It now returns an empty result quietly; a payload with no games list at all is still reported.nba_data_pbp()returned nothing on every call. data.nba.com answered a request without browser headers with a 403 “Access Denied” page, and the parser failed on the empty shell it serves for 2025-26 games. It now sends the CDN header set. data.nba.com has play-by-play for 2016-17 through 2024-25; a later game returns an empty result with a message.nba_data_pbp()and the six CDN wrappers no longer discard their result when a warning is raised while parsing: an emptywarninghandler in theirtryCatch()abandoned the parse at the first warning. The warning now reaches the caller along with the data.nba_leaguedashplayerptshot()andnba_leaguedashteamptshot()now sendshot_dist_rangeasShotDistRange; the argument was accepted but never sent, so every call returned unfiltered shots. The four hustle wrappers (nba_leaguehustlestatsplayer(),nba_leaguehustlestatsplayerleaders(),nba_leaguehustlestatsteam(),nba_leaguehustlestatsteamleaders()) never sentlast_n_gameseither, and those stats.nba.com endpoints have noLastNGamesfilter, so the argument is now deprecated and warns when supplied.nba_videoeventsasset()is no longer deprecated: the endpoint serves clips for a realgame_event_id(the default0matches no play), and the video envelope is now parsed into itsMetaandplaylisttables instead of two empty frames.nba_gamerotation()works again: stats.nba.com rejected its parameter order and a duplicatedAccept-Encodingheader (#190).nba_pbp(version = "v2")no longer errors when a player is substituted on and off at the same clock time; the on-court columns read the right event column (#186, #210).
College basketball (CBD, NCAA, Torvik, crosswalks)
New
load_mbb_ncaa_espn_team_crosswalk(),load_mbb_ncaa_espn_schools()andload_mbb_ncaa_espn_school_seasons()read the static (all-seasons) stats.ncaa.org to ESPN tables on thembb_crosswalkrelease: one row per season and stats.ncaa.org team id (2009-10 on, the table sportsdataverse-py’sncaa_espn_team_crosswalk(league = "mbb")returns), one per NCAA school, and one per school, sport and season. stats.ncaa.org mints a new team id every season, so this is the join from theload_ncaa_mbb_*()tables to the ESPN-basedload_mbb_*()tables. ESPN ids come back integer; the NCAA ids stay integer as published. wehoop ships the WBB twins (load_wbb_ncaa_espn_*()).load_mbb_player_crosswalk()accepts seasons from 2004 (it started at 2025), now that thembb_crosswalkrelease carries the 2004-2024 player crosswalks. The MBB schedule and player crosswalks gain stats.ncaa.org ids,ncaa_contest_id(after the other providers’ game ids) andncaa_player_id(afterkp_player_id), soload_ncaa_mbb_*()rows join to the ESPN ids through them. Both stay character, like thecontest_id/player_idof theload_ncaa_mbb_*()loaders. The two loaders’ help pages now list their columns.mbb_schedule_crosswalk(include_kenpom = TRUE)no longer aborts on KenPom’s numericgame_date(20201128): the date now parses asYYYYMMDD, and each team’s KenPom schedule is fetched inside its own error handler.Added
cbbd_teams_directory()(CBD/teams/directory, upstream v1.29.0): the season’s full team directory, as a named list ofteamsandconferences.Added
cbbd_teams_season_overview()(CBD/teams/{teamId}/season/{season}/overview, upstream v1.29.0): a stored full-season team overview, as a named list ofteam,record,ratings,efficiency,shooting,players,scheduleandsourcestibbles.Added
cbbd_ratings_history()(CBD/ratings/history, upstream v1.32.0): daily snapshots of each team’s adjusted efficiency and SRS ratings, with the day’s national ranks and the 1-, 7- and 30-day change in net rating. Give adate, ateamor both. The endpoint needs a Patreon Tier 2 key for the current season and Tier 3 for earlier ones.Added
cbbd_api_key_info()(CBD/info, upstream v1.32.0): one row with your key’s tier, monthly allowance (shared with CollegeFootballData), calls used and left, and next reset. The request costs no calls.ncaa_mbb_NET_rankings()failed on every call with “invalid first argument” and returned an empty tibble: it recorded its arguments withmget(setdiff(names(formals()), "...")), and for a function with no arguments current R returnsNULLfrom thatsetdiff(), whichmget()rejects. It records none now. A new offline test runs the parser on a two-row NET table built inline; the live test stays skipped.-
mbb_team_crosswalk()now reads every source as of the requested season, matching the sportsdataverse-py builder (sportsdataverse-py #604 / #605) thathoopR-mbb-dataruns by default:-
espn_conferenceis the conference each team was in that season, under that season’s name, from thembb_groupsrelease. It used to be today’s ESPN name (the 2025 WAC read “United Athletic Conference”). The ESPN Core v2 group walk is gone. -
fox_sectioncomes from Fox’sleague/standings?groupId=&season=for that season (2017-18 on; earlier seasons getNA), not today’s standings. Fox lists teams under the conference they join the next season, sofox_sectionisNAwhere it disagrees withespn_conference, or where fewer than two teams that stay put the next season confirm the Fox conference.fox_team_idis kept. - A blocked (403) or empty Torvik response now raises an error of class
crosswalk_source_errorinstead of writing an all-NAbart_conf. Seasons before 2008 skip Torvik, which starts there. - A season missing from
teams_linksgetsNAkp_*instead of the newest season’s KenPom conferences. - Any failed source (ESPN, Fox, Torvik, or the conference reference) now raises instead of being reported and returned as an empty tibble.
-
torvik_ratings()returned an empty tibble for every season from 2008 to 2021: those files quote one header,fread()warns while fixing it, and the warning discarded the season. That warning is no longer fatal.torvik_player_stats()returned columns namedv1,v2, … instead ofplayer_name,team,o_rtgand the rest. barttorvik’s player csv now has 78 fields: 11 undocumented ones follow the 67 that hoopR names. The 67 keep their names, and the new fields come back asv68tov78. The live Torvik tests now run only withTORVIK_TESTS=1.The KenPom team-page functions (
kp_team_schedule(),kp_gameplan(),kp_opptracker(),kp_team_players(),kp_minutes_matrix(),kp_team_player_stats(),kp_team_depth_chart(),kp_team_lineups()) andkp_team_history()returned nothing for seasons after the last one inteams_links(2026). They now build the KenPom page link from the team name, so the current season works. Theteams_linksdocumentation now describes its team-season rows.teams_linksadds the 2026-27 season (Year2027): 365 teams in 32 conferences, with that season’s realignment (for example the rebuilt Pac-12 and the WAC teams in the UAC). It now covers 2002-2027, 9,044 rows.data-raw/pull_team_links.Rnow adds only the missing seasons (or rebuilds a range you pass it) and logs in with the current httr2login().mbb_team_crosswalk()adds six name columns from sources it does not fetch:ncaa_team,espn_pbp_name,warren_nolan_team,team_247,sref_slug(the Sports-Reference URL slug) andsref_team. They come from the new bundled tablembb_team_names(368 teams, keyed onespn_team_id), whichdata-raw/mbb_team_names.Rbuilds fromdata-raw/dict_hoopR.csv. The names are as the 2023 source recorded them (some predate a rename) and are the same for every season; an unknown name isNA. The duplicatedata-raw/dict_test.csvis gone.The crosswalk’s Torvik and KenPom alias tables add 11 older names from the dict (for example
IUPUI,Houston Baptist,Dixie St.,New Orleans; KenPom also gets itsTexas A&M Commercespelling) and dropSt. Thomas->St. Thomas-Minnesota, which matched nothing since ESPN renamed the team; the Fox alias with the same stale target is gone too. Against the 2026 ESPN directory, 361 of 362 teams now join Torvik and KenPom (359 before); only West Florida, new to Division I in 2026-27, does not. Older KenPom seasons gain 2 to 8 teams each.
NBA officiating (nba_l2m, nba_l2m_games, nba_referee_assignments)
New scrapers for official.nba.com officiating data, parity-tested against sportsdataverse-py’s sportsdataverse.nba.nba_officiating on the same captured fixtures: nba_l2m() (Last Two Minute report calls/game/stats), nba_l2m_games() (a season’s L2M game index), and nba_referee_assignments() (NBA/G-League/WNBA referee crew assignments + replay center officials for a date). Port of the scraping logic in atlhawksfanatic/L2M (MIT). Every returned table (calls/game/stats, listing, officials/replay_center) shares its column names and types with a typed prototype tibble, which is what the empty path returns, so dplyr::bind_rows() across calls (e.g. looping dates) always works; id columns (team/official/pos_id/pos_team_id) are integer. HTTP and payload failures (a 404, a blocked fetch, a 200 whose body is not the expected report) raise classed conditions (hoopR_no_data / hoopR_fetch_error, both inheriting hoopR_error) instead of returning an empty result, mirroring sportsdataverse-py’s NoDataError/AssetFetchError vocabulary.
Release loaders: season floors, play ids, join ids
- Every
load_mbb_*()/load_nba_*()/load_*_crosswalk()loader now accepts exactly the seasons its sportsdataverse-data release tag publishes, and its error lists them.load_mbb_pbp()accepts the published 2003 season (it stopped at 2006) and, likeload_mbb_shots(), rejects the unpublished 2004-2005.load_mbb_rosters(),load_nba_rosters()start at 2025,load_mbb_player_crosswalk()at 2004,load_mbb_player_stats()andload_mbb_officials()at 2003,load_mbb_team_stats()andload_mbb_standings()at 2003,load_mbb_schedule_crosswalk()at 2008, andload_mbb_game_rosters()takes 2002 onward; before,seasons = TRUEasked for every missing season and warned once per season.load_nba_team_box(),load_nba_player_box(),load_nba_schedule(),load_nba_player_stats()andload_nba_player_core()now reach back to the published 1994 season. The MBB crosswalks are capped atmost_recent_mbb_season()instead of the NBA season. -
load_mbb_pbp()/load_nba_pbp()return the playidas an exact character string, likeespn_mbb_pbp()/espn_nba_pbp(). The.rdsasset stores it as a double, which cannot hold the 18-digit MBB ids (about 41% of the 2025 ids collided), so the loaders read the.parquetasset when arrow is installed and warn when they fall back to the.rds.helper_espn_{mbb,nba}_pbp()also keep the id exact on sportsdataverse-py’s processed payloads, where it is a JSON number. Database tables built byupdate_{mbb,nba}_db()before this change hold the rounded ids in a numeric column; rebuild them (force_rebuild = TRUE) to get exact ids. - ESPN join ids are integer in every loader:
game_idfromload_{mbb,nba}_game_rosters(),athlete_idfromload_{mbb,nba}_rosters(),espn_game_id/espn_athlete_idfrom the crosswalk loaders and the*espn_game_id/*espn_team_idcolumns ofload_ncaa_mbb_*()were character, so joins to the box scores and schedules failed. - The NBA Stats ids of
load_nba_team_crosswalk()(nba_team_id),load_nba_schedule_crosswalk()(nba_home_team_id/nba_away_team_id) andload_nba_player_crosswalk()(nba_player_id) are integer, as in theload_nba_stats_*()loaders; they were character, so a join to those loaders needed a cast.nba_game_idkeeps its leading zeros ("0022300001") as character. The live builders (nba_team_crosswalk()and friends) still return character NBA Stats ids. -
load_nba_stats_metric_curves()andload_nba_stats_rolling_windows()returnentity_idandteam_idas integer stats.nba.com ids, as sportsdataverse-py does; the release files publish them as character, so they did not join the other NBA Stats loaders without a cast. Both loaders are new in 3.2.0. The shared id cast now turns a value that is not a whole number ("1.5") intoNAwith a warning instead of truncating it. - Every
load_*()release loader’s help page names its release tag on sportsdataverse-data in a Source section, with the repository that publishes it. -
espn_mbb_pbp()/espn_nba_pbp()put the light logo inhome_team_logowhen ESPN lists the away team first; they used to put the dark one there. -
tail()works on the result of every loader. The group, model, NBA Stats and NCAA MBB loaders andload_mbb_shots()/load_nba_shots()still gave their tibble adata.tableclass, sotail()failed with “Can’t subset columns past the end” (#88). They now return the samehoopR_data/tbl_df/data.frameclass as the other loaders. - A slow release download no longer drops a season from a multi-season load. The
.rdsand.parquetreaders behind every release-backedload_*()loader raise the download timeout to at least 150 seconds (a largeroptions(timeout)is kept, and the option is restored afterwards) and retry a failed download twice. A 404 is not retried. If a file still fails, the warning names its URL and says the result is incomplete; the seasons that loaded are still returned. The games-index csv files behindupdate_mbb_db()andupdate_nba_db()are now read the same way. -
update_mbb_db(force_rebuild = TRUE)/update_nba_db(force_rebuild = TRUE)no longer lose seasons when the games index reads only partly. The index decides which seasons are rebuilt after the table is dropped, butdata.table::fread()can stop early on a malformed row and return the rows before it with only a warning, and withoptions(download.file.method = "curl")it fetched the url through curl, which ignores R’stimeoutand saves an HTTP 503 error page as the csv. The index is now downloaded with libcurl to a temporary file and read from there, afread()warning on it is an error (not retried: the file is the same on every try), and the rebuild stops with an error naming the index url before anything is dropped, leaving the table unchanged.
Dependencies
- ggplot2 is no longer in Suggests: no function, example or test uses it. It moved to
Config/Needs/website, for the articles that plot. -
update_mbb_db()/update_nba_db()read the stored game ids with a plain DBI query: on an existing table they calleddplyr::tbl(), which needs dbplyr, a package hoopR does not declare. - data.table must now be 1.15.0 or later (was 1.14.0): the release csv reads pass the url as
fread(file =), which downloads urls only from 1.15.0 on. - Imports trimmed so
R CMD checkno longer notes too many non-default packages. glmnet and Matrix moved to Suggests:nba_rapm()now needs them installed (it says so with an install prompt if they are missing). stringdist moved to Suggests: the live player-crosswalk buildersnba_player_crosswalk()andmbb_player_crosswalk()now need it; the cachedload_*_crosswalk()loaders do not. magrittr and lubridate are no longer dependencies (%>%still comes from dplyr; date parsing now uses base R with the same results). - Rcpp and RcppParallel are no longer dependencies (hoopR has no compiled code), and the unused Suggests furrr, future, ggrepel, rmarkdown and yaml are gone.
- withr is a new import, and xml2 moved from Suggests to Imports (several parsers call it directly). digest is a new Suggests, needed only by the CBA wrappers.
- Minimum versions raised: cli (>= 3.0.0), httr2 (>= 1.0.4), rlang (>= 1.0.0) and, for the tests, testthat (>= 3.1.9).
- tibble and glue moved from Suggests to Imports: the ESPN parsers and the NBA schedule code call them on normal code paths (both already arrive with dplyr, so nothing new is installed). arrow stays in Suggests; the parquet loaders now warn that arrow is needed and return an empty table when it is missing, instead of a misleading “Failed to read_parquet”.
-
ByteCompile: false: the package is no longer byte-compiled at install. The compiled code doubled the installedR/directory (4.2 MB, 1.7 MB without it); R’s JIT compiler still compiles each function the first time it is called, so only that first call is slower. Lazy data is now xz-compressed (LazyDataCompression: xz).
Documentation
- The package now ships its
CITATIONfile, socitation("hoopR")gives the curated entry with the CRAN DOI. - Examples that call stats.nba.com, Basketball-Reference or KenPom run only in interactive sessions; those hosts refuse requests from most servers.
- New article, “NBA Stats API Parameter Descriptions”, and dataset
parameter_descriptions: each query parameter thenba_*()stats.nba.com wrappers send, with its API name, description, accepted values, default and the functions that take it (#248). - New dataset
return_columnsand article “Return Columns”: one row per column of every data frame 981 hoopR functions return (function, list element, column name, type and description), searchable on the site;subset(return_columns, fn == "nba_pbp")gives one function’s columns in R. The NBA and men’s college basketball functions (load_nba_*,load_mbb_*,espn_nba_*,espn_mbb_*,nba_*) keep their column tables in the help page; the other 647 functions (the international families,cbbd_*,fox_*,kp_*,torvik_*,realgm_*,ncaa_mbb_*,nbagl_*,bref_*,euroleague_*) now say what one row is and point to the dataset and the article. Together withByteCompile: falsethis brings the installed size to about 6.5 MB (R 1.7 MB, help 3.9 MB). An install that keeps the source references (R_KEEP_PKG_SOURCE=yes, as on GitHub Actions) is about 8.4 MB, becauseR/then holds them too (3.6 MB). - The
mbb_schedule_crosswalk()andmbb_player_crosswalk()examples run only in interactive sessions: each builds a whole season from several sources (the player crosswalk fetches every team’s roster) and took 1.5 to 2.5 minutes. Thecbbd_plays_date()andcbbd_plays_tournament()examples now ask for one championship-game date and the eight-game 2024 CIT instead of a full slate and the NCAA tournament. - Faster examples:
cba_pbp()asks for one quarter,sportpress_player_rankings()for the top 5 per category andfox_mbb_teams_all()for 3 seed calls. These run only in interactive sessions:lkl_results()(it pages through a whole season),mbb_team_crosswalk()(one Fox request per conference, plus ESPN and Torvik), theespn_*_game_rosters()examples (one request per athlete), theespn_*_pbp(),espn_*_team_box()andespn_*_player_box()examples (the same summary request asespn_*_game_all();espn_nba_game_all()still runs), and the release loaders whose one-season file is 7-80 MB (load_mbb_pbp(),load_mbb_player_box(),load_mbb_shots(),load_nba_stats_pbp(), and the NCAA MBB pbp, shots, lineups, matchup-stints, possessions and player-box loaders).espn_mbb_teams(),torvik_game_schedule(),torvik_game_stats(),espn_mbb_powerindex(),atrium_player_stats(),espn_mbb_game_all(),aba_box_players(),aba_box_teams(),aba_calendar(),aba_game(),aba_pbp()and 15 of the 17load_nba_stats_*()loaders on?load_nba_stats_coachesalso run their examples only interactively (load_nba_stats_coaches()andload_nba_stats_draft()still run). - The help pages of the 22 largest function families (ESPN MBB and NBA, and most international families) link to one family index page (
?family_espn_mbb,?family_acb, …) in “See also” instead of listing every other member. The lists repeated each family on every page and were 1.2 MB of the installed help. - The column tables of 20 release loaders now match the files the releases publish (checked against the 2026 season, and 2025 to rule out one-season quirks), with the missing columns added, the ones no longer published removed and the types corrected:
load_nba_pbp(),load_mbb_pbp()(halfand thelag_/lead_period and half columns in place ofqtr,game_halfand their lags, noperiodbesidesperiod_number, andathlete_id_1/athlete_id_2in place ofparticipants_*_athlete_id),load_nba_schedule(),load_mbb_schedule(),load_nba_team_box(),load_mbb_team_box()(separate made / attempted counts andopponent_team_*columns),load_nba_player_impact()(theboban_*columns in place ofdarko_*, plus the_n/_rank/_pctand REML columns),load_mbb_ratings(),load_mbb_player_value(),load_nba_stats_possessions(),load_nba_stats_player_boxscores(),load_nba_stats_team_boxscores(),load_nba_stats_game_rosters(),load_nba_stats_officials(),load_nba_stats_shots()(season_type_id), and the types of the counts inload_nba_stats_matchups(),load_nba_stats_matchups_rollup(),load_nba_stats_hustle_player(),load_nba_stats_hustle_team()andload_nba_stats_synergy()(numeric, not integer). -
spotrac_team_cap()’s return columns follow the table Spotrac now serves (total_cap,cap_space,cap_status,active_cap,dead_cap,cap_holds,top_3,players,age);total_cap_allocationsandcap_space_allare gone. - The DESCRIPTION explains NBA, ESPN, NCAA, FIBA, ACB, VTB, NBL, KBL and CBA on first use, and the help pages use ASCII punctuation (
-,x) in place of em dashes, en dashes and multiplication signs.
Tests
- Offline replay tests for the ESPN, Fox, international, CollegeBasketballData, Torvik and salary / mock-draft wrappers: each call’s HTTP responses are recorded once (
data-raw/http_fixtures/record_fixtures.R, arrays trimmed to five items) and replayed through httr2 mocks, so the wrappers run on CI with no network. The fixtures are.Rbuildignored; the tests skip without them. The recorder never requests stats.nba.com, stats.ncaa.org, Sports Reference or KenPom. Also new: mocked tests of the play-by-play database builders. - Offline replay tests for the stats.nba.com wrappers in the box-score (V2 and V3), league-dashboard, leaders and play-by-play families, one call per wrapper: 36 assert each parsed data frame’s rows, column names and classes, 2 assert the empty result of a retired endpoint that now answers
{}, and 9 assert that a defunct wrapper still signals its error. The responses were recorded once from a residential connection bydata-raw/http_fixtures/record_nba_stats.R, which paces itself (env-tunableSTATS_RATE_HITS/STATS_RATE_WINDOW/STATS_RATE_MAX), stops at the first 403 or 429 and resumes where it stopped; CI and CRAN never contact stats.nba.com. The fixtures (tests/testthat/fixtures/nba_stats/, 55 KB) are.Rbuildignored like the others. - The internal
clean_team_names_NCAA_merge()errored on every call (it used.data$inside a data.table[); it now maps the names.
hoopR 3.1.0
CRAN release: 2026-08-25
Released to CRAN on 2026-08-25, on top of 3.0.0. Headline change is a 58-wrapper ESPN endpoint expansion that brings hoopR’s ESPN coverage to parity with wehoop — athlete coverage, team detail, event detail, league catalog, news, calendar, injuries, plus draft / freeagents / transactions for the NBA. Also includes bug fixes for endpoint behavior that drifted after CRAN submission, the package-wide @return documentation upgrade, and a proxy-support restoration that addresses a regression introduced by the 3.0.0 httr → httr2 migration.
NBA cross-source crosswalks (nba_*_crosswalk + load_nba_*_crosswalk)
New convenience functions that link team / schedule / player identities across ESPN, the NBA Stats API, and Fox Sports on a shared espn_team_id key: nba_team_crosswalk(), nba_schedule_crosswalk() (joins on the local Eastern-Time game date), and nba_player_crosswalk() (ESPN-anchored deterministic fuzzy matching), each paired with a load_nba_*_crosswalk() cached loader. Adds fox_nba_teams() / fox_mbb_teams() deriving the Fox team directory from the standings endpoint. A shared internal .bb_* matching engine (R/crosswalk_basketball.R) backs the builders.
MBB cross-source crosswalks (mbb_*_crosswalk + load_mbb_*_crosswalk)
New convenience functions that link team / schedule / player identities across ESPN, KenPom (teams_links bundled data — no auth required), Bart Torvik (barttorvik.com), and Fox Sports on a shared espn_team_id key: mbb_team_crosswalk(), mbb_schedule_crosswalk() (joins on ET game date via Torvik’s game schedule), and mbb_player_crosswalk() (ESPN-anchored deterministic fuzzy matching vs. Fox), each paired with a load_mbb_*_crosswalk() cached loader. Torvik and KenPom team names are bridged to ESPN via curated alias tables (.mbb_bart_alias, .mbb_kp_alias) and a .bb_normalize_college_team() contracting normalizer (expands State/Saint abbreviations). Fox names are bridged via .mbb_fox_display_alias. Adds fox_mbb_teams_all() to enumerate the full MBB Fox Bifrost team directory (conference-seed walking). Backed by the shared .bb_* engine in R/crosswalk_basketball.R.
Fox Sports basketball wrappers (fox_nba_* / fox_mbb_*)
Read-only Fox Sports “Bifrost” basketball wrappers over api.foxsports.com/bifrost/v1/{nba,cbk}/*, complementing the espn_nba_* / espn_mbb_* families. Eight wrappers per league flatten Fox’s layout-oriented JSON (sections → tables → rows → cells) into tidy hoopR_data tibbles: fox_<lg>_pbp (period-based play-by-play), _boxscore, _odds, _team_roster, _team_stats, _team_gamelog, _standings, _league_leaders. A shared internal layer backs both leagues. Parallels the cfbfastR / sportsdataverse-py fox_* families.
CollegeBasketballData API (cbbd_*)
New cbbd_*() function family wrapping the CollegeBasketballData API (the men’s college basketball sibling of CollegeFootballData, which cfbfastR wraps with cfbd_*). 38 endpoint wrappers cover the full v1 surface across 13 categories:
-
Games:
cbbd_games(),cbbd_games_media(),cbbd_games_teams(),cbbd_games_players(),cbbd_scoreboard() -
Plays:
cbbd_plays_game(),cbbd_plays_player(),cbbd_plays_team(),cbbd_plays_date(),cbbd_plays_tournament(),cbbd_play_types() -
Substitutions:
cbbd_substitutions_game(),cbbd_substitutions_player(),cbbd_substitutions_team() -
Stats:
cbbd_stats_team_season(),cbbd_stats_team_leaderboard(),cbbd_stats_team_shooting_season(),cbbd_stats_player_season(),cbbd_stats_player_shooting_season() -
Lineups:
cbbd_lineups_team(),cbbd_lineups_game() -
Ratings:
cbbd_ratings_srs(),cbbd_ratings_adjusted(),cbbd_ratings_elo() -
Rankings:
cbbd_rankings() -
Lines:
cbbd_lines(),cbbd_lines_providers() -
Recruiting:
cbbd_recruiting_players(),cbbd_recruiting_teams(),cbbd_recruiting_portal() -
Draft:
cbbd_draft_teams(),cbbd_draft_positions(),cbbd_draft_picks() -
Teams / Venues / Conferences:
cbbd_teams(),cbbd_teams_roster(),cbbd_venues(),cbbd_conferences(),cbbd_conferences_history()
The API requires a free Bearer-token key stored in the CBBD_API_KEY environment variable; see ?register_cbbd. Helpers cbbd_key(), has_cbbd_key() and check_cbbd_key() mirror the cfbfastR key pattern. Every wrapper returns a hoopR_data tibble with a 3-column @return table, routes through hoopR’s shared httr2 request layer (retries / timeouts / proxy), and reports errors via the standard cli reporters.
Bart Torvik / T-Rank (torvik_*)
New torvik_*() function family pulling publicly available men’s college basketball data directly from barttorvik.com — no account or API key required (analogous to how kp_* scrapes KenPom). These wrap the auth-free, self-describing data files (the interactive .php pages behind barttorvik’s JavaScript browser check are intentionally avoided):
-
torvik_ratings()— year-end / current T-Rank team ratings: adjusted offensive/defensive efficiency,barthag, projected record, SOS, wins above bubble, adjusted tempo ({year}_team_results.csv). -
torvik_team_factors()— team four factors and shooting splits: eFG%, TOV%, OREB%/DREB%, FT rate, 2P/3P/FT splits and assist rates, each with its national rank ({year}_fffinal.csv). -
torvik_game_schedule()— full game-by-game schedule and results with pre-game predictions and post-game quality metrics ({year}_super_sked.json). -
torvik_ncaa_results()— historical NCAA tournament performance by team, coach, conference or seed, including PASE / PAKE and round-by-round counts (cgi-bin/ncaat.cgi). -
torvik_player_stats()— every player’s advanced season stat line: offensive rating, usage, shooting splits, rebounding/assist/turnover rates, box plus/minus and per-game box averages (getadvstats.php). -
torvik_game_stats()— per-team-game stats: adjusted and raw offensive/defensive efficiency, four factors on both ends, tempo, result and pre-game win probability (getgamestats.php).
Requests route through hoopR’s shared .retry_request() layer with a browser User-Agent; every wrapper returns a hoopR_data tibble with a 3-column @return table and reports errors via the standard cli reporters. (Note: the cbbdata/api.cbbdata.com service that previously brokered Torvik data is defunct, so these wrap barttorvik.com directly.)
Basketball-Reference (bref_*)
New bref_*() function family scraping publicly available NBA data from Basketball-Reference — a source hoopR previously did not cover at all (no account or API key required):
-
bref_players_stats()— league-wide player season stats; pick the table withtable = "per_game"/"totals"/"advanced"/"per_minute"/"per_poss". -
bref_teams_stats()— team season stats (per_game,totals,per_poss,advanced,opponent). -
bref_standings()— end-of-season conference standings with SRS and a playoff flag. -
bref_draft()— draft results paired with each pick’s career totals and advanced metrics. -
bref_awards()— end-of-season award voting (MVP, ROY, DPOY, SMOY, MIP, Clutch POY, COY) in one tidy tibble. -
bref_team_roster()— a team’s season roster. -
bref_player_game_log()— a player’s game-by-game log for a season (by Basketball-Reference player-id slug, e.g.jokicni01). -
bref_player_bios()— the player index for a starting letter (career span, position, height/weight, birth date, college) plus each player’s Basketball-Reference id slug — a ready-made player dictionary. -
bref_injuries()— the current Basketball-Reference NBA injury report.
Two Sports-Reference quirks are handled centrally: secondary tables hidden in HTML comments are un-commented, and columns are read from each cell’s data-stat attribute (so the multi-row “over-headers” don’t mangle column names). Routes through hoopR’s shared .retry_request() with a browser User-Agent. Basketball-Reference rate-limits aggressive scraping (~20 requests/minute) — space repeated calls with Sys.sleep(). Tests are gated behind BREF_TESTS=1. No new dependencies (rvest already in Imports).
Salary & mock-draft sources (Spotrac / HoopsHype / NBADraft.net)
New wrappers for third-party NBA salary and mock-draft sites, all public HTML, no key required:
spotrac_team_cap()— team salary-cap allocations, cap space, active players and average age from Spotrac (spotrac.com).hoopshype_salaries()— the full league’s player salaries (one row per player-season, current + future contract years) from HoopsHype (hoopshype.com). HoopsHype is now a Next.js app whose single salaries page paginates client-side, but each team page embeds that team’s complete roster in its__NEXT_DATA__payload — so this iterates the 30 team pages and stitches them together (~600 players) via a team-by-team approach.nbadraft_mock_draft()— the current consensus mock draft (both rounds) from NBADraft.net.
Basketball Insiders was evaluated but not wrapped: its old salary-widget backend (hw-files.com) is offline, and the surviving page only exposes a team-cap summary redundant with spotrac_team_cap(). For league-wide player salaries, espn_nba_player_contracts() remains the most complete source.
RealGM (realgm_*) — Cloudflare-challenge bypass via headless Chrome
RealGM (basketball.realgm.com) sits behind a Cloudflare JavaScript challenge (cf-mitigated: challenge) that returns HTTP 403 to every libcurl-based client (httr2, httr, rvest) regardless of headers — Cloudflare fingerprints the TLS handshake (JA3) and demands a JavaScript proof-of-work to mint the cf_clearance cookie. An earlier source audit recorded RealGM as dead on that basis. It is not dead — it is reachable with a real browser engine, and 17 realgm_*() wrappers now cover the NBA endpoint surface:
Players & personnel
-
realgm_players()— active NBA player index (position, ht/wt, age, current team, years of service, pre-draft team / international club, nationality). -
realgm_players_abroad()— NBA-affiliated players on international rosters, with NBA-rights status (a view no first-party feed provides). -
realgm_future_free_agents()— projected free-agent classes with Bird / veteran status, production, and the player’s listed agent. -
realgm_coaches()/realgm_gms()— current head coaches / general managers with tenure and nationality.
Standings, teams & stats
-
realgm_standings()— both conferences with record, streak, splits. -
realgm_teams()— team index with division and conference. -
realgm_player_stats(season, stat_type, season_type)— qualified-player leaderboards (Averages / Totals / Per-X / Advanced / Misc, across Regular Season / Playoffs / Preseason / Summer League). -
realgm_team_stats(season, stat_type, season_type)— team statistics. -
realgm_individual_seasons()/realgm_individual_games()— all-time best individual season / single-game leaderboards.
Draft & salary
-
realgm_draft(year)— past-draft results (rounds 1–2 + undrafted), with pre-draft team and nationality. -
realgm_draft_prospects()— current draft-prospect statistics. -
realgm_early_entry()— early-entrant / withdrawal list. -
realgm_salary_cap()— salary-cap history & projections (cap, tax, aprons, exceptions). -
realgm_rookie_scale()— rookie-scale contract amounts by pick.
Transactions
-
realgm_transactions()— the league transactions log (RealGM publishes it as a dated narrative, not a table, so this parses the page DOM into one row per transaction with a realDate).
Self-describing returns carry their query parameters back as columns (realgm_player_stats()/realgm_team_stats() echo season/stat_type/ season_type; realgm_draft() echoes draft_year and a round label). Every wrapper drives headless Chrome through the optional chromote package (Chrome solves the challenge natively in ~2 seconds). chromote + Google Chrome are therefore a Suggests-level requirement for the realgm_* family only; every other hoopR source still works with the standard HTTP stack.
NBA injury reports (rotowire_injuries() / bref_injuries())
RotoWorld (rotoworld.com) was a long-standing NBA injuries source, but NBC has since shut it down (it now 301-redirects to nbcsports.com/fantasy; the injuries tool is gone). Two live replacements:
-
rotowire_injuries()— the current NBA injury report from RotoWire (a separate, live company). RotoWire renders the grid client-side from a JSON table endpoint, so this reads that JSON directly (player, team, position, injury, status, RotoWire player URL). The projected return date is subscriber-only and comes back asNA. -
bref_injuries()— a second source, the Basketball-Reference injury report (see above).
Basketball analytics utilities (nba_*, no network)
A set of pure, vectorized basketball-math helpers — standard efficiency / rating / four-factor calculators. All return NA (not Inf/NaN) on a zero denominator and are league-agnostic (NBA / WNBA / college box scores):
- Shooting:
nba_true_shooting_pct(),nba_effective_fg_pct(),nba_ft_rate(). - Rating / pace:
nba_possessions(),nba_pace(),nba_offensive_rating(),nba_defensive_rating(),nba_net_rating(). - Player rate stats:
nba_game_score()(Hollinger),nba_usage_rate(),nba_assist_pct(),nba_assist_to_turnover(),nba_turnover_pct(),nba_oreb_pct(), andnba_four_factors()(a tidy four-factors tibble). - Scaling / enrichment:
nba_per_minutes()(per-36 by default),nba_per_possessions()(per-100), andnba_add_advanced_metrics(), which detects the standard box-score columns present in a data frame and appends the advanced metrics it can compute.
NBA player / team dictionaries & media (nba_*)
-
nba_player_dict()/nba_team_dict()— tidy player and team dictionaries (ids, names, teams, conference/division) for joining ids to names and fetching media, with headshot / logo URLs attached. -
nba_player_headshot_url()/nba_team_logo_url()— vectorized builders for the official NBA CDN headshot and logo URLs.
NBA result-set helpers (nba_bind_sets() / nba_join_sets() / nba_nest_sets())
hoopR’s NBA Stats wrappers return the endpoint’s resultSets verbatim as a named list of tibbles (structure-faithful, lossless). These three pure helpers reduce that list to a single tibble on demand — making explicit, and composable, the three common result-set reductions:
-
nba_bind_sets(tag_column = )— row-bind the sets into one long tibble, tagging each row with its origin (tactic B); columns absent from a set fill withNA. For sets that share a schema, or to stack with a tag. -
nba_join_sets(join_key = )— successively left-join the sets into one wide tibble on a shared key (tactic C). For different facets of one entity (e.g.PlayerStats+TeamStatsonGAME_ID). -
nba_nest_sets(keep_cols = , nest_col = )— keep the key column(s) wide and nest every other column into a list-column, preserving the set origin (tactic D). For heterogeneous sets that can’t be bound or joined (e.g. a player profile’s season totals / career totals / awards).
All three take a named list of tibbles (an nba_*() return) and always return a tibble. The default hoopR return (the list itself) is the “keep them all” option.
NBA combined-dataset wrappers (nba_tidy_*())
The per-dataset equivalent of the result-set helpers: each fetches a specific multi-result-set endpoint and applies its canonical reduction in one call, so you get the munged tibble directly. All are resilient to the empty / partial sets stats.nba.com occasionally returns.
-
nba_tidy_franchise_history()— [nba_franchisehistory()]’s active + defunct sets row-bound into one franchise timeline, taggedactive/defunct(tactic B). -
nba_tidy_boxscore(game_id)— a traditional player box score with each player’s team totals joined on byGAME_ID+TEAM_ID(team columns suffixed_team) (tactic C). -
nba_tidy_player_profile(player_id)— [nba_playerprofilev2()]’s manyPLAYER_ID-keyed tables (season/career totals, highs, rankings) nested into a.datalist-column, one row per table (tactic D).
ESPN endpoint naming convention (game_/player_)
The 3.1.0 ESPN wrappers are renamed to the shared sportsdataverse taxonomy used by cfbfastR (and mirrored in wehoop): event_competitor* → game_team*, event_competition → game, event_* → game_*, and athlete_* → player_* (60 functions). These wrappers are new in this dev cycle and were never on CRAN, so the rename is applied directly (no deprecation shims). The web-common-v3 /athletes/{id}/stats wrapper becomes *_player_stats_v3 (kept alongside the core-v2 *_player_stats, a different endpoint).
New data loaders
13 new load_*() loaders bring NBA and MBB dataset coverage toward parity with the wehoop load_wnba_*() / load_wbb_*() families, reading the corresponding espn_nba_* / espn_mens_college_basketball_* release tags on sportsdataverse-data:
-
NBA (7):
load_nba_standings(),load_nba_draft(),load_nba_player_stats(),load_nba_team_stats(),load_nba_rosters(),load_nba_game_rosters(),load_nba_officials(). -
MBB (6):
load_mbb_rosters(),load_mbb_player_stats(),load_mbb_team_stats(),load_mbb_standings(),load_mbb_game_rosters(),load_mbb_officials().
Player/team season-stats loaders return long-format frames (averages / totals / miscellaneous categories). Draft is NBA-only. All accept a seasons vector (min 2002, draft min 2003) and the same dbConnection / tablename dots used by the update_*_db() helpers.
New exported functions
58 new ESPN wrappers added across 8 domains (29 per league × 2 leagues + 4 NBA-only). All built on shared internal helpers in R/espn_basketball_*_helpers.R so each MBB / NBA pair stays DRY — one bugfix in the helper propagates to both public wrappers. Same internal-helpers-plus-thin-shims pattern wehoop uses for its WBB / WNBA pair.
Athlete coverage (×8 per league)
| Function | Endpoint family | Description |
|---|---|---|
espn_mbb_athlete_info() / espn_nba_athlete_info()
|
site-v2 | Athlete bio / team / position / status / college / draft info. |
espn_mbb_athlete_overview() / espn_nba_athlete_overview()
|
web-common-v3 | Season overview + last-5-games + news + rotowire notes. |
espn_mbb_athlete_stats() / espn_nba_athlete_stats()
|
web-common-v3 | Per-category stats as a named list (averages / totals). |
espn_mbb_athlete_gamelog() / espn_nba_athlete_gamelog()
|
web-common-v3 | Game-by-game log. |
espn_mbb_athlete_splits() / espn_nba_athlete_splits()
|
web-common-v3 | Long-format home / away / opponent splits. |
espn_mbb_athlete_eventlog() / espn_nba_athlete_eventlog()
|
core-v2 | Per-event log. statistics.$ref URLs returned as statistics_ref character column (not auto-resolved). |
espn_mbb_athlete_awards() / espn_nba_athlete_awards()
|
core-v2 | Awards (sparse / often empty); empty payload returns a canonical-shape empty tibble. |
espn_mbb_athlete_statisticslog() / espn_nba_athlete_statisticslog()
|
core-v2 | Per-season statistics log. |
Team detail (×5 per league)
| Function | Description |
|---|---|
espn_mbb_team() / espn_nba_team()
|
Single-team info as a named list (Info, Record, NextEvent, StandingSummary, Coaches). |
espn_mbb_team_roster() / espn_nba_team_roster()
|
Roster (one row per athlete with position, height, weight, headshot). |
espn_mbb_team_schedule() / espn_nba_team_schedule()
|
Schedule (one row per event with opponent, venue, broadcast, result). |
espn_mbb_team_leaders() / espn_nba_team_leaders()
|
Statistical leaders in long format per category-rank-athlete. |
espn_mbb_team_news() / espn_nba_team_news()
|
Team-scoped news feed. |
Event detail (×4 per league)
| Function | Description |
|---|---|
espn_mbb_event_odds() / espn_nba_event_odds()
|
Game-level odds (one row per provider). |
espn_mbb_event_probabilities() / espn_nba_event_probabilities()
|
Paginated play-level win probabilities (page loop capped at 50 pages; respects limit). |
espn_mbb_event_officials() / espn_nba_event_officials()
|
Per-game officials. |
espn_mbb_event_broadcasts() / espn_nba_event_broadcasts()
|
Broadcast outlets. |
League catalog (×6 per league)
| Function | Description |
|---|---|
espn_mbb_leaders() / espn_nba_leaders()
|
League leaders (web-common-v3 statistics/byathlete). |
espn_mbb_venues() / espn_nba_venues()
|
Venue catalog. |
espn_mbb_coaches() / espn_nba_coaches()
|
Coach roster. |
espn_mbb_athletes_index() / espn_nba_athletes_index()
|
Paginated athlete index with progress messages. |
espn_mbb_seasons() / espn_nba_seasons()
|
Season list. |
espn_mbb_season_info() / espn_nba_season_info()
|
Single-season info. |
News + calendar (×2 per league)
| Function | Description |
|---|---|
espn_mbb_news() / espn_nba_news()
|
League-level news feed (site-v2 /news). |
espn_mbb_calendar() / espn_nba_calendar()
|
Scoreboard calendar blocks (site-v2 /scoreboard?dates={season}). |
Injuries (×2 per league)
| Function | Description |
|---|---|
espn_mbb_injuries() / espn_nba_injuries()
|
League-wide injury feed (site-v2 /injuries). |
espn_mbb_team_injuries() / espn_nba_team_injuries()
|
Team-scoped injury feed (site-v2 /teams/{id}/injuries). |
MBB injury data is typically sparse on ESPN; both variants return an empty tibble (rather than erroring) when no injuries are reported.
NBA-only ESPN endpoints
| Function | Description |
|---|---|
espn_nba_draft() |
Paginates core-v2 /seasons/{year}/draft (up to 20 pages); flat tibble of picks. |
espn_nba_freeagents() |
Wraps core-v2 /seasons/{year}/freeagents; returns an empty tibble outside the off-season free-agent window. |
espn_nba_transactions() |
Wraps site-v2 /transactions?season={year}&limit={limit} with null-safe to_team_id for release transactions. |
espn_nba_conferences() |
NBA-side analog of espn_mbb_conferences(), against the NBA scoreboard-conferences endpoint. |
Tier 1 core-v2 expansion (crawler-driven)
22 new wrappers across 9 resource families, surfaced by an internal $ref-following crawler that mapped the reachable basketball API surface (21,962 fetches, 1,570 unique templates across all 4 basketball leagues). Each wrapper is a thin shim over a shared .espn_basketball_*() helper. WNBA + WBB siblings ship in wehoop’s matching release.
| Function | Description |
|---|---|
espn_nba_team_season_profile() / espn_mbb_team_season_profile()
|
Era-correct team identity in a specific season plus $ref URLs for deeper resources (record, statistics, leaders, coaches, etc.). Historical depth back to 1947 (NBA) / 1939 (MBB). |
espn_nba_franchise() / espn_mbb_franchise()
|
Franchise-level metadata. IDs are stable across relocations and rebrands. |
espn_nba_franchises() / espn_mbb_franchises()
|
Index of franchise IDs in the league. |
espn_nba_athlete_contracts() |
Index of contract seasons recorded for an NBA athlete (NBA-only — WNBA athletes return empty). |
espn_nba_athlete_contract() |
Salary, cap-rule flags, Bird status, and trade protections for one (athlete × season). |
espn_nba_season_awards() / espn_mbb_season_awards()
|
Index of award IDs given out in a season. |
espn_nba_award() / espn_mbb_award()
|
Award detail with winners (one row per winner; multi-recipient awards like All-NBA return 5 rows). |
espn_nba_futures() / espn_mbb_futures()
|
Per-season futures betting board in long format (one row per market × team × sportsbook). |
espn_nba_tournaments() / espn_mbb_tournaments()
|
Index of league-tracked tournaments. |
espn_nba_tournament() / espn_mbb_tournament()
|
Single tournament metadata + seasons-list $ref. |
espn_nba_tournament_seasons() / espn_mbb_tournament_seasons()
|
Seasons in which a given tournament was held. |
espn_nba_team_record() / espn_mbb_team_record()
|
Long-format record breakdown for one team in one season-type (Overall / Home / Road / vs Conference / etc.). |
espn_nba_coach() / espn_mbb_coach()
|
Single-coach biography, current team / college refs, and counts of career-record + per-season coaching entries. |
espn_nba_powerindex() / espn_mbb_powerindex()
|
Per-season Basketball Power Index and related metrics, long format (one row per team × stat). |
Tier 2A core-v2 expansion — season metadata
10 new wrappers across 5 resource families covering season-level metadata: season types, the per-(season × season-type) leaderboards, and (mostly college-only) season rankings. Backed by a shared R/espn_basketball_season_meta_helpers.R. WNBA + WBB siblings ship in wehoop’s matching release.
| Function | Description |
|---|---|
espn_nba_season_types() / espn_mbb_season_types()
|
Index of season-type IDs that exist for one season (1 = preseason, 2 = regular, 3 = postseason, 4 = off-season). |
espn_nba_season_type() / espn_mbb_season_type()
|
Single season-type detail (start / end dates, has-groups / has-standings / has-legs flags, $ref URLs to deeper resources). |
espn_nba_season_leaders() / espn_mbb_season_leaders()
|
Per-(season × season-type) leaderboards in long format (one row per category × rank). 14–15 categories × 25 leaders ≈ 350 rows. |
espn_nba_season_rankings() / espn_mbb_season_rankings()
|
Index of season-level rankings recorded for a season (NBA / WNBA return zero; MBB / WBB return AP Top 25 + Coaches Poll). |
espn_nba_season_ranking() / espn_mbb_season_ranking()
|
Per-week snapshot index for one ranking source — each row resolves to a per-week ranked-teams endpoint. |
Tier 2A core-v2 expansion — weeks + per-week rankings
8 new wrappers across 4 resource families covering the week structure of a season. Backed by a shared R/espn_basketball_week_helpers.R. WNBA + WBB siblings ship in wehoop’s matching release.
| Function | Description |
|---|---|
espn_nba_season_weeks() / espn_mbb_season_weeks()
|
Index of weeks within one (season × season-type). Typical: ~20 weeks for regular season. NBA / WNBA also have weeks; rankings only populate for MBB / WBB. |
espn_nba_season_week() / espn_mbb_season_week()
|
Single-week metadata (number, start / end dates, text label, $ref to the per-week rankings endpoint). |
espn_nba_week_rankings() / espn_mbb_week_rankings()
|
Index of ranking sources for one week (NBA returns zero; MBB returns AP + Coaches). |
espn_nba_week_ranking() / espn_mbb_week_ranking()
|
The ranked teams (typically 25 rows) for one (season-type × week × source). Includes current / previous rank, points, first-place votes, trend, record summary, team $ref. |
Tier 2A core-v2 expansion — groups (conferences and divisions)
8 new wrappers across 4 resource families covering the per-season group hierarchy (conferences, divisions, and member teams). Backed by a shared R/espn_basketball_group_helpers.R. WNBA + WBB siblings ship in wehoop’s matching release.
| Function | Description |
|---|---|
espn_nba_season_groups() / espn_mbb_season_groups()
|
Index of group IDs (conferences / divisions) for one (season × season-type). |
espn_nba_season_group() / espn_mbb_season_group()
|
Single-group metadata (name, abbreviation, midsize / short name, is_conference flag) plus $ref URLs to parent, children, member teams, and standings. |
espn_nba_season_group_children() / espn_mbb_season_group_children()
|
Index of child groups (e.g. divisions inside a conference, or conferences inside the NCAA Division I umbrella group). |
espn_nba_season_group_teams() / espn_mbb_season_group_teams()
|
Index of team IDs that belong to the group for that (season × season-type). |
Tier 2A core-v2 expansion — team deep + coach-in-season
7 new wrappers across 4 resource families covering deeper per-team and per-coach core-v2 endpoints. Backed by a shared R/espn_basketball_team_deep_helpers.R. WNBA + WBB siblings (where applicable) ship in wehoop’s matching release.
| Function | Description |
|---|---|
espn_nba_team_odds_records() / espn_mbb_team_odds_records()
|
Long-format odds-records breakdown (Money Line / ATS / O/U × Overall / Home / Road × W/L/Push). Sparse — many (team × season-type) combinations return empty. Default season_type = 0 (all-types aggregate, where ESPN actually populates). |
espn_nba_team_depthchart() |
NBA-only long-format depth chart (one row per position × rank × athlete). |
espn_nba_team_season_roster() / espn_mbb_team_season_roster()
|
Per-season roster (core-v2 seasons/{y}/teams/{id}/athletes). Distinct from the existing site-v2 espn_*_team_roster(): era-correct, available back to the league’s earliest season. |
espn_nba_coach_season() / espn_mbb_coach_season()
|
Single-coach metadata for one (coach × season). Includes name, birth info, and $refs to person / college / team. Sparse coverage — many combinations 404. |
Tier 2A core-v2 expansion — athlete career + draft pick
5 new wrappers across 3 resource families covering career-level athlete endpoints and the single-draft-pick lookup. Backed by R/espn_basketball_athlete_career_helpers.R and R/espn_basketball_draft_helpers.R.
| Function | Description |
|---|---|
espn_nba_athlete_seasons() / espn_mbb_athlete_seasons()
|
List of seasons an athlete appeared in. |
espn_nba_athlete_career_stats() / espn_mbb_athlete_career_stats()
|
Long-format career stats. Default stat_type = 0L fetches the standard “All Splits” / regular-season view; pass a vector like c(0L, 1L, 2L) to bind multiple types (postseason / career aggregate) via a stat_type_id column. Coverage of types 1 and 2 is sparse — many athletes only populate type 0. |
espn_nba_draft_pick() |
Single NBA draft-pick detail (defaults to most-recent NBA season, round 1, pick 1). MBB has no draft endpoint, so this wrapper is NBA-only on the hoopR side. |
Tier 2B core-v2 expansion — athlete event log + draft completion
5 new wrappers across 2 resource families. Extends the athlete and draft endpoint coverage with the remaining per-season core-v2 endpoints.
| Function | Description |
|---|---|
espn_nba_athlete_eventlog_v2() / espn_mbb_athlete_eventlog_v2()
|
Per-season event log from core-v2 (seasons/{y}/athletes/{id}/eventlog). One row per (event × team) appearance with played flag + event/competition $refs. Distinct from the existing espn_*_athlete_eventlog() which hits the web-common-v3 gamelog endpoint with stats per game. |
espn_nba_draft_rounds() |
Round-level summary for one NBA draft year (one row per round with pick count + completion status). |
espn_nba_draft_athletes() |
Index of every athlete in a given NBA draft year (~102 entries: 60 picks + undrafted invitees). |
espn_nba_draft_status() |
Single-row snapshot of one draft year’s current state. |
Tier 2B core-v2 expansion — event meta endpoints
8 new wrappers across 4 resource families. Each wraps events/{eid}/competitions/{cid}/... and is added to both NBA and MBB shim files (16 new public functions across both leagues per package = 8 each).
| Function | Description |
|---|---|
espn_nba_event_situation() / espn_mbb_event_situation()
|
Live game situation: timeouts, fouls, fouls-to-give, bonus state, last-play $ref. Single-row tibble. |
espn_nba_event_predictor() / espn_mbb_event_predictor()
|
Pre-game predictor statistics in long format (one row per team × stat). Stats include matchup quality, predicted score, win pct, team-predicted MoV. Returns empty for events without predictor data. |
espn_nba_event_powerindex() / espn_mbb_event_powerindex()
|
Per-event power-index $ref index. Coverage is sparse — most events return zero items. |
espn_nba_event_propbets() / espn_mbb_event_propbets()
|
Per-(event × provider) prop-bet markets in long format. One row per (athlete × prop type) with american / decimal / fraction odds + current target line. Auto-paginates. |
Tier 2B core-v2 expansion — event competitor sub-resources
5 new resource families under events/{eid}/competitions/{cid}/competitors/{team_id}/, each shimmed for NBA and MBB (10 new public functions per package). Pair the team_id with the event_id from espn_*_schedule() (or any boxscore.teams[].id).
| Function | Description |
|---|---|
espn_nba_event_competitor_linescores() / espn_mbb_event_competitor_linescores()
|
Per-quarter scoring for one team in one event. One row per period (regulation + overtime). |
espn_nba_event_competitor_leaders() / espn_mbb_event_competitor_leaders()
|
Top performers per team in long format: one row per (category × athlete rank). Categories typically include points, rebounds, assists, and rating. |
espn_nba_event_competitor_roster() / espn_mbb_event_competitor_roster()
|
Game-day roster index for one team. Returns athlete ids + core-v2 $ref URLs for deferred dereferencing. |
espn_nba_event_competitor_statistics() / espn_mbb_event_competitor_statistics()
|
Full team-game statistics in long format (one row per category × stat) with both numeric values and display strings. |
espn_nba_event_competitor_records() / espn_mbb_event_competitor_records()
|
Team records as of the event: overall / home / away / conference / division breakdowns. |
Tier 2F core-v2 expansion — typed-detail companions
5 new resource families completing index/detail pairs for existing wrappers. NBA-only or 3-league coverage where the underlying ESPN endpoint isn’t symmetric:
| Function | Description |
|---|---|
espn_nba_event_official_detail() / espn_mbb_event_official_detail()
|
Per-official details (name, position, order) for one event. Note: the URL segment is the crew order (1-indexed) not the ESPN stable official_id — the wrapper takes order = to match event_officials()$order. |
espn_nba_team_record_detail() / espn_mbb_team_record_detail()
|
Per-record stat array in long format. Use team_record() to enumerate record_id values (overall / home / away / conference / per-opponent). Returns 21 rows × 15 cols for one NBA record. |
espn_nba_coach_record() / espn_mbb_coach_record() / espn_wbb_coach_record()
|
Coach career record by type in long format. Types: 0 = Total, 1 = Pre Season, 2 = Regular Season, 3 = Post Season. |
espn_nba_tournament_season() / espn_mbb_tournament_season()
|
Single tournament-year detail (id, displayName, numberOfRounds, bracketology $ref). |
espn_nba_draft_athlete_detail() |
Rich single-row drafted-player record: height/weight, position, pick (overall/round/team), athlete $ref. |
Tier 2E.2 core-v2 expansion — team-season stats + quick lookups
3 new resource families across NBA + MBB (5 new exports — season_draft is NBA-only). Surfaces the full team-season stat sheet (with league rank per stat), a quick-lookup wrapper for a single team’s final score in one event, and the draft-year top-level metadata.
| Function | Description |
|---|---|
espn_nba_team_season_statistics() / espn_mbb_team_season_statistics()
|
Full team-season-type stat sheet in long format (one row per category × stat). Each row carries rank + rank_display_value for league ranking per stat. Smoke-tested: 109 rows × 13 cols for one NBA team. |
espn_nba_event_competitor_score() / espn_mbb_event_competitor_score()
|
Single-row final score for one team in one event: value, display_value, winner flag, source metadata. |
espn_nba_season_draft() |
Draft-year top-level metadata: year, number_of_rounds, display_name, plus sub-refs to athletes/rounds/status. |
Tier 2E.1 core-v2 expansion — event-scoped player + play deep dives
4 new resource families covering per-game player stats, starter/DNP metadata, single-play detail, and on-court personnel (8 new public functions per package).
| Function | Description |
|---|---|
espn_nba_event_player_box() / espn_mbb_event_player_box()
|
Per-game box score for one athlete in long format (one row per category × stat). Same shape as event_competitor_statistics() but scoped to a single athlete-in-event. Smoke-tested: 99 rows × 12 cols for one NBA athlete. |
espn_nba_event_competitor_roster_entry() / espn_mbb_event_competitor_roster_entry()
|
Per-athlete game-day roster row: starter flag, did_not_play + reason, ejected, period of entry, for_player_id if a substitution. |
espn_nba_event_play() / espn_mbb_event_play()
|
Rich single-play detail: sequence, period, clock, type, text, scoring/shooting flags, score, team $ref, shot coordinates. |
espn_nba_event_play_personnel() / espn_mbb_event_play_personnel()
|
Players on court at a specific play in long format. Coverage is sparse — many plays return zero rows; wrapper returns a typed empty tibble. |
Tier 2D core-v2 expansion — position dictionary
2 new resource families for the league-specific position dictionary (4 new public functions). Position ids are not shared across the basketball family — id 1 resolves to Point Guard in NBA and Center in MBB. These wrappers make the dictionary explicit so users can disambiguate position $ref URLs in athlete records.
| Function | Description |
|---|---|
espn_nba_positions() / espn_mbb_positions()
|
League position dictionary index. One row per position with id + canonical $ref. |
espn_nba_position() / espn_mbb_position()
|
Single-position detail: id, name, displayName, abbreviation, leaf flag, parent $ref. |
Behavior changes to existing functions
Bug fixes
| Function | Fix |
|---|---|
nba_schedule() |
Migrated off the retired stats.nba.com/stats/scheduleleaguev2 endpoint (returns Connection was reset across multiple client environments; issues #184 and #187) to the public CDN at cdn.nba.com/static/json/staticData/scheduleLeagueV2.json. Same leagueSchedule.gameDates[].games[] payload, no authentication or special headers, stays current with the live season. G-League schedules now come from the _2-suffixed variant on the same CDN. For historical seasons (CDN only serves the current season) the function emits a message() directing users at load_nba_schedule(seasons = ...). Also initializes games <- NULL before tryCatch (issue #184). Verified 2026-05-16: returns 1,398 NBA games × 52 cols for 2025-26. |
nba_leaguegamelog() |
Reordered query-string parameter ordering to put LeagueID first. As of 2026 the NBA Stats API rejects the alphabetical ordering (Counter, DateFrom, DateTo, Direction, LeagueID, ...) with a Cloudflare HTML error page; LeagueID-first matches the nba.com client and parses successfully. Verified 2026-05-16: returns 2,460 NBA rows with SEASON_ID=22025. Parallel fix to the WNBA equivalent in wehoop. |
ncaa_mbb_NET_rankings() |
Hardened against NCAA.com column drift. The function now uses dplyr::rename(dplyr::any_of(...)) so renamed / added columns (e.g. new Quad 1..4 headers) no longer break the documented schema; existing consumers keep working and new columns ride along untouched. |
| ESPN wrappers | Moved .retry_request() and check_status() inside tryCatch so transient HTTP errors surface as cli_alert_danger() + empty fallback rather than escaping the function. Affects every espn_nba_* / espn_mbb_* wrapper. |
ncaa_mbb_teams() |
No longer returns NA ids. stats.ncaa.org migrated team links from the legacy /team/{team_id}/{season_id} pair to a single modern /teams/{season_team_id} resource, so the previous str_extract("(\\d+)/(\\d+)") matched nothing. The function now extracts ids from whichever url shape is present (legacy rows populate team_id/season_id; modern rows populate the new season_team_id column), so the id columns are never all-NA when the site flips formats. |
Documentation improvements
@return column descriptions on every exported function
Every @return markdown table across the 39 R source files is upgraded from two columns (col_name | types) to three columns (col_name | types | description). 6,039 total table rows touched; every result set on every function now ships a per-column description in ?<function> help, the pkgdown reference, and the rendered man pages.
Coverage — frequency-weighted, what ?fn readers actually see — 58.4% of the 6,039 @return table rows now carry a hand-quality description (curated + ESPN-API + mined). The remaining 41.6% are heuristic-fallback rows; the heuristic generator’s snake_case expansion + suffix rules cover most of those acceptably, and the long tail is dominated by single-occurrence columns from low-traffic NBA Stats endpoints.
Description sources (precedence order, first match wins):
-
tools/docs/column_descriptions_curated.csv— 619 hand-authored entries covering high-traffic columns and basketball / ESPN domain conventions. -
tools/docs/column_descriptions_api.csv— 188 ESPN-authored descriptions mined live from 14 endpoints per league across bothnbaandmens-college-basketball, covering 9 endpoint families: core-v2 athlete statistics (per-season, post-season, career), core-v2 team statistics, core-v2 statisticslog, core-v2 leaders, web-v3 athlete stats / splits / gamelog / overview, and web-v3 statistics/byathlete leaderboards. Three response shapes are recognized: nested categories with stats objects, parallel arrays under categories, and top-level parallel-array shapes (splits / gamelog). - Mined
\item{...}{...}lines from existing\describe{}blocks. - Heuristic patterns driven by column-name suffixes (
*_id,*_pct,*_made,*_attempted,*_per_36, etc.) with basketball-friendly noun substitution.
New tooling under tools/docs/ (.Rbuildignore’d via the existing ^tools$ rule):
| File | Purpose |
|---|---|
build_column_descriptions.R |
One-shot dictionary builder. |
column_descriptions_curated.csv |
Hand-edit surface; overrides API / mined / heuristic outputs. |
column_descriptions_api.csv |
ESPN-API-mined descriptions, regenerated by mine_api_descriptions.R. |
column_descriptions.csv |
Generated dictionary (1,956 rows; 619 curated, 168 ESPN-API, 5 mined, 0 parameter-overlap, 1,164 heuristic). |
mine_api_descriptions.R |
Driver that probes the ESPN endpoints which self-document their stat columns. |
audit_column_descriptions.R |
Coverage / leverage diagnostic. |
markdown_man_table_helper.R |
Programmatic helpers (load_column_descriptions(), make_return_table_md(), roxygenize_return(), augment_return_tables_in_file(), augment_all_r_files(), mine_espn_api_descriptions(url)). |
espn_endpoints_catalog.md |
Basketball-scoped ESPN endpoint reference used to scope the miner. |
The sweep is idempotent and offline (no API calls needed for the augmentation itself; existing |col_name|types| tables in each @return block are the parse input).
Internals
HTTP layer — proxy support restored
When the package migrated from httr to httr2 in 3.0.0, the legacy httr::use_proxy() plumbing was dropped and request_with_proxy() quietly stopped honoring proxies (its ... was preserved purely for source compatibility). Both request_with_proxy() and the lower-level .retry_request() now accept a proxy = argument:
-
proxy = NULL(default) — libcurl readshttp_proxy/https_proxy/no_proxyenv vars automatically. -
proxy = "http://host:port"— string form, forwarded tohttr2::req_proxy(url = ...). -
proxy = list(url=, port=, username=, password=, auth=)— named list spread intohttr2::req_proxy()for authenticated proxies.
Resolution order in .retry_request(): explicit proxy = arg → getOption("hoopR.proxy") → libcurl env vars. The ... thread works for NBA Stats wrappers (which forward into request_with_proxy()); ESPN / KenPom / NBA G-League wrappers call .retry_request() directly without ..., so use options(hoopR.proxy = ...) at the top of the session to cover those without per-function plumbing.
Error-handling consolidation
| Helper | Role |
|---|---|
.report_api_error(e, hint, args) |
Standardized tryCatch error handler — emits a cli_alert_danger() with hint text plus the captured arg list, then returns an empty fallback. |
.report_api_warning(w, args) |
Companion warning handler. |
.interp_braces() |
Internal helper for safely interpolating {var} syntax in cli alerts when the variable might contain braces of its own. |
.capture_args() |
Helper used at the top of arg-less wrappers (i.e. those whose only formal is ...) so the error/warning reporters still see the call args. Equivalent to mget(setdiff(names(formals()), "...")) for wrappers with formals. |
Every tryCatch(expr = ...) block in ESPN, NBA Stats, and KenPom wrappers now uses these helpers instead of hand-rolled cli::cli_alert_danger("{Sys.time()}: ...") strings. Behavior is the same; the message includes the captured args, which makes failed-call debugging much faster.
Dependency cleanup
- Removed
gluefromImports; demoted toSuggests(retained only for downstream package-level references). - Replaced
glue::glue(...)call-sites withsprintf()/paste0()/ base R in URL builders,pad_id(),pad_time(), andclialert strings. - Replaced
glue::glue_sql()with parameterizedDBI::dbExecute()/DBI::dbGetQuery()calls inload_*family functions.
Tooling
- Ported wehoop’s
tools/patch scripts (patch_df_list_init.R,patch_return_var_init.R,flip_expect_equal_cols.R,inject_skip_guard.R,inject_skip_helpers.R,sweep_error_handlers.R,find_parse_errors.R) for future audit / sweep work. - Added
tools/run_doctoc.R— a no-deps R replacement for the npmdoctocCLI, used to regenerate the NEWS.md / CONTRIBUTING.md TOCs. Run withRscript tools/run_doctoc.R --maxlevel 2 NEWS.md CONTRIBUTING.md.
Test infrastructure
- Live API test env vars enabled by default in the R CMD check workflow (previously had to be set per-job).
- Additional test-suite hardening sweeps applied via the ported
tools/scripts: return-value init guards on edge-case wrappers, subset-direction column assertions, skip-on-empty guards where wrappers can legitimately return empty.
Late-cycle additions and fixes (August 2026)
NCAA MBB + shots + model-dataset loaders
36 further bulk-data loaders, following the established load_*() shape:
- A 13-function NCAA men’s-basketball family reading the stats.ncaa.org-derived datasets produced by the companion
sportsdataverse-pyengine (hoopR ships loaders only):load_ncaa_mbb_pbp(),_shots(),_lineups(),_matchup_stints(),_possessions(),_rapm()(league-wide regularized adjusted plus-minus),_rapm_within_team(),_player_box(),_team_box(),_rosters(),_team_rosters(),_schedule(), and_team_ids(). -
load_nba_shots()andload_mbb_shots()for ESPN shot events (20-column schema verified against real downloaded assets).load_mbb_shots()documents and enforces the 2004/2005 gap seasons (no shot-coordinate assets were published for those two seasons). - Three model datasets:
load_nba_player_impact()(RAPM/SPM/BPM/DARKO),load_mbb_ratings()(KenPom-style adjusted efficiency), andload_mbb_player_value()(box-BPM), reading thenba_player_impact/mbb_ratings/mbb_player_valuerelease tags. The latter two are parquet-only, soparquet_from_url()is added toutils.Randarrowmoves intoSuggests. - An 18-function
nba_statsrelease-dataset family mirroring thewnba_stats_*loaders inwehoop: 17 tag loaders (load_nba_stats_coaches(),_draft(),_game_lineups(),_game_rosters(),_lineups(),_officials(),_pbp(),_player_boxscores(),_player_game_logs(),_player_season_stats(),_possessions(),_rosters(),_schedule(),_shots(),_standings(),_team_boxscores(),_team_season_stats()) plusload_nba_stats_leaguedash()(a 36-table cube),update_nba_stats_db(), andmost_recent_nba_stats_season(). Seasons are keyed on the START year (e.g.2024= the 2024-25 season), unlike the ESPN-backedload_nba_*()family which keys on the season’s end year — documented on each function.
All were verified live against the published release assets, with returns documentation derived from the real files.
Database write plumbing
-
...is now genuinely forwarded toDBI::dbWriteTable()across 23 loader call sites, and the deaddots <- rlang::dots_list(...)capture that never fed anywhere is removed. - 16 loaders that accepted/documented an optional
dbConnection/tablenamewrite without performing it now perform it:load_nba_team_box(),load_nba_standings(),load_nba_game_rosters(),load_nba_officials(),load_nba_draft(),load_nba_player_stats(),load_nba_team_stats(),load_nba_rosters(),load_nba_player_core(),load_mbb_rosters(),load_mbb_player_stats(),load_mbb_team_stats(),load_mbb_standings(),load_mbb_game_rosters(),load_mbb_officials(),load_mbb_player_core(). - Repaired the
hoopR_dataclass vector (make_hoopR_data()and everyload_nba_*()/load_mbb_*()/ crosswalk loader):"data.table"had been mixed into the class vector alongside"tbl_df"without the internal statedata.tableneeds, sotail()/head()dispatcheddata.table:::tail.data.table(), whose row-filter re-dispatched totibble:::[.tbl_df()(column semantics, not row semantics) and threwError in x[i]: Can't subset columns past the end.tail()/head()/print()/dplyr::filter()now work correctly on loader results. Fixes #88.
NBA Stats API lifecycle corrections
A residential-IP live re-probe (2026-08-24) of the nba_stats family’s mis-flagged/untested/dead-exported endpoints, backed by real probes rather than the endpoint catalog’s capture flags alone:
-
Restored:
nba_scoreboardv2()(lifecycle::deprecate_stop()removed — confirmed live with real rows). -
Newly soft-deprecated:
nba_videoeventsasset()— HTTP 200 with zero rows across multiple game/event IDs;lifecycle::deprecate_warn(when = "3.1.0")(call still proceeds). -
Documented as league-scoped, not deprecated:
nba_boxscoreadvancedv2()is dead for NBA (LeagueID '00') but live for WNBA ('10') and G-League ('20') — gains a@detailsnote instead of a deprecation. - Probe dates and rationale recorded in
@detailson every already-deprecated endpoint that was re-probed and kept deprecated (nba_boxscorehustlev2(),nba_homepageleaders()/nba_homepagev2()/nba_leaderstiles(),nba_boxscoreplayertrackv2(),nba_scoreboard(),nba_teamhistoricalleaders(),nba_videodetails(),nba_winprobabilitypbp()). - Doc notes:
nba_scoreboard()/nba_scoreboardv2()point real-time users atnba_todays_scoreboard();nba_homepageleaders()notesstat_category = "Defense"was never supported upstream; a shared?hoopRnote coversstats.nba.com/stats.wnba.comblocking datacenter/cloud IPs and theoptions(hoopR.proxy = ...)escape hatch. -
LeagueID-first hardening sweep: the
LeagueID-first parameter-ordering fix applied tonba_leaguegamelog()in 3.1.0 (see Bug fixes above) is now applied mechanically to every othernba_stats_*.Rwrapper that sends aLeagueIDparam — 78 params-list sites across 15 files. No signature or behavior changes. -
espn_mbb_scoreboard()unioned four ESPN group IDs (56, 55, 50, 100) without deduplicating, so a game tagged under more than one group was double-counted (e.g. 18 rows for a 10-game slate). Fixed withdplyr::distinct(game_id, .keep_all = TRUE). Fixes #160.
ESPN fixes
-
espn_mbb_betting()/espn_nba_betting(): ESPN’s Site v2summarypayload now frequently ships an emptypickcenterarray. Both now cascade to the Core v2 event odds endpoint and map its columns onto the documentedpickcentershape when the summary is empty. Fixes #136, #153, #173. -
espn_mbb_standings()switches from ESPN’s flatlevel=1list tolevel=3(conference-grouped), which includes D1 newcomers the flat list drops, and gains aconferencecolumn.espn_mbb_teams()backfills the same conference-crawl information for team ids its own flatteams?limit=1000fetch independently drops. Fixes #144 (all 366 teams now returned). -
espn_mbb_scoreboard()/espn_nba_scoreboard():max_yearwas character, somax_year + 1threw for out-of-range seasons — cast to integer.espn_mbb_scoreboard()also passed a bare season year straight through to ESPN’sdates=param, which ESPN treats as calendar-year-only (Jan 1 onward), silently dropping the season’s November/December games; for a season-year input it now additionally queries the prior calendar year and backfills the high-volume window (which otherwise hits ESPN’slimit=1000cap before reaching Nov/Dec) with one request per day, filtered to the season ESPN itself assigns each game and deduplicated. Fixes #150.
KenPom fix
-
kp_team_depth_chart(): KenPom removed the#dc-tabletable fromteam.php— the page now ships an empty<div id="depth-chart">rendered client-side from aconst players = [...]JSON array embedded in an inline<script>tag. The parser is repointed at that embedded JSON. The new source reports each rostered player’s percentage of minutes at every position rather than a single starter/backup per slot, so the return shape changed from one wide row per team to one row per player withpct_pg/pct_sg/pct_sf/pct_pf/pct_ccolumns. Fixes #152.
Release / CRAN preparation
- Added
cph(copyright holder) role toSaiem GilaniinAuthors@R(CRAN strict requirement caught between releases). - DESCRIPTION normalized via
usethis::use_tidy_description()— field order, alphabetized Imports/Suggests, reflowed long lines. -
.gitignoreanchored from baredocsto/docsso only the repo-root pkgdown output is ignored (the bare pattern was also matchingtools/docs/).
hoopR 3.0.0
CRAN release: 2026-03-24
New exported functions
NBA Play-by-Play V3
| Function / change | Description |
|---|---|
nba_playbyplayv3() |
Dedicated wrapper for the NBA Stats PlayByPlayV3 endpoint. |
nba_pbp() default flip |
Now defaults to version = "v3" (was "v2"). Pass version = "v2" for the previous behavior. |
nba_pbps() default flip |
Same default flip applies. |
nba_pbp() p parameter |
Now optional (default NULL) — previously required even when not using progress tracking. |
Internal V3→V2 compatibility pipeline backs nba_pbp() so callers keep V2-compatible columns while gaining V3-only columns (x_legacy, y_legacy, shot_distance, shot_result, is_field_goal, points_total, shot_value):
| Helper (internal) | Role |
|---|---|
.v3_to_v2_format() |
Converts V3 play-by-play data to V2-compatible column format with mapped event types and player resolution. |
.build_player_roster() |
Retrieves player roster from nba_boxscoretraditionalv3() for name-to-ID resolution during V3-to-V2 conversion. |
.players_on_court_v3() |
Rewritten — uses nba_gamerotation() stint data with interval mapping for robust on-court determination (replaces the previous substitution-parsing approach). |
Removed stringr::str_match import from NAMESPACE — V3 clock parsing now uses base R regex functions.
NBA Boxscore Summary V3
| Function | Description |
|---|---|
nba_boxscoresummaryv3() |
Returns a named list of 9 data frames: GameSummary, GameInfo, ArenaInfo, Officials, LineScore, InactivePlayers, LastFiveMeetings, OtherStats, AvailableVideo. |
New NBA Stats API endpoint wrappers
| Function | Description |
|---|---|
nba_commonteamyears() |
Team IDs with their active year ranges. |
nba_dunkscoreleaders() |
Dunk tracking data with biomechanics, scores, and style metrics. |
nba_gravityleaders() |
Gravity scores — how much defensive attention each player draws. |
nba_iststandings() |
In-Season Tournament (NBA Cup) standings. |
nba_scheduleleaguev2int() |
International schedule data with broadcaster information. |
nba_teamandplayersvsplayers() |
Team and player lineup comparison stats (5 datasets). |
nba_videoeventsasset() |
Video event asset data for a given game event. |
ESPN & G-League functions
| Function | Description |
|---|---|
espn_nba_team_current_roster() |
Current NBA team roster from ESPN. |
espn_mbb_team_current_roster() |
Current MBB team roster from ESPN. |
nbagl_live_pbp() |
Live G-League play-by-play. |
nbagl_live_boxscore() |
Live G-League box score. |
Behavior changes to existing functions
Bug fixes
| Function | Fix |
|---|---|
nba_iststandings() |
Nested games column now properly flattened. |
nba_dunkscoreleaders() |
HTTP 400 error caused by empty-string parameters now resolved. |
nbagl_pbp() |
Avoids on-court enrichment dependency failures for G-League game IDs by using the stable core play-by-play path. |
kp_box() |
Referee link extraction updated — CSS selectors now match current KenPom HTML structure (div.refline with href-based filtering). |
kp_team_history() |
CSS selector updated to table#player-table; team name assignment now uses the display name instead of the URL slug. |
kp_kpoy() example |
Year bumped from 2021 to 2026 for current-season relevance. |
Return-value initialization sweep. Fixed df_list not initialized before tryCatch in 147 NBA Stats API wrapper functions, preventing crashes on API errors. Same pattern applied to: * nba_data_pbp() (plays_df init). * nba_playbyplayv3() and nba_pbp() (data init). * NBAGL wrappers (return-object init across error paths).
Other fixes: * helper-skip.R test guard functions now use string comparison (!= "1") instead of numeric comparison (== 0). * V3-style data.frame parsing fixed for leader/standings endpoints. * %||% import added for R < 4.4.0 compatibility. * teams_links dataset updated with 2026 season team data.
Deprecations
Calling any of these now errors with a structured lifecycleDeprecatedError that names a replacement. All deprecations were prompted by unstable / partial / empty endpoint responses observed in production.
Internals
HTTP backend migration (httr → httr2)
Breaking change: httr is replaced with httr2 as the HTTP backend for every API call across the package, and httr is removed from Imports. Migration map:
| Aspect | Before (2.1.0 and earlier) | After (3.0.0) |
|---|---|---|
| HTTP client backend | httr |
httr2 |
httr package availability |
Auto-imported with hoopR
|
Removed from Imports — library(httr) yourself if your downstream code still needs it |
request_with_proxy() body |
rvest::session() + httr::config() arguments |
httr2::request() + retry pipeline |
| All ESPN / NBA Stats / NBA G-League / NCAA / KenPom HTTP calls | Mixed direct backend calls | Routed through shared internal helpers (.retry_request(), .resp_text()) backed by httr2
|
check_status() internal |
httr::status_code() |
httr2::resp_status() |
| KenPom session authentication |
rvest::session() with httr cookies |
httr2 cookie-jar via login() / .kp_get_page() / .kp_request() helpers |
| libcurl >= 8.x / curl R >= 7.0.0 segfaults | Triggered | Resolved (httr2 does not have the affected code path) |
Note: proxy plumbing on request_with_proxy() was quietly dropped during this migration. The restoration shipped in 3.1.0 — see above.
Messaging migration (usethis → cli)
- Replaced all
usethis::ui_*()messaging calls in database builder and loader functions withcliequivalents.
| Old call | New call |
|---|---|
usethis::ui_stop() |
cli::cli_abort() |
usethis::ui_oops() |
cli::cli_alert_danger() |
usethis::ui_todo() |
cli::cli_ul() |
usethis::ui_info() |
cli::cli_alert_info() |
usethis::ui_value() |
{.val} inline markup |
usethis::ui_path() |
{.file} inline markup |
usethis::ui_code() |
{.code} inline markup |
- Moved
usethisfromImportstoSuggests(retained forusethis::edit_r_environ()documentation references).
Stability and test robustness
- Hardened API-facing tests against live schema drift and intermittent empty payloads.
- Added explicit skip-on-empty guards for lineup and NCAA teams tests to avoid false negatives when upstream endpoints return no rows.
- Updated expected columns for currently active payloads in key NBA endpoints (including
nba_playercareerstats(),nba_playerdashptshotdefend(), andnba_playerprofilev2()). - Improved
nba_playerprofilev2()assertions to validate core columns while tolerating empty optional result sets. - Converted 400+
expect_equal(colnames())assertions toexpect_in()for subset validation, preventing test failures when APIs add new columns. - Added tests for all new endpoints with column validation and rate limiting.
- Added
skip_ncaa_mbb_test()andskip_ncaa_wbb_test()helpers. - Updated ESPN test expectations for current API responses.
- Updated NBAGL tests to validate NBA Stats-backed return shapes (
nbagl_players()andnbagl_standings()named-list returns, and current schedule/PBP core columns).
Dependency changes
Dependency status before / after the release. Users with strict dependency pinning or downstream packages that re-export hoopR functionality should review this table.
| Dependency | Before (2.1.0) | After (3.0.0) | Why |
|---|---|---|---|
httr |
Imports |
Removed | Replaced by httr2 (see HTTP migration above) |
httr2 |
— | Imports |
New HTTP backend |
usethis |
Imports |
Suggests |
Messaging migration to cli; retained only for usethis::edit_r_environ() doc references |
furrr |
Imports |
Suggests |
Optional parallel features only; not required for core functionality |
future |
Imports |
Suggests |
Same as furrr — optional parallel features |
lifecycle |
— | Imports |
Required for the new lifecycle::deprecate_stop() deprecation pattern |
qs |
Imports |
Removed | No longer used by any code path |
CI, build, and contribution improvements
- Added workflow-level concurrency and explicit permissions to GitHub Actions workflows.
- Clarified optional environment variable usage in CI for live API test toggles.
- Updated package build ignores to exclude local development folders from source checks.
- Updated GitHub Actions to v4.
- Cleaned up
.Rbuildignoreduplicates. - Internal
nba_endpoint()registry updated with all V3 boxscore endpoints andboxscoresummaryv3. - Added comprehensive
CONTRIBUTING.mdwith naming conventions and test environment documentation.
hoopR 2.1.0
CRAN release: 2023-11-25
-
load_nba_*()functions now usesportsdataverse-datareleases url instead ofhoopR-datarepository URL -
load_mbb_*()functions now usesportsdataverse-datareleases url instead ofhoopR-datarepository URL -
nba_pbp()andnba_pbps()functions add parameteron_court(defaultTRUE) to return on-court players for each play event, courtesy of @shufinskiy
hoopR 2.0.0
NBA Stats API Live Endpoints
-
nba_live_pbp()function added. -
nba_live_boxscore()function added. -
nba_todays_scoreboard()function added.
NBA Boxscore V3 (and V3-styled) Endpoints Added
-
nba_scoreboardv3()function added. -
nba_boxscoretraditionalv3()function added. -
nba_boxscoreadvancedv3()function added. -
nba_boxscoremiscv3()function added. -
nba_boxscorescoringv3()function added. -
nba_boxscoreusagev3()function added. -
nba_boxscorefourfactorsv3()function added. -
nba_boxscoreplayertrackv3()function added. -
nba_boxscorematchupsv3()function added. -
nba_boxscorehustlev2()function added. -
nba_boxscoredefensivev2()function added.
Other NBA Stats API functions added
-
nba_shotchartlineupdetail()function added. -
nba_synergyplaytypes()function added. -
nba_franchiseleaderswrank()function added. -
nba_videodetailsasset()function added. -
nba_infographicfanduelplayer()function added. -
nba_teams()function added.
Other Functions Added
-
ncaa_mbb_teams()function added.
Proxy Capability Added and Other Notes
- Add rlang dots option for passing
httr::use_proxy()option tonba_*()functions - Returns documentation added for all working NBA Stats API endpoints and ESPN functions
- Tests added for all working NBA Stats API endpoints and ESPN functions, over 1000 tests when run locally
hoopR 1.9.0
- Takes care of tidyselect deprecation of data masking for certain tidyr and dplyr functions.
- Regular minor maintenance on
kp_*functions -
espn_mbb_game_rosters()function added. -
espn_nba_game_rosters()function added.
hoopR 1.8.1
-
espn_mbb_player_stats()function exported properly. -
espn_nba_player_stats()function exported properly. - Fixing headers for
kp_functions.
hoopR 1.8.0
CRAN release: 2022-06-17
-
espn_mbb_player_stats()function added. -
espn_mbb_team_stats()function added. -
espn_nba_player_stats()function added. -
espn_nba_team_stats()function added.
hoopR 1.7.0
-
nba_pbps()function added, courtesy of @papagorgio23. -
nbagl_players()function added, courtesy of Billy Fryer. -
nbagl_schedule()function added, courtesy of Billy Fryer. -
nbagl_pbp()function added, courtesy of Billy Fryer. -
nbagl_standings()function added, courtesy of Billy Fryer. -
nba_gamerotation()function added.
hoopR 1.6.0
-
nba_playerindex()function added. -
nba_playerheadshot()function added. -
nba_drafthistory()function added.
hoopR 1.5.0
CRAN release: 2021-11-10
- Major documentation update to include names of returned lists of data frames for all exported NBA Stats API, ESPN API, KenPom, NCAA and Data repository functions.
hoopR 1.4.5
- Add
kp_referee()function
hoopR 1.4.4
- Remove referee ranks from
kp_box()function
hoopR 1.4.1
- Update
teams_linksinternal dataset for 2022 (need a better solve here) - Added
nba_teamsdataset for working with the NBA Stats API
hoopR 1.4.0
-
hoopR::espn_mbb_betting()function added -
hoopR::espn_nba_betting()function added
hoopR 1.3.1
- Fix
kp_winprobfunction, adding runs as third output
hoopR 1.3.0
Add Full Coverage for NBA Stats API
Adding roughly 127 functions
| Function | File Location |
|---|---|
| nba_alltimeleadersgrids | R/nba_stats_leaders.R |
| nba_assistleaders | R/nba_stats_leaders.R |
| nba_assisttracker | R/nba_stats_leaders.R |
| nba_boxscoreadvancedv2 | R/nba_stats_boxscore.R |
| nba_boxscoredefensive | R/nba_stats_boxscore.R |
| nba_boxscorefourfactorsv2 | R/nba_stats_boxscore.R |
| nba_boxscorematchups | R/nba_stats_boxscore.R |
| nba_boxscoremiscv2 | R/nba_stats_boxscore.R |
| nba_boxscoreplayertrackv2 | R/nba_stats_boxscore.R |
| nba_boxscorescoringv2 | R/nba_stats_boxscore.R |
| nba_boxscoresimilarityscore | R/nba_stats_boxscore.R |
| nba_boxscoresummaryv2 | R/nba_stats_boxscore.R |
| nba_boxscoretraditionalv2 | R/nba_stats_boxscore.R |
| nba_boxscoreusagev2 | R/nba_stats_boxscore.R |
| nba_commonallplayers | R/nba_stats_roster.R |
| nba_commonplayerinfo | R/nba_stats_roster.R |
| nba_commonplayoffseries | R/nba_stats_roster.R |
| nba_commonteamroster | R/nba_stats_roster.R |
| nba_cumestatsplayer | R/nba_stats_cume.R |
| nba_cumestatsplayergames | R/nba_stats_cume.R |
| nba_cumestatsteam | R/nba_stats_cume.R |
| nba_cumestatsteamgames | R/nba_stats_cume.R |
| nba_defensehub | R/nba_stats_leaders.R |
| nba_draftboard | R/nba_stats_draft.R |
| nba_draftcombinedrillresults | R/nba_stats_draft.R |
| nba_draftcombinenonstationaryshooting | R/nba_stats_draft.R |
| nba_draftcombineplayeranthro | R/nba_stats_draft.R |
| nba_draftcombinespotshooting | R/nba_stats_draft.R |
| nba_draftcombinestats | R/nba_stats_draft.R |
| nba_fantasywidget | R/nba_stats_lineups.R |
| nba_franchisehistory | R/nba_stats_franchise.R |
| nba_franchiseleaders | R/nba_stats_franchise.R |
| nba_franchiseplayers | R/nba_stats_franchise.R |
| nba_glalumboxscoresimilarityscore | R/nba_stats_boxscore.R |
| nba_homepageleaders | R/nba_stats_leaders.R |
| nba_homepagev2 | R/nba_stats_leaders.R |
| nba_hustlestatsboxscore | R/nba_stats_boxscore.R |
| nba_leaderstiles | R/nba_stats_leaders.R |
| nba_leaguedashlineups | R/nba_stats_lineups.R |
| nba_leaguedashoppptshot | R/nba_stats_league_dash.R |
| nba_leaguedashplayerbiostats | R/nba_stats_league_dash.R |
| nba_leaguedashplayerclutch | R/nba_stats_league_dash.R |
| nba_leaguedashplayerptshot | R/nba_stats_league_dash.R |
| nba_leaguedashplayershotlocations | R/nba_stats_league_dash.R |
| nba_leaguedashplayerstats | R/nba_stats_league_dash.R |
| nba_leaguedashptdefend | R/nba_stats_league_dash.R |
| nba_leaguedashptstats | R/nba_stats_league_dash.R |
| nba_leaguedashptteamdefend | R/nba_stats_league_dash.R |
| nba_leaguedashteamclutch | R/nba_stats_league_dash.R |
| nba_leaguedashteamptshot | R/nba_stats_league_dash.R |
| nba_leaguedashteamshotlocations | R/nba_stats_league_dash.R |
| nba_leaguedashteamstats | R/nba_stats_league_dash.R |
| nba_leaguegamefinder | R/nba_stats_league.R |
| nba_leaguegamelog | R/nba_stats_league.R |
| nba_leaguehustlestatsplayer | R/nba_stats_hustle.R |
| nba_leaguehustlestatsplayerleaders | R/nba_stats_hustle.R |
| nba_leaguehustlestatsteam | R/nba_stats_hustle.R |
| nba_leaguehustlestatsteamleaders | R/nba_stats_hustle.R |
| nba_leagueleaders | R/nba_stats_leaders.R |
| nba_leaguelineupviz | R/nba_stats_lineups.R |
| nba_leagueplayerondetails | R/nba_stats_lineups.R |
| nba_leagueseasonmatchups | R/nba_stats_lineups.R |
| nba_leaguestandings | R/nba_stats_league.R |
| nba_leaguestandingsv3 | R/nba_stats_league.R |
| nba_matchupsrollup | R/nba_stats_lineups.R |
| nba_pbp | R/nba_stats_pbp.R |
| nba_playerawards | R/nba_stats_player.R |
| nba_playercareerbycollege | R/nba_stats_player.R |
| nba_playercareerbycollegerollup | R/nba_stats_player.R |
| nba_playercareerstats | R/nba_stats_player.R |
| nba_playercompare | R/nba_stats_player.R |
| nba_playerdashboardbyclutch | R/nba_stats_player_dash.R |
| nba_playerdashboardbygamesplits | R/nba_stats_player_dash.R |
| nba_playerdashboardbygeneralsplits | R/nba_stats_player_dash.R |
| nba_playerdashboardbylastngames | R/nba_stats_player_dash.R |
| nba_playerdashboardbyopponent | R/nba_stats_player_dash.R |
| nba_playerdashboardbyshootingsplits | R/nba_stats_player_dash.R |
| nba_playerdashboardbyteamperformance | R/nba_stats_player_dash.R |
| nba_playerdashboardbyyearoveryear | R/nba_stats_player_dash.R |
| nba_playerdashptpass | R/nba_stats_player_dash.R |
| nba_playerdashptreb | R/nba_stats_player_dash.R |
| nba_playerdashptshotdefend | R/nba_stats_player_dash.R |
| nba_playerdashptshots | R/nba_stats_player_dash.R |
| nba_playerestimatedmetrics | R/nba_stats_player.R |
| nba_playerfantasyprofile | R/nba_stats_player.R |
| nba_playerfantasyprofilebargraph | R/nba_stats_player.R |
| nba_playergamelog | R/nba_stats_player.R |
| nba_playergamelogs | R/nba_stats_player.R |
| nba_playergamestreakfinder | R/nba_stats_player.R |
| nba_playernextngames | R/nba_stats_player.R |
| nba_playerprofilev2 | R/nba_stats_player.R |
| nba_playervsplayer | R/nba_stats_player.R |
| nba_playoffpicture | R/nba_stats_league.R |
| nba_schedule | R/nba_stats_pbp.R |
| nba_scoreboard | R/nba_stats_scoreboard.R |
| nba_scoreboardv2 | R/nba_stats_scoreboard.R |
| nba_shotchartdetail | R/nba_stats_shotchart.R |
| nba_shotchartleaguewide | R/nba_stats_shotchart.R |
| nba_teamdashboardbyclutch | R/nba_stats_team_dash.R |
| nba_teamdashboardbygamesplits | R/nba_stats_team_dash.R |
| nba_teamdashboardbygeneralsplits | R/nba_stats_team_dash.R |
| nba_teamdashboardbylastngames | R/nba_stats_team_dash.R |
| nba_teamdashboardbyopponent | R/nba_stats_team_dash.R |
| nba_teamdashboardbyshootingsplits | R/nba_stats_team_dash.R |
| nba_teamdashboardbyteamperformance | R/nba_stats_team_dash.R |
| nba_teamdashboardbyyearoveryear | R/nba_stats_team_dash.R |
| nba_teamdashlineups | R/nba_stats_team_dash.R |
| nba_teamdashptpass | R/nba_stats_team_dash.R |
| nba_teamdashptreb | R/nba_stats_team_dash.R |
| nba_teamdashptshots | R/nba_stats_team_dash.R |
| nba_teamdetails | R/nba_stats_team.R |
| nba_teamestimatedmetrics | R/nba_stats_team.R |
| nba_teamgamelog | R/nba_stats_team.R |
| nba_teamgamelogs | R/nba_stats_team.R |
| nba_teamgamestreakfinder | R/nba_stats_team.R |
| nba_teamhistoricalleaders | R/nba_stats_team.R |
| nba_teaminfocommon | R/nba_stats_team.R |
| nba_teamplayerdashboard | R/nba_stats_team.R |
| nba_teamplayeronoffdetails | R/nba_stats_team.R |
| nba_teamplayeronoffsummary | R/nba_stats_team.R |
| nba_teamvsplayer | R/nba_stats_team.R |
| nba_teamyearbyyearstats | R/nba_stats_team.R |
| nba_videodetails | R/nba_stats_video.R |
| nba_videoevents | R/nba_stats_video.R |
| nba_videostatus | R/nba_stats_video.R |
| nba_winprobabilitypbp | R/nba_stats_scoreboard.R |
hoopR 1.2.0
Add schedule loaders
-
hoopR::load_mbb_schedule()function added -
hoopR::load_nba_schedule()function added
hoopR 1.1.0
Add team box score loaders
-
hoopR::load_mbb_team_box()function added -
hoopR::load_nba_team_box()function added
Add player box score loaders
-
hoopR::load_mbb_player_box()function added -
hoopR::load_nba_player_box()function added
hoopR 1.0.4
Add retry
- Adding
httr::retry()to all function calls to more naturally navigate rejected/failed requests from the API.
hoopR 1.0.0
Package renamed to hoopR
To reflect that the package is no longer just a men’s college basketball and KenPom package, but also an NBA package.
Clean names and team returns
- All functions have now been given the
janitor::clean_names()treatment -
hoopR::espn_mbb_teams()has updated the returns to be more identity information related only -
hoopR::espn_nba_teams()to be more identity information related only - All tests were updated
Loading capabilities added to the package
-
hoopR::load_mbb_pbp()andhoopR::update_mbb_db()functions added -
hoopR::load_nba_pbp()andhoopR::update_nba_db()functions added
hoopR 0.4
- Added support for ESPN’s NBA play-by-play endpoints with the addition of the following functions:
-
hoopR::espn_nba_game_all()- a convenience wrapper function around the following three functions (returns the results as a list of three data frames) hoopR::espn_nba_team_box()hoopR::espn_nba_player_box()hoopR::espn_nba_pbp()hoopR::espn_nba_teams()hoopR::espn_nba_scoreboard()
hoopR 0.3.0
Dependencies
-
Rversion 3.5.0 or greater dependency added -
purrrversion 0.3.0 or greater dependency added -
rvestversion 1.0.0 or greater dependency added -
progressrversion 0.6.0 or greater dependency added -
usethisversion 1.6.0 or greater dependency added -
xgboostversion 1.1.0 or greater dependency added -
tidyrversion 1.0.0 or greater dependency added -
stringrversion 1.3.0 or greater dependency added -
tibbleversion 3.0.0 or greater dependency added -
furrrdependency added -
futuredependency added
Test coverage
- Added tests for all KP and ESPN functions
Function Naming Convention Change
- All functions sourced from kenpom.com will start with
kp_as opposed toget_ - Similarly, data and metrics sourced from ESPN will begin with
espn_as opposed tocbb_. Moreover, all references tocbb_have been changed tombb_as appropriate. - Data sourced directly from the NCAA website will start the function with
ncaa_
hoopR 0.2.0-3
- Added support for ESPN’s men’s college basketball play-by-play endpoints with the addition of the following functions:
-
hoopR::espn_mbb_game_all()- a convenience wrapper function around the following three functions (returns the results as a list of three data frames) hoopR::espn_mbb_team_box()hoopR::espn_mbb_player_box()hoopR::espn_mbb_pbp()-
hoopR::espn_mbb_teams()(bumps to v0.2.1) -
hoopR::espn_mbb_conferences()(bumps to v0.2.1) -
hoopR::espn_mbb_scoreboard()(bumps to v0.2.2) -
hoopR::ncaa_mbb_NET_rankings()(bumps to v0.2.3) -
hoopR::espn_mbb_rankings()(bumps to v0.2.3)
