How do I build a UFC results Telegram bot?
Poll the live UFC card from the MMA Fight Data API and send each new result with the Telegram Bot API's sendMessage. The code checks once a minute while a card is live and every 15 minutes otherwise, and posts the winner, method, round and time. On Pro, the fight.result webhook can push results to your server instead.
Free plan: 100 requests a month, no card. Paid plans from $19/mo.
MMA Fight Data API · Code guide ·
Don't want to host a bot?
The UFCalendar bot does all of this for you: results, reminders and card changes for 13 promotions, in 13 languages. Add it in one click.
Endpoints used
| Method & path | What it returns |
|---|---|
GET /v1/events?org=ufc&status=live | MMA schedule + results API: full fight cards, venues, broadcasts, and a card-change diff log for late reshuffles. |
GET /v1/events/{slug} | One event with its full fight card (both corners, results when completed), venue and event-level broadcasts. |
POST /v1/webhook-endpointsPro and up | Signed webhooks for fight results, card changes, event completion and consensus odds moves — no polling needed. |
The code
curl shows the call that finds live cards. The Python and JavaScript blocks post every new result to one Telegram chat with sendMessage; you need a bot token from @BotFather and your chat's id.
Every block runs as shown with your API key in the UFCAL_API_KEY environment variable. Python uses pip install ufcalendar and JavaScript or TypeScript uses npm install @ufcalendar/sdk; any HTTP client works too.
curl "https://api.ufcalendar.com/v1/events?org=ufc&status=live" \
-H "Authorization: Bearer $UFCAL_API_KEY"# pip install ufcalendar requests
import os
import time
import requests
from ufcalendar import FightAPI
api = FightAPI() # reads UFCAL_API_KEY from the environment
TOKEN = os.environ["TELEGRAM_BOT_TOKEN"] # from @BotFather
CHAT = os.environ["TELEGRAM_CHAT_ID"] # your group or channel, e.g. -1001234567890 or @yourchannel
posted = set()
def send(text):
r = requests.post(f"https://api.telegram.org/bot{TOKEN}/sendMessage",
json={"chat_id": CHAT, "text": text, "parse_mode": "HTML"}, timeout=10)
r.raise_for_status()
def post_new_results():
live = list(api.events("ufc", status="live"))
for ev in live:
event = api.event(ev["slug"])
for f in event["card"]:
r = f["result"]
if not r or f["id"] in posted:
continue
posted.add(f["id"])
names = {c["id"]: c["name"] for c in (f["fighter_a"], f["fighter_b"])}
winner = names.get(r["winner_fighter_id"], "No winner")
send(f"<b>{f['fighter_a']['name']} vs {f['fighter_b']['name']}</b>\n"
f"{winner}: {r['method']}, round {r['round']} at {r['time']}")
return bool(live)
while True:
busy = post_new_results()
time.sleep(60 if busy else 15 * 60) # every minute on fight night, slow otherwise// npm install @ufcalendar/sdk
import { FightAPI } from "@ufcalendar/sdk";
const api = new FightAPI(); // reads UFCAL_API_KEY from the environment
const { TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID } = process.env;
const posted = new Set();
async function send(text) {
const res = await fetch(`https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ chat_id: TELEGRAM_CHAT_ID, text, parse_mode: "HTML" }),
});
if (!res.ok) throw new Error(`Telegram ${res.status}`);
}
async function postNewResults() {
let live = 0;
for await (const ev of api.events({ org: "ufc", status: "live" })) {
live++;
const event = await api.event(ev.slug);
for (const f of event.card) {
if (!f.result || posted.has(f.id)) continue;
posted.add(f.id);
const names = { [f.fighter_a.id]: f.fighter_a.name, [f.fighter_b.id]: f.fighter_b.name };
const winner = names[f.result.winner_fighter_id] ?? "No winner";
await send(`<b>${f.fighter_a.name} vs ${f.fighter_b.name}</b>\n${winner}: ${f.result.method}, round ${f.result.round} at ${f.result.time}`);
}
}
return live > 0;
}
for (;;) {
const busy = await postNewResults();
await new Promise((r) => setTimeout(r, busy ? 60_000 : 15 * 60_000));
}Sample response
A real response from the live API, trimmed for length. … marks removed fields.
{
"data": [
{
"id": 2805,
"slug": "ufc-fight-night-2026-10-31",
"title": "UFC Fight Night: Moicano vs Nolan",
"org": "ufc",
"sport": "mma",
"starts_at": "2026-10-31T21:00:00.000Z",
"main_card_at": "2026-11-01T00:00:00.000Z",
"tz": "America/Los_Angeles",
"status": "live",
"is_ppv": false,
"is_title_card": false
}
],
"meta": {
"pagination": { "next_cursor": null, "has_more": false, "limit": 25 }
}
}Notes and pitfalls
- Add the bot to a channel as an admin that can post; in a group it can be a normal member. A channel's id is its @username or a number that starts with -100.
- Budget: a poll every 15 minutes is about 3,000 requests a month, and a six-hour card polled every minute adds about 720. That fits the Hobby plan.
- Keep the posted bout ids in a file or database so a restart does not repost the card.
- Telegram allows about one message a second in one chat and 20 a minute in a group, far above a fight card's pace.
Related pages
More code guides
All code guidesUFCalendar is an independent publication, not affiliated with UFC/Zuffa/TKO, PFL, OKTAGON MMA, BKFC, RIZIN FF, KSW or any promotion. Organization names are used to describe the data. Not licensed by any promotion: data is compiled from publicly accessible sources and is not an official or rights-cleared feed. Terms of service · Refund Policy