DEV Community

noah
noah

Posted on Originally published at fighterapi.com

How do I get UFC fighter Elo ratings by weight class?

Our Elo rating for every fighter, built from every UFC result since 2000, filtered to a weight class and to fighters who have fought recently.

Code verified October 10, 2026. It takes one call to get_ratings, 2 credits.

The call

weight_class takes the division name. active_since is a year.

import requests
import pandas as pd

API_KEY = "YOUR_API_KEY"

resp = requests.post(
    "https://mcp.fighterapi.com/v1/get_ratings",
    headers={"x-api-key": API_KEY},
    json={
        "weight_class": "Lightweight",
        "active_since": 2025,
        "limit": 15,
    },
    timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]

r = pd.DataFrame(data["ratings"])
print(r[["rank", "name", "rating", "fights", "last_fight"]])
# 400 points is 10-to-1 odds.
gap = r.loc[0, "rating"] - r.loc[1, "rating"]
print(r.loc[0, "name"], "over", r.loc[1, "name"], round(1 / (1 + 10 ** (-gap / 400)), 3))
Enter fullscreen mode Exit fullscreen mode

You need requests and pandas (pip install requests pandas) and a free API key from FighterAPI.

What comes back

The data object, trimmed to the first rows. Every value is real output from the run above.

{
  "active_since": 2025,
  "ratings": [
    {
      "rank": 1,
      "fighter_id": "2614933",
      "name": "Max Holloway",
      "weight_class": "Lightweight",
      "rating": 1684,
      "last_fight": "2026-07-12T01:00:00.000Z",
      "fights": 33,
      "ufc_fights": 33
    },
    {
      "rank": 2,
      "fighter_id": "2504169",
      "name": "Charles Oliveira",
      "weight_class": "Lightweight",
      "rating": 1680,
      "last_fight": "2026-03-08T02:00:00.000Z",
      "fights": 37,
      "ufc_fights": 37
    },
    "...13 more"
  ],
  "count": 15,
  "method": "Elo from UFC results alone: start 1500, K 40 for a fighter's first five bouts then 24, finishes weighted 1.15, draws 0.5, no contests unrated."
}
Enter fullscreen mode Exit fullscreen mode

What to do next

  • get_schedule (2 credits). Upcoming fights with current moneylines, to set a rating gap beside the price.
  • get_fighter (5 credits). A fighter's record, career rates and rating history.

Originally published at fighterapi.com.

Top comments (0)