How do I get a UFC fighter's fight history in Python?
Every UFC fight for a fighter, newest first, with result, method, strikes landed and rating after. Ilia Topuria was 9-1 over ten fights.
Code verified November 18, 2026. One call to get_fighter_fights, 5 credits.
The call
fighter_id comes from search_fighters. Fights come back newest first. Strike and takedown columns are filled for UFC fights only. Pass league: "pfl" or "bellator" for those promotions.
import requests
import pandas as pd
API_KEY = "YOUR_API_KEY"
resp = requests.post(
"https://mcp.fighterapi.com/v1/get_fighter_fights",
headers={"x-api-key": API_KEY},
json={
"fighter_id": "4350812",
},
timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]
fights = pd.DataFrame(data["fights"])
me = data["fighter_id"]
fights["opponent"] = fights.apply(lambda f: f["fighter_b_name"] if f["fighter_a"] == me else f["fighter_a_name"], axis=1)
cols = ["event_date", "opponent", "result", "method_display", "end_round", "sig_landed", "sig_absorbed", "rating_after"]
print(fights[cols].to_string(index=False))
print(fights["result"].value_counts().to_dict(), "finishes:", int((~fights["method"].str.startswith("decision")).sum()))
Replace YOUR_API_KEY with a key from your dashboard. Python needs requests and pandas (pip install requests pandas). JavaScript runs on Node 18 or newer, or in the browser.
Or use the official client: pip install fighterapi
What comes back
The data object of the response, trimmed to the first rows. Every field is real output from the run above.
{
"fighter_id": "4350812",
"fights": [
{
"bout_id": "401863575",
"event_id": "600058854",
"event_name": "UFC Freedom 250: Topuria vs. Gaethje",
"event_date": "2026-06-14",
"starts_at": "2026-06-15T00:00:00.000Z",
"weight_class": "Lightweight",
"card_segment": "main",
"match_number": 1,
"title_fight": true,
"scheduled_rounds": 5,
"status": "final",
"fighter_a": "4350812",
"fighter_a_name": "Ilia Topuria",
"fighter_b": "3022345",
"fighter_b_name": "Justin Gaethje",
"winner": "3022345",
"method": "kotko",
"method_display": "KO/TKO",
"end_round": 4,
"end_clock": "5:00",
"duration_seconds": 1200,
"judges_scores": null,
"referee": "Marc Goddard",
"sig_landed": 97,
"sig_absorbed": 91,
"td_landed": 1,
"rating_before": 1670,
"rating_after": 1655,
"median_closing_line": -490,
"result": "loss"
},
{
"bout_id": "401758683",
"event_id": "600053168",
"event_name": "UFC 317: Topuria vs. Oliveira",
"event_date": "2025-06-28",
"starts_at": "2025-06-29T02:00:00.000Z",
"weight_class": "Lightweight",
"card_segment": "main",
"match_number": 1,
"title_fight": true,
"scheduled_rounds": 5,
"status": "final",
"fighter_a": "4350812",
"fighter_a_name": "Ilia Topuria",
"fighter_b": "2504169",
"fighter_b_name": "Charles Oliveira",
"winner": "4350812",
"method": "kotko",
"method_display": "KO/TKO",
"end_round": 1,
"end_clock": "2:27",
"duration_seconds": 147,
"judges_scores": null,
"referee": "Marc Goddard",
"sig_landed": 21,
"sig_absorbed": 9,
"td_landed": 0,
"rating_before": 1656,
"rating_after": 1670,
"median_closing_line": -432,
"result": "win"
},
"...8 more"
],
"count": 10,
"next_offset": null
}What to do next
- get_fighter (5 credits). The career record and per-minute rates.
- get_ratings (2 credits). Our Elo ratings by weight class.
The data this uses
Every row above comes from UFC fight stats data and UFC fighter database. The full stat sheet for nearly every UFC fight since 2000: strikes by target and position, takedowns, control time, reversals and submission attempts. REST or MCP.
More guides
Rather ask Claude? 18 free Claude skills call these endpoints for you.
Start with 500 free credits every month
No card. REST or MCP.