Football market odds API in Python

Get the bookmaker consensus for a football match as margin-free probabilities, see how it moved since opening, pull the hourly history and get a movement summary. About 50 lines of Python. This API returns derived market data, not individual bookmaker prices: if you need to compare prices bookmaker by bookmaker, a dedicated odds provider is the better fit.

Reviewed 2026-10-14

1. Get an API key and set up a small helper

Start a 14-day trial at /register (card required, nothing charged until it ends). Market endpoints need a Developer plan or higher, and the trial includes it. Keep your key in an environment variable. The helper turns the two cases you will hit into clear behaviour: a 403 means your plan has no market access, and a 404 means there is no market data for that fixture yet (common for early or smaller-league matches).

import os
import requests

API = "https://api.predictiqpro.com"
HEADERS = {"Authorization": f"Token {os.environ['PREDICTIQ_KEY']}"}

def get(path, **params):
    r = requests.get(f"{API}{path}", headers=HEADERS, params=params, timeout=15)
    if r.status_code == 403:
        raise SystemExit("Market data needs a Developer plan or higher (the 14-day trial includes it).")
    if r.status_code == 404:
        return None  # no market data for this fixture yet
    r.raise_for_status()
    return r.json()

2. Get the current consensus for a match

One request returns the consensus across bookmakers with the margin already removed, the opening consensus, how many bookmakers are reporting and when it was last updated. Each probability is the median across bookmakers of that bookmaker's margin-free probability. Use a real upcoming fixture id from the fixtures endpoint.

FIXTURE_ID = 123456  # use a real upcoming fixture id

data = get(f"/odds/{FIXTURE_ID}")
if not data:
    raise SystemExit("No market data for this fixture yet")

print("bookmakers reporting:", data["bookmakers_reporting"])
print("consensus now:   ", data["consensus"])          # {"home": .., "draw": .., "away": ..}
print("consensus at open:", data["opening_consensus"])  # can be None
print("updated:", data["updated_at"])

3. Fair probabilities and fair odds

Because the margin is already removed, the three probabilities add up to 1.0. Fair decimal odds are simply 1 divided by the probability. These are not prices you can bet at: they are what the market consensus implies once the bookmakers' margin is taken out.

now = data["consensus"]

# Probabilities add up to 1.0 because the margin is already removed.
print("sum:", round(sum(now.values()), 4))

# Fair (margin-free) decimal odds are 1 divided by the probability.
fair_odds = {k: round(1 / p, 2) for k, p in now.items() if p}
print(fair_odds)

4. See how the consensus moved since opening

Compare the current consensus with the opening one. A rising probability for an outcome means the market now rates it more likely. This is price movement only. The API does not have betting volume, so it cannot tell you where the money went.

opening = data.get("opening_consensus")
if opening:
    for k in ("home", "draw", "away"):
        change = (now[k] - opening[k]) * 100
        print(f"{k:<5} {opening[k]:.3f} -> {now[k]:.3f}  ({change:+.1f} points)")
else:
    print("No opening snapshot for this fixture")

5. Pull the hourly history

The history endpoint returns the consensus over time as one point per hour, with the number of bookmakers reporting at that hour, so you can chart movement without polling yourself. The market defaults to 1X2.

hist = get(f"/odds/history/{FIXTURE_ID}", market="1X2")
if hist:
    series = hist["series"]  # one point per hour
    print(len(series), "hourly points")
    for pt in series[-5:]:
        print(pt["recorded_at"], pt["bookmakers_reporting"], "bookmakers",
              pt["home"], pt["draw"], pt["away"])

6. Get the movement summary in one call

The market-analysis endpoint combines opening and current prices into a movement direction, a strength score and the change in implied probability. It returns market_movement as null when there is not enough data, so the code handles that.

ma = get(f"/market-analysis/{FIXTURE_ID}")
if ma:
    move = ma["market_movement"] or {}
    print("direction:", move.get("direction"), "| strength:", move.get("strength"))
    print("implied probability change:", ma["implied_probability"]["change"])

7. Log the consensus over time (and keep an eye on your quota)

If you want your own time series, this saves the consensus to a CSV every 30 minutes. Every request counts towards your plan's monthly limit: 24 fixtures every 30 minutes is 1,152 requests a day. For past movement, read the history endpoint instead of polling, and only poll the matches you are actively watching, closer to kickoff.

import csv
import time
from datetime import datetime, timezone

FIXTURES = [123456, 123457]  # the matches you care about
EVERY_MINUTES = 30

def snapshot(path="market_log.csv"):
    now = datetime.now(timezone.utc).isoformat(timespec="seconds")
    with open(path, "a", newline="") as f:
        writer = csv.writer(f)
        for fid in FIXTURES:
            d = get(f"/odds/{fid}")
            if not d:
                continue
            c = d["consensus"]
            writer.writerow([now, fid, d["bookmakers_reporting"], c["home"], c["draw"], c["away"]])

while True:
    snapshot()
    time.sleep(EVERY_MINUTES * 60)

8. If you have your own bookmaker prices

To find the best price or each bookmaker's margin, you need prices from an odds provider you license. The margin guide linked below shows how to remove the margin from any set of decimal odds, and you can compare your result with the consensus returned here.

Related guides

Ready to build?

Full endpoint reference is in the docs; plans are on the pricing page.

Start 14-day trial