Skip to content

Guides

How do I get UFC line movement for a fight in Python?

Snapshots of each sportsbook's moneyline from first capture to fight day, with the result. This shows how far each book moved and which fighter the market moved toward.

Code verified October 12, 2026. One call to get_line_movement, 10 credits.

The call

bout_id comes from get_event or get_schedule. Pass provider to keep one sportsbook. 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_line_movement",
    headers={"x-api-key": API_KEY},
    json={
        "bout_id": "401917345",
    },
    timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]

def implied(odds):
    return 100 / (odds + 100) if odds > 0 else -odds / (-odds + 100)

bout = data["bout"]
rows = []
for book, snaps in data["movement"].items():
    df = pd.DataFrame(snaps).sort_values("captured_at")
    first, last = df.iloc[0], df.iloc[-1]
    rows.append({
        "book": book,
        "snapshots": len(df),
        "first_seen": first["captured_at"][:10],
        "a_first": first["a_price"],
        "a_last": last["a_price"],
        "a_prob_move": implied(last["a_price"]) - implied(first["a_price"]),
    })
moves = pd.DataFrame(rows)
winner = bout["fighter_a_name"] if bout["winner"] == bout["fighter_a"] else bout["fighter_b_name"]
print(bout["fighter_a_name"], "v", bout["fighter_b_name"], "| winner:", winner, "by", bout["method_display"])
print(moves.round(3).to_string(index=False))

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.

What comes back

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

{
  "bout": {
    "bout_id": "401917345",
    "event_id": "600061182",
    "event_name": "UFC 332: Silva vs. Wang",
    "event_date": "2026-10-03",
    "starts_at": "2026-10-04T00:00:00.000Z",
    "weight_class": "Welterweight",
    "card_segment": "main",
    "match_number": 4,
    "title_fight": false,
    "scheduled_rounds": 3,
    "status": "final",
    "fighter_a": "4274796",
    "fighter_a_name": "Roberto Soldić",
    "fighter_b": "4612580",
    "fighter_b_name": "Khaos Williams",
    "winner": "4274796",
    "method": "decision---unanimous",
    "method_display": "Decision - Unanimous",
    "end_round": 3,
    "end_clock": "5:00",
    "duration_seconds": 900,
    "judges_scores": "29-27 | 29-28 | 29-27",
    "referee": "Mike Beltran"
  },
  "movement": {
    "DraftKings": [
      {
        "captured_at": "2026-09-29T11:55:36.000Z",
        "a_price": -310,
        "b_price": 250,
        "total_rounds": 1.5
      },
      {
        "captured_at": "2026-09-29T22:50:36.000Z",
        "a_price": -298,
        "b_price": 240,
        "total_rounds": 1.5
      },
      {
        "captured_at": "2026-10-03T11:55:36.000Z",
        "a_price": -218,
        "b_price": 180,
        "total_rounds": 1.5
      },
      "...3 more"
    ],
    "Pinnacle": [
      {
        "captured_at": "2026-09-29T11:55:36.000Z",
        "a_price": -316,
        "b_price": 258,
        "total_rounds": 1.5
      },
      {
        "captured_at": "2026-09-29T22:50:36.000Z",
        "a_price": -304,
        "b_price": 249,
        "total_rounds": 1.5
      },
      {
        "captured_at": "2026-10-03T11:55:36.000Z",
        "a_price": -212,
        "b_price": 186,
        "total_rounds": 1.5
      },
      "...3 more"
    ],
    "...": "4 more bookmakers"
  },
  "snapshots": 32
}

What to do next

  • get_odds (5 credits). Opening, closing and current moneylines for every fight on a card.
  • get_fight (5 credits). Round-by-round stats and the result for the same fight.

More guides

Start with 500 free credits every month

No card. REST or MCP.