Skip to contents

Every field-goal attempt of one FEB game with its court position (percent of a full-court image).

Endpoint: GET https://intrafeb.feb.es/LiveStats.API/api/v1/ShotChart/{game_id}

Free throws are not in the feed. x / y are percent (0-100) of a horizontal full-court image, origin top-left; teams change ends at half-time. The feed names the shooter by shirt number: player_id is resolved through the game's roster (side + shirt number) and is NA when that pair is not unique.

Usage

feb_shots(game_id)

Arguments

game_id

(integer required): FEB game id, e.g. 2535725; the game_id column of feb_schedule(), feb_results() and feb_overview().

Value

A wehoop_data tibble with these columns:

col_nametypedescription
game_idintegerFEB game id (one global sequence): the {gameId} of every LiveStats route and the p= of Partido.aspx. Game bodies do not print it, so it comes from the request.
periodintegerPeriod number of the attempt.
clockcharacterGame clock REMAINING in the period at the shot, 'mm:ss' (the play-by-play line's time).
clock_secondsintegerThe clock as whole seconds remaining in the period (08:34 = 514), derived by the parser.
team_sidecharacterSide of the shooter: home (feed code 0) or away (feed code 1; play-by-play uses 1/2).
team_idintegerTeam-season id of the shooter's team (from the shot chart's TEAM list); new every season.
shirt_numbercharacterShirt number (dorsal) as a string, so '00' and '0' stay distinct. The shot feed names the shooter by this number.
player_idintegerFEB person id of the shooter, resolved from side + shirt number in the game's roster; null when that pair is not unique. The feed itself carries no player id.
madelogicalTrue when the shot was made, false when missed. Free throws are not in the feed.
xdoubleCourt x position: percent (0-100) of the length of a horizontal full-court image, origin top-left. Teams change ends at half-time; metres (x/100 x 28) are an unverified inference.
ydoubleCourt y position: percent (0-100) of the width of a horizontal full-court image from the top edge; baskets sit near y = 50. Metres (y/100 x 15) are an unverified inference.

Details

The Spanish Basketball Federation (FEB) wrappers cover Primera FEB, Segunda FEB and Liga Femenina Endesa (plus the federation's other groups on the same routes). They mirror sdv-py's sportsdataverse.basketball.feb wrappers of the same names: same arguments, the same snake_case columns and types, one row per sdv-py row.

Legal notice. The FEB's aviso legal (legal notice) asserts intellectual-property rights over the site's content and its databases (the EU database right). It has no explicit scraping clause, and robots.txt answers 404 on both hosts. Fetching for your own use on your own machine is how these wrappers are meant to be used; check the notice before you republish the data.

Unofficial and unsupported. The LiveStats API (intrafeb.feb.es) is the federation's own widget backend, not a documented public API. It needs a bearer token, which is public: it is read from the home page of baloncestoenvivo.feb.es at run time, kept in memory for the R session (24 h validity, renewed once on an HTTP 401) and never printed, logged or written. Requests are spaced at least one second apart per host; 429 and 5xx answers are retried (three attempts).

Coverage. The game routes answer from 2020-21 (Liga Femenina Endesa from its first game; Primera FEB from 2021-03-12, so its earlier 2020-21 games and every earlier season answer 404). 2020-21 play-by-play is text only. The schedule pages go back to 1996-97 (season = 1997).

Seasons are END years (season = 2027 is 2026-27); the site's own t key is the START year, so the request sends t = season - 1.

Errors are classed conditions, never a warning plus an empty frame: wehoop_no_data (HTTP 404, an unknown group, a schedule page with no games, an empty overview window), wehoop_bad_request (HTTP 400 / 422, or a game_id, group or season that is not a non-negative integer) and wehoop_asset_fetch (any other failure: another status, a transport error, a token the API still rejects after one renewal, a non-JSON or non-HTML body, an error or changed envelope, a play-by-play of another game, a page for another group or season, or layout drift). All inherit wehoop_error.

 feb_shots(game_id = 2535725)