Skip to contents

Play-by-play of a game (2016-17 onward): every shot, rebound, foul, turnover, substitution and time-out.

One row per event. play_type is the API's event code and play_name its bundle name (acb_codes.PLAY_TYPES; a code outside the table, such as the minute marker 600, has no name); turnover_type decodes play_tag. The clock counts DOWN: minute / second are the time left in the period and clock_seconds the same in seconds. order is not unique (the starting five share one); play_index is the 1-based position in the feed. is_home is true for the home team's events (the feed's local). run_* columns are the acting player's running box score AFTER the event. Games before 2016-17 answer no events (the wrapper raises hoopR_no_data).

Endpoint: GET https://api2.acb.com/api/matchdata/PlayByPlay/play-by-play

Usage

acb_pbp(match_id)

Arguments

match_id

(required) ACB match id (integer), one global sequence for every competition: legacy ids (seasons up to 2019-20) sit below about 20000 (12559 = the 2005-06 final); ids from 2020-21 start around 100000 (105401 = Barca 89-86 Valencia Basket, Liga 2026-27 round 3). A whole number; a whole double is accepted.

Value

A hoopR_data tibble, one row per record described above; the columns are always these, in this order (sportsdataverse-py acb_pbp):

col_nametypedescription
match_idintegerACB match id (one global sequence for every competition; legacy ids are below about 20000 up to 2019-20, ids from 2020-21 start around 100000). Taken from the request when the body does not name the game.
edition_idintegerSeason id (editionId) = season START year - 1935 (91 = 2026-27). The wrappers take the END year, season.
seasonintegerSeason END year (2027 = 2026-27) = edition_id + 1936: the key the wrappers take.
play_indexinteger1-based position of the event in the feed (the feed's order key is not unique).
orderintegerEvent order key, ascending through the game (10, 301, 401, ...); not contiguous and not unique (the starting five share one).
quarterintegerPeriod of the event: 1-4 quarters, 5+ overtimes.
minuteintegerGame clock left in the period, minutes part (10 at tip-off; overtimes are 5 minutes).
secondintegerGame clock left in the period, seconds part.
clock_secondsintegerGame clock REMAINING in the period as whole seconds (minute x 60 + second; the clock counts down from 600, overtimes from 300).
play_typeintegerEvent code (acb_codes.PLAY_TYPES decodes it; 599 = starting lineup, one row per starter at 10:00).
play_namecharacterBundle name of play_type (acb_codes.PLAY_TYPES, e.g. TWO_POINTER_MADE); null for a code outside the enum such as the minute marker 600.
play_tagintegerTurnover detail code on turnovers (acb_codes.PLAY_TAGS); null otherwise.
turnover_typecharacterName of the turnover detail play_tag (acb_codes.PLAY_TAGS, e.g. BAD_PASS); null when there is no tag or the tag is unmapped.
is_homelogicalTrue when the event belongs to the home team (the API's local); false for the away team and for neutral events.
score_homeintegerHome score after the event.
score_awayintegerAway score after the event.
license_typeintegerLicence class of the player (202 on every player event); meaning unverified; null on team and clock events.
player_idintegerACB licence number of the player; null on team and clock events.
player_namecharacterPlayer display name; null on team and clock events.
shirt_numbercharacterShirt number as a string; null on starting-lineup rows and on team events.
run_pointsintegerThe acting player's running points AFTER this event (cumulative in the game).
run_free_throws_madeintegerThe acting player's running free throws made AFTER this event (cumulative in the game).
run_free_throws_attemptedintegerThe acting player's running free throws attempted AFTER this event (cumulative in the game).
run_two_pointers_madeintegerThe acting player's running two pointers made AFTER this event (cumulative in the game).
run_two_pointers_attemptedintegerThe acting player's running two pointers attempted AFTER this event (cumulative in the game).
run_three_pointers_madeintegerThe acting player's running three pointers made AFTER this event (cumulative in the game).
run_three_pointers_attemptedintegerThe acting player's running three pointers attempted AFTER this event (cumulative in the game).
run_assistsintegerThe acting player's running assists AFTER this event (cumulative in the game).
run_off_reboundsintegerThe acting player's running off rebounds AFTER this event (cumulative in the game).
run_def_reboundsintegerThe acting player's running def rebounds AFTER this event (cumulative in the game).
run_total_reboundsintegerThe acting player's running total rebounds AFTER this event (cumulative in the game).
run_stealsintegerThe acting player's running steals AFTER this event (cumulative in the game).
run_turnoversintegerThe acting player's running turnovers AFTER this event (cumulative in the game).
run_blocksintegerThe acting player's running blocks AFTER this event (cumulative in the game).
run_personal_foulsintegerThe acting player's running personal fouls AFTER this event (cumulative in the game).
run_fouls_drawnintegerThe acting player's running fouls drawn AFTER this event (cumulative in the game).
series_winsintegerHome team's series wins, on the END_OF_GAME event of a 2016-17 playoff game only.
series_lossesintegerHome team's series losses, on the same event.

Details

Source, terms of use, request pacing, seasons, ids, coverage and error classes of this family: see the notes in acb_match_header().

Examples

# \donttest{
  try(acb_pbp(match_id = 105401))
#> ── ACB Play-by-Play from api2.acb.com ─────────────────────────── hoopR 3.2.0 ──
#> ℹ Data updated: 2026-10-31 21:26:34 UTC
#> # A tibble: 735 × 38
#>    match_id edition_id season play_index order quarter minute second
#>       <int>      <int>  <int>      <int> <int>   <int>  <int>  <int>
#>  1   105401         91   2027          1    10       1     10      0
#>  2   105401         91   2027          2    10       1     10      0
#>  3   105401         91   2027          3    10       1     10      0
#>  4   105401         91   2027          4    10       1     10      0
#>  5   105401         91   2027          5    10       1     10      0
#>  6   105401         91   2027          6    10       1     10      0
#>  7   105401         91   2027          7    10       1     10      0
#>  8   105401         91   2027          8    10       1     10      0
#>  9   105401         91   2027          9    10       1     10      0
#> 10   105401         91   2027         10    10       1     10      0
#> # ℹ 725 more rows
#> # ℹ 30 more variables: clock_seconds <int>, play_type <int>, play_name <chr>,
#> #   play_tag <int>, turnover_type <chr>, is_home <lgl>, score_home <int>,
#> #   score_away <int>, license_type <int>, player_id <int>, player_name <chr>,
#> #   shirt_number <chr>, run_points <int>, run_free_throws_made <int>,
#> #   run_free_throws_attempted <int>, run_two_pointers_made <int>,
#> #   run_two_pointers_attempted <int>, run_three_pointers_made <int>, …
# }