betting_combat.providers.cito.client
client.py — the Cito UFC API (Pro: 250,000 calls a month, 1,200 a minute; paced at 100 a
minute), one method per endpoint we use, every answer as models rows.
Cito.from_settings() the client on ``CITO_API_KEY``cards events · upcoming · recent · event · event_bouts · bouts · boutstats bout_rounds · bout_stats · event_statsodds bout_odds · event_odds · odds_historyfighters fighters · fighter · career · fighter_fights · fighter_rates · style · search · h2hrankings rankings ('meta' | 'media', a division or all)live live · live_events · live_event · live_bout · live_state · snapshots · live_health · live_contractother MMA mma_promotions · mma_events · mma_bouts · mma_fighter · mma_searchwebhooks webhook_events (the catalog, read-only) · verify_webhook (a delivery's signature); registering one is Sam's (an account change)Every call counts against the month (the answer’s X-RateLimit-Monthly-Remaining is read
back into budget). Lists page at 100 (Cito caps every page there, whatever is asked).
Quirks the methods absorb (verified 2026-11-09, docs/BASE_TABLES.md, the sources survey):
/events/{slug}/boutscuts tournament-era cards short:bouts(event=…)is whole.- Cancelled bouts are hidden unless asked:
event_boutsandboutsask by default. /snapshotsanswers only to the live id (Bout.live_bout_id); limit 200, newest first./odds/roundsis unpopulated: per-round odds come fromodds_history(round=k).- The bout payload’s
oddsis a legacy null: odds come frombout_odds.
Classes
Cito
Bases: Provider
The Cito UFC API.
bout
bout(bout_id: str) -> BoutOne bout by any of its ids (card id, dataId, live id).
bout_odds
bout_odds(bout_id: str, bookmaker: str = 'all', available: bool | None = None) -> list[OddsOutcome]Every outcome’s price at every book for one bout (empty before 2026-06).
bout_rounds
bout_rounds(bout_id: str, round_: int | None = None) -> list[StatLine]The official per-round lines, both fighters (UFC 2 onward).
bout_stats
bout_stats(bout_id: str) -> tuple[list[StatLine], list[StatLine]]The official fight totals and per-round lines.
bouts
bouts(event: str | None = None, fighter: str | None = None, status: str | None = None, has_stats: bool | None = None, include_stats: bool | None = None) -> list[Bout]Every bout (9,657 on 2026-11-09), or one card’s (event: slug, uuid or dataId) or
one fighter’s. include_stats adds the official lines (heavier pages).
career
career(slug: str) -> CareerEvery pro fight on file, UFC and outside it (up to 500).
event
event(key: str) -> tuple[Event, list[Bout]]One card by slug, uuid or dataId, and its public bouts.
event_bouts
event_bouts(slug: str, include_cancelled: bool = True) -> list[Bout]One card’s bouts as the public card lists them, cancelled ones too by default. Cut
short on tournament-era cards: bouts(event=…) is whole.
event_odds
event_odds(slug: str, bookmaker: str = 'all') -> list[tuple[str, OddsOutcome]]A whole card’s prices: (Cito’s bout id, outcome), cancelled fights included.
event_stats
event_stats(slug: str, round_: int | None = None) -> tuple[list[StatLine], list[StatLine]]A whole card’s official fight totals and per-round lines, in one call.
events
events(status: str | None = None, start: dt.date | None = None, end: dt.date | None = None, q: str | None = None, has_stats: bool | None = None, include_cancelled: bool | None = None) -> list[Event]Every card (920 on 2026-11-09), or those matching: status scheduled | completed |
live, start / end the event dates (end exclusive: 11-13..11-14 misses an 11-14
card; undocumented, verified 2026-11-10).
fighter
fighter(slug: str) -> Fighterfighter_fights
fighter_fights(slug: str) -> list[FighterFight]A fighter’s UFC fights (results as each bout carries them).
fighter_rates
fighter_rates(slug: str) -> FighterRatesCareer rates TODAY (display and checks only: never as of a past date).
fighters
fighters(active: bool | None = None) -> list[Fighter]Every fighter in the directory (3,489 on 2026-11-09).
from_settings
from_settings(settings: CitoSettings | None = None, **kwargs: Any) -> Citoh2h
h2h(fighter1: str, fighter2: str) -> dict[str, Any] | NoneTwo fighters’ meetings and records against each other, as served; None if Cito does not know the pair (404).
live
live() -> LiveBoardThe card now: the bouts live, what is next, the tracked cards.
live_bout
live_bout(live_id: str) -> LiveStateOne bout’s live reading through /ufc/live/{id} (the state part).
live_contract
live_contract(live_id: str) -> dict[str, Any]The transport contract of one bout’s live feed (SSE and WebSocket names, rules).
live_event
live_event(slug: str) -> dict[str, Any]One tracked card and its bouts’ tracking, as served.
live_events
live_events() -> list[LiveEvent]The cards the live worker tracks, with their bouts’ running order.
live_health
live_health() -> dict[str, Any]The live worker’s health: alive, heartbeat lag, why it is empty or degraded.
live_state
live_state(live_id: str) -> LiveStateOne bout’s compact live reading (the clock and the totals), about 1-2 s fresh.
mma_bouts
mma_bouts(promotion: str | None = None, include_stats: bool | None = None) -> list[MmaBout]mma_events
mma_events(promotion: str | None = None) -> list[MmaEvent]mma_fighter
mma_fighter(slug: str) -> Fightermma_promotions
mma_promotions() -> list[dict[str, Any]]The promotions Cito keeps, with their counts and date ranges, as served.
mma_search
mma_search(q: str) -> Searchodds_history
odds_history(bout_id: str, since: dt.datetime | None = None, market_type: str | None = None, round_: int | None = None) -> list[OddsTick]Every prediction-market price change for one bout (Polymarket, from 2026-11-04),
oldest first; paged by since (one page is 5,000 ticks and stops mid-fight).
rankings
rankings(board: str = 'meta', division: str | None = None) -> list[Ranking]Today’s board: ‘meta’ (Cito’s) or ‘media’ (the media panel), every division or one (‘lightweight’, ‘womens-bantamweight’). Cito keeps no history: record it daily.
recent
recent() -> list[Event]The cards just held, newest first.
search
search(q: str) -> SearchFighters, events and bouts matching q (resolve a slug from a name).
snapshots
snapshots(live_id: str, limit: int = 200) -> list[Snapshot]The bout’s newest limit snapshots (≤ 200), newest first, each with every round’s
running line. Only the live id answers (Bout.live_bout_id).
style
style(slug: str) -> dict[str, Any]Cito’s style profile TODAY (labels, position, target, grappling, absorbed), as served: computed from the whole career now, so it leaks the future if read into the past.
upcoming
upcoming() -> list[Event]The scheduled cards.
verify_webhook
verify_webhook(secret: str, body: bytes, signature: str) -> boolA delivery is Cito’s when X-Cito-Signature is the HMAC-SHA256 of the raw body.
webhook_events
webhook_events() -> list[dict[str, Any]]The UFC webhook catalog: each event, when it fires, and whether any was sent lately.
CitoSettings
Bases: BaseSettings
CITO_API_KEY (and CITO_BASE_URL) from the environment.