TypeScript SDK
Typed from the OpenAPI document, one method per endpoint, pages as async iterators.
npm install @ufcalendar/sdkVersion 0.11.2 on npm, source on GitHub.
First lines
import { FightAPI } from '@ufcalendar/sdk';
const api = new FightAPI(process.env.UFCALENDAR_API_KEY);
for await (const ev of api.events({ org: 'ufc', status: 'upcoming', limit: 3 })) {
console.log(ev.starts_at, ev.title);
}Response types come from the same OpenAPI document as this reference, so a field the API adds shows up in your editor with the next release.
Keep the key on a server. A key in browser code is a key anyone can copy.
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 |
eventChanges() | `GET /v1/events/{idOrSlug}/changes` | Card-change log |
changes() | `GET /v1/changes` | Card-change feed across events |
eventStorylines() | `GET /v1/events/{idOrSlug}/storylines` | Storylines of one card |
eventPickem() | `GET /v1/events/{idOrSlug}/pickem` | Pick'em splits for one card |
calendarIcsUrl() | `GET /v1/calendar/{org}.ics` | ICS calendar feed |
findFights() | `GET /v1/fights/search` | Search completed bouts (filtered) |
fight() | `GET /v1/fights/{id}` | One bout |
fightStats() | `GET /v1/fights/{id}/stats` | Per-fight totals |
fightRounds() | `GET /v1/fights/{id}/rounds` | Round-by-round stats |
fightTimeline() | `GET /v1/fights/{id}/timeline` | In-fight log: actions, stoppages and fouls (Pro+) |
fightPositions() | `GET /v1/fights/{id}/positions` | Position stats: time by range, control by position (Pro+) |
fightOdds() | `GET /v1/fights/{id}/odds` | Consensus odds for one bout |
eventOdds() | `GET /v1/events/{idOrSlug}/odds` | Consensus odds for one card |
fightOddsHistory() | `GET /v1/fights/{id}/odds/history` | Consensus line movement (Pro+) |
fighters() | `GET /v1/fighters` | Roster search |
fighter() | `GET /v1/fighters/{idOrSlug}` | Fighter profile |
fighterHistory() | `GET /v1/fighters/{idOrSlug}/history` | Complete career timeline |
fighterStats() | `GET /v1/fighters/{idOrSlug}/stats` | Career statistics |
compare() | `GET /v1/compare` | Compare two fighters |
fighterDiscipline() | `GET /v1/fighters/{idOrSlug}/discipline` | Discipline: fouls committed and drawn (Pro+) |
fighterPositions() | `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+) |
rosterMoves() | `GET /v1/rosters/{org}/moves` | Roster moves: signings, departures, retirements (Pro+) |
rankings() | `GET /v1/rankings/{org}` | Official board (point-in-time) |
divisionRankings() | `GET /v1/rankings/{org}/{division}` | One division |
champions() | `GET /v1/champions` | Current champions |
fighterRankings() | `GET /v1/fighters/{idOrSlug}/rankings` | Ranking history |
powerIndex() | `GET /v1/power-index/{org}` | Power Index board |
fighterPowerIndex() | `GET /v1/fighters/{idOrSlug}/power-index` | Power Index trajectory |
matchmaker() | `GET /v1/matchmaker/{org}` | Matchmaker board |
whosNext() | `GET /v1/matchmaker/next/{fighter}` | Who should this fighter fight next |
predictionsUpcoming() | `GET /v1/predictions/upcoming` | Model win probabilities (UFC) |
leaderboard() | `GET /v1/stats/leaders` | One stat leaderboard |
recordBook() | `GET /v1/stats/record-book` | The Record Book |
yearStats() | `GET /v1/stats/years/{year}` | A year in review |
fightScorecards() | `GET /v1/fights/{id}/scorecards` | Judges' scorecards for a bout |
splitDecisions() | `GET /v1/scorecards/splits` | Split and majority decisions |
judges() | `GET /v1/judges` | Judge directory |
judge() | `GET /v1/judges/{id}` | One judge |
judgeScorecards() | `GET /v1/judges/{id}/scorecards` | Everything a judge has scored |
referees() | `GET /v1/referees` | Referee directory |
referee() | `GET /v1/referees/{slug}` | One referee |
refereeFights() | `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 |
orgDivision() | `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 |
venueEvents() | `GET /v1/venues/{id}/events` | Events at a venue |
eventWatch() | `GET /v1/events/{idOrSlug}/watch` | How to watch one event |
broadcastRights() | `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 |
createWebhookEndpoint() | `POST /v1/webhook-endpoints` | Register a webhook endpoint |
webhookEndpoints() | `GET /v1/webhook-endpoints` | List your webhook endpoints |
rotateWebhookSecret() | `POST /v1/webhook-endpoints/{id}/rotate-secret` | Rotate an endpoint signing secret |
deleteWebhookEndpoint() | `DELETE /v1/webhook-endpoints/{id}` | Delete a webhook endpoint |