Skip to contents

Shot chart of a final game (2006-07 on): every charted shot with x/y pixels on the full-court image.

Endpoint: GET https://api.kbl.or.kr/match/{gmkey}/match-chart

Usage

kbl_shots(gmkey)

Arguments

gmkey

Game key S{seasonCode}G{gameCode}N{gameNo}, e.g. 'S47G01N49' (the 2025-26 regular season's game 49): season_code, game_code and game_no of kbl_schedule. Only final games are served; a malformed key is a hoopR_bad_request.

Value

A hoopR_data tibble: Shot chart of a final game (2006-07 on): every charted shot with x/y pixels on the full-court image. The columns are always these, in this order (sportsdataverse-py kbl_shots); an empty valid answer raises hoopR_no_data, a valid body with no rows for this frame is a zero-row tibble:

col_nametypedescription
gmkeycharacterGame key S{seasonCode}G{gameCode}N{gameNo} (e.g. S47G01N49): the id of every game route and game frame.
season_codeintegerKBL season code: one sequential number over every season and D-League edition (47 = 2025-26, 48 = the 2025 D-League).
seasonintegerSeason END year (2026 = 2025-26), derived from season_code through the crosswalk (kbl_codes.SEASONS).
game_codecharacterCompetition inside the season, two digits: 01 regular season, 03 playoffs, 04 final, 07 EASL, 08 D-League stage 2, 10 All-Star, 11/13 cups, 14 Open Match Day.
game_nointegerGame number inside the competition (glkey): the N part of the gmkey.
pcodecharacterKBL player code (six-digit string) of the shooter.
player_namecharacterShooter's name in Korean.
player_name_encharacterShooter's name in English / romanized.
team_codecharacterKBL team code (2-digit string, e.g. '50' = Changwon LG). Joins to /common/teamList teamCode, game tcodeH/tcodeA, t in text-cast. Not stable across ownership changes: the Anyang club is '40' (SBS) in 1997-98 and '70' today. D-League sides have their own codes (teamCodeD).
periodintegerPeriod number: 1-4 for the quarters, 5, 6, ... for the overtimes (the wire says X1 in the play-by-play, EQ1 in the match chart).
period_labelcharacterPeriod label: Q1-Q4, then OT1, OT2, ... (normalised from the wire's X1 / EQ1 / eq1).
xintegerShot location x, pixels on the site's 726 x 412 full-court image (origin top-left, x along the court, right); see basket.
yintegerShot location y, pixels on the 726 x 412 full-court image (origin top-left, y down).
madelogicalTrue when the shot went in (wire o = 'O'), False when it missed ('X').
basketcharacterTarget basket: '1' the right-hand one (x > 363), '2' the left-hand one; teams switch baskets at half-time.

Details

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

Examples

# \donttest{
  try(kbl_shots(gmkey = "S47G01N49"))
#> ── KBL Shots from api.kbl.or.kr ───────────────────────────────── hoopR 3.2.0 ──
#> ℹ Data updated: 2026-10-31 21:31:04 UTC
#> # A tibble: 127 × 15
#>    gmkey   season_code season game_code game_no pcode player_name player_name_en
#>    <chr>         <int>  <int> <chr>       <int> <chr> <chr>       <chr>         
#>  1 S47G01…          47   2026 01             49 2902… 허일영      HEO ILYOUNG   
#>  2 S47G01…          47   2026 01             49 2902… 허일영      HEO ILYOUNG   
#>  3 S47G01…          47   2026 01             49 2902… 허일영      HEO ILYOUNG   
#>  4 S47G01…          47   2026 01             49 2902… 허일영      HEO ILYOUNG   
#>  5 S47G01…          47   2026 01             49 2902… 허일영      HEO ILYOUNG   
#>  6 S47G01…          47   2026 01             49 2902… 허일영      HEO ILYOUNG   
#>  7 S47G01…          47   2026 01             49 2902… 허일영      HEO ILYOUNG   
#>  8 S47G01…          47   2026 01             49 2904… 장민국      JANG M K      
#>  9 S47G01…          47   2026 01             49 2904… 장민국      JANG M K      
#> 10 S47G01…          47   2026 01             49 2904… 장민국      JANG M K      
#> # ℹ 117 more rows
#> # ℹ 7 more variables: team_code <chr>, period <int>, period_label <chr>,
#> #   x <int>, y <int>, made <lgl>, basket <chr>
# }