Python SDK
A thin client over the REST API, one method per endpoint, pagination handled for you.
pip install ufcalendarVersion 0.11.3 on PyPI, source on GitHub.
First lines
from ufcalendar import FightAPI
api = FightAPI("ufcalendar_...") # or set UFCALENDAR_API_KEY and call FightAPI()
latest = next(api.events(org="ufc", status="completed", limit=1))
card = api.event(latest["slug"])
for bout in card["card"]:
r = bout.get("result")
if r:
print(bout["fighter_a"]["name"], "vs", bout["fighter_b"]["name"], r["method"], r["round"], r["time"])List methods are generators: iterate and the client follows next_cursor for you. Errors raise FightAPIError with status, code and request_id.
Every method
The odds methods return one consensus line across the sportsbooks we track: information only, not betting advice.
| Method | Endpoint | Returns |
|---|---|---|
events() | `GET /v1/events` | List events (schedule + results) |
event() | `GET /v1/events/{idOrSlug}` | Event with full card |
event_changes() | `GET /v1/events/{idOrSlug}/changes` | Card-change log |
changes() | `GET /v1/changes` | Card-change feed across events |
event_storylines() | `GET /v1/events/{idOrSlug}/storylines` | Storylines of one card |
event_pickem() | `GET /v1/events/{idOrSlug}/pickem` | Pick'em splits for one card |
calendar_ics_url() | `GET /v1/calendar/{org}.ics` | ICS calendar feed |
find_fights() | `GET /v1/fights/search` | Search completed bouts (filtered) |
fight() | `GET /v1/fights/{id}` | One bout |
fight_stats() | `GET /v1/fights/{id}/stats` | Per-fight totals |
fight_rounds() | `GET /v1/fights/{id}/rounds` | Round-by-round stats |
fight_timeline() | `GET /v1/fights/{id}/timeline` | In-fight log: actions, stoppages and fouls (Pro+) |
fight_positions() | `GET /v1/fights/{id}/positions` | Position stats: time by range, control by position (Pro+) |
fight_odds() | `GET /v1/fights/{id}/odds` | Consensus odds for one bout |
event_odds() | `GET /v1/events/{idOrSlug}/odds` | Consensus odds for one card |
fight_odds_history() | `GET /v1/fights/{id}/odds/history` | Consensus line movement (Pro+) |
fighters() | `GET /v1/fighters` | Roster search |
fighter() | `GET /v1/fighters/{idOrSlug}` | Fighter profile |
fighter_history() | `GET /v1/fighters/{idOrSlug}/history` | Complete career timeline |
fighter_stats() | `GET /v1/fighters/{idOrSlug}/stats` | Career statistics |
compare() | `GET /v1/compare` | Compare two fighters |
fighter_discipline() | `GET /v1/fighters/{idOrSlug}/discipline` | Discipline: fouls committed and drawn (Pro+) |
fighter_positions() | `GET /v1/fighters/{idOrSlug}/positions` | Career position profile: time by range, control for and against (Pro+) |
roster() | `GET /v1/rosters/{org}` | A promotion's current roster (Pro+) |
roster_moves() | `GET /v1/rosters/{org}/moves` | Roster moves: signings, departures, retirements (Pro+) |
rankings() | `GET /v1/rankings/{org}` | Official board (point-in-time) |
division_rankings() | `GET /v1/rankings/{org}/{division}` | One division |
champions() | `GET /v1/champions` | Current champions |
fighter_rankings() | `GET /v1/fighters/{idOrSlug}/rankings` | Ranking history |
power_index() | `GET /v1/power-index/{org}` | Power Index board |
fighter_power_index() | `GET /v1/fighters/{idOrSlug}/power-index` | Power Index trajectory |
matchmaker() | `GET /v1/matchmaker/{org}` | Matchmaker board |
whos_next() | `GET /v1/matchmaker/next/{fighter}` | Who should this fighter fight next |
predictions_upcoming() | `GET /v1/predictions/upcoming` | Model win probabilities (UFC) |
leaderboard() | `GET /v1/stats/leaders` | One stat leaderboard |
record_book() | `GET /v1/stats/record-book` | The Record Book |
year_stats() | `GET /v1/stats/years/{year}` | A year in review |
fight_scorecards() | `GET /v1/fights/{id}/scorecards` | Judges' scorecards for a bout |
split_decisions() | `GET /v1/scorecards/splits` | Split and majority decisions |
judges() | `GET /v1/judges` | Judge directory |
judge() | `GET /v1/judges/{id}` | One judge |
judge_scorecards() | `GET /v1/judges/{id}/scorecards` | Everything a judge has scored |
referees() | `GET /v1/referees` | Referee directory |
referee() | `GET /v1/referees/{slug}` | One referee |
referee_fights() | `GET /v1/referees/{slug}/fights` | Bouts a referee worked |
orgs() | `GET /v1/orgs` | List launch orgs with capability flags |
org() | `GET /v1/orgs/{slug}` | One org |
org_division() | `GET /v1/orgs/{slug}/divisions/{division}` | One division in one promotion |
coverage() | `GET /v1/coverage` | Data coverage per promotion |
venues() | `GET /v1/venues` | Search venues |
venue() | `GET /v1/venues/{id}` | Venue |
venue_events() | `GET /v1/venues/{id}/events` | Events at a venue |
event_watch() | `GET /v1/events/{idOrSlug}/watch` | How to watch one event |
broadcast_rights() | `GET /v1/broadcast-rights/{org}` | Who airs it, per country |
search() | `GET /v1/search` | Typeahead search |
articles() | `GET /v1/articles` | Search UFCalendar articles |
article() | `GET /v1/articles/{slug}` | Get an article |
plans() | `GET /v1/plans` | Plans, quotas and how to connect (no key required) |
usage() | `GET /v1/usage` | Your quota usage |
create_webhook_endpoint() | `POST /v1/webhook-endpoints` | Register a webhook endpoint |
webhook_endpoints() | `GET /v1/webhook-endpoints` | List your webhook endpoints |
rotate_webhook_secret() | `POST /v1/webhook-endpoints/{id}/rotate-secret` | Rotate an endpoint signing secret |
delete_webhook_endpoint() | `DELETE /v1/webhook-endpoints/{id}` | Delete a webhook endpoint |