Skip to contents

The recent-games window of a competition, with the global Genius team ids.

Endpoint: GET https://fibalivestats.dcd.shared.geniussports.com/data/competition/{comp_id}.json

A few recent or upcoming games, not the season. Scores are cast to integer (NA before tip-off). match_time is local (zone not stated), match_time_utc UTC.

Usage

genius_competition_games(comp_id, return_parsed = TRUE)

Arguments

comp_id

Genius competition id: one per org competition-season (comp_id of genius_competitions()), e.g. 49915.

return_parsed

Parse into a tibble (default TRUE); FALSE returns the parsed body or page record (a list): data.json as served plus _request (the ids asked for), or the sdv-internal-refs capture shape of a page.

Value

A wehoop_data tibble (a zero-row tibble with these columns when Genius answers an empty valid page), or the raw list when return_parsed = FALSE:

col_nametypedescription
league_idintegerGenius league id of the org (ESAKE = 115); the leagueId column of the hosted chooser
competition_idintegerGenius competition id (compId): one per org competition-season; the {compId} of hosted and data/competition paths
match_idintegerGenius match id: the {matchId} of data.json and /u/; one global sequence across every Genius customer (~0.3 M in 2016, ~2.9 M in Oct 2026)
match_statuscharacterMatch status: COMPLETE, SCHEDULED, IN_PROGRESS, ... (upper case)
match_timecharacterLocal tip-off time, 'YYYY-MM-DD HH:MM:SS' (venue time zone, not stated)
match_time_utccharacterTip-off time in UTC, 'YYYY-MM-DD HH:MM:SS'
liveinteger1 while the game is live, else 0
periodintegerCurrent period of a live or finished game (present on some rows only)
period_typecharacterCurrent period type: REGULAR or OVERTIME (present on some rows only)
clockcharacterPeriod clock of a live or finished game, 'mm:ss' remaining (present on some rows only)
home_team_idintegerHome team: Genius team id (warehouse key space, global across orgs and seasons; the /team/{id} of hosted pages, the tid of the widget, the teamId of data/competition). data.json carries no team id: join on name/code
home_namecharacterHome team full name, in the competition's own script when the org enters one.
home_name_internationalcharacterHome team name in Latin script
home_codecharacterHome team short code, in the competition's own script when the org enters one.
home_scoreintegerHome points: a string on most rows, an integer on some (” before tip-off); cast it
away_team_idintegerAway team: Genius team id (warehouse key space, global across orgs and seasons; the /team/{id} of hosted pages, the tid of the widget, the teamId of data/competition). data.json carries no team id: join on name/code
away_namecharacterAway team full name, in the competition's own script when the org enters one.
away_name_internationalcharacterAway team name in Latin script
away_codecharacterAway team short code, in the competition's own script when the org enters one.
away_scoreintegerAway points: a string on most rows, an integer on some (” before tip-off); cast it

Details

Access. The Genius hosts publish no robots.txt and no terms. CloudFront refuses datacenter IPs on the LiveStats and hosted hosts: from a server set options(wehoop.proxy = ...) or the GENIUS_PROXY environment variable to an http(s) proxy URL (never printed or logged). Requests are spaced at least one second apart per host; keep crawls slow and incremental. Some league sites (the NZ NBL) forbid AI crawlers in their own robots.txt, which does not cover these hosts. Unofficial use of a public source: payloads are not redistributed as release assets.

Org and season. Every competition is an ORG code plus a competition id (comp_id): genius_competitions() lists an org's competitions with the sdv END-year season (a START-year org lists 2025-26 as season 2026), genius_match_competition() maps a game to its competition, and data.json itself names no date, competition or season. The hosted ORG can differ from the LiveStats ORG of /u/ (NZNBL vs NZN). Match ids are one global sequence across every Genius customer. data.json carries no global team or player id: tno (1 or 2) and pno are in-game numbers; only finished games are read.

Errors (classed conditions, all inheriting wehoop_error): wehoop_no_data when Genius has nothing for the request (HTTP 404, the S3 AccessDenied 403, an empty 200 from the hosted host, an empty recent-games window, a schedule or widget with no matches); wehoop_bad_request for HTTP 400 / 422 or a URL that is not a Genius route (e.g. a non-numeric id); wehoop_asset_fetch when the answer is unknown: the CloudFront "Request blocked" 403, a rate limit or 5xx, the intermittent HTTP 500 "A website error has occurred" page (transient = TRUE: retry later), a dead connection, an error envelope, a cut-off page, an unfinished game, or a body for another match, competition or ORG.

Examples

# \donttest{
  try(genius_competition_games(comp_id = 49915))
#> ── Genius LiveStats competition games ────────────────────────── wehoop 3.1.0 ──
#> ℹ Data updated: 2026-10-22 02:36:07 UTC
#> # A tibble: 2 × 20
#>   league_id competition_id match_id match_status match_time match_time_utc  live
#>       <int>          <int>    <int> <chr>        <chr>      <chr>          <int>
#> 1       115          49915  2902695 COMPLETE     2026-10-1… 2026-10-18 10…     0
#> 2       115          49915  2902697 COMPLETE     2026-10-1… 2026-10-18 10…     0
#> # ℹ 13 more variables: period <int>, period_type <chr>, clock <chr>,
#> #   home_team_id <int>, home_name <chr>, home_name_international <chr>,
#> #   home_code <chr>, home_score <int>, away_team_id <int>, away_name <chr>,
#> #   away_name_international <chr>, away_code <chr>, away_score <int>
# }