Skip to content
RealTimeBets

Sports Betting API for Python Developers From Odds to Settlement

RealTimeBets is a sports betting API you can call from Python with the requests library and a bearer key. It returns live in-play prices with probabilities, a risk answer that accepts, reduces or rejects a stake, and a signed bet.settled webhook you verify with hmac. Starter is $499 a month ($249 billed yearly), Growth is $1,999 a month ($999 billed yearly).

A Python team building a sportsbook back end needs four calls to work end to end: read the price, check the stake, record the bet, verify the settlement. Below is each call with the numbers from the API docs, so you can run it against the sandbox key.

Python developer calling a sports betting API for live prices and settlement RealTimeBets Platform

Live from the engine

The payload, streaming now

What your integration receives, refreshed every second.

Reconnecting to the live feed. Showing the last prices, markets reopen when the feed is back.
Sandbox 60 s
The live feed of the API, refreshed every second.Get sandbox key

Read live prices with requests

Authentication is a bearer token in the Authorization header. Every response has a data object and a meta object that tells you whether the key is a sandbox key, the feed delay and how many requests you have used.

import requests

API = "https://realtimebets.com/api/v1"
H = {"Authorization": "Bearer rtb_sb_your_key"}

events = requests.get(f"{API}/events", params={"status": "live"}, headers=H).json()
for e in events["data"]:
    print(e["id"], e["home"], e["away"], e["score"])

Each market in the response has a decimal price and its probability. Every price carries a fixed margin of about 6 percent, so if your book wants its own margin you apply it from the probability in your own code. Prices recompute every second and the live betting API stream pushes once a second over server-sent events, not WebSocket.

Check the stake before you accept the bet

The risk check is the call a feed does not give you. You post the customer, market, selection, stake and the price the customer saw. The answer is accepted, reduced with a max stake, or rejected with a reason.

r = requests.post(f"{API}/risk/check", headers=H, json={
    "customer_ref": "cust_4410",
    "event_id": "rp-tennis-1-3932",
    "market_key": "pt:57",
    "selection_key": "server",
    "stake": 250,
    "price": 1.52,
}).json()["data"]

if r["decision"] == "reduced":
    stake = r["max_stake"]      # 120, reason liability_limit
elif r["decision"] == "rejected":
    reason = r["reason"]        # market_closed or price_changed

In the docs example market liability is 9,880 against a 10,000 limit, so a stake of 250 is reduced to 120. A rejected bet for price_changed returns the current price, so your bet slip can ask the customer to accept it. The risk check comes with Growth and Enterprise. More on the logic is on the risk engine page.

Verify the signed settlement webhook

You record the bet with the same fields plus your own bet_id. When the market resolves, RealTimeBets posts a bet.settled webhook to your endpoint. The header carries a timestamp and an HMAC SHA-256 signature of the timestamp, a dot and the raw body.

import hmac, hashlib, time

def valid(header, body, secret):
    parts = dict(p.split("=", 1) for p in header.split(","))
    expected = hmac.new(secret.encode(), f"{parts['t']}.{body}".encode(), hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, parts["v1"]) and abs(time.time() - int(parts["t"])) < 300

A bet of 40 at 1.52 that wins arrives with status won and payout 60.8. Your own wallet credits that amount, because the API never holds player funds and never calls a wallet. Each delivery is tried up to 3 times, so answer with any 2xx. The full flow is in the bookmaker API integration walkthrough and the API docs.

RealTimeBets plans for a Python sports betting API integration
FeatureStarterGrowthEnterprise
Live in-play odds with probabilities3 sportsAll sports and CS2All sports and CS2
Requests a month500,0005,000,000Fair use
Signed settlement webhooksYesYesYes
Risk check with liability and stake limitsNoYesYes
Cash out quotes and executionNoNoYes
Price per month, billed monthly$499$1,999$4,999
Price per month, billed yearly$249$999$2,499

Sandbox first, then a plan

Every new account gets one sandbox key: 1 sport, a 60 second delay, 1,000 requests in total and 7 days. That is enough to run the four calls above and replay matches with fictional teams, labelled Replay, at any hour. A production key needs a licence record in the console and an active plan. Choosing a plan reserves it at the listed price and nothing is charged yet.

  • Starter, $499 a month ($249 billed yearly). Live odds for 3 sports, 500,000 requests a month, bet recording and settlement webhooks. No suspension and no risk check.
  • Growth, $1,999 a month ($999 billed yearly). All sports and CS2, automatic suspension on micro-markets, the risk check, 5,000,000 requests a month.
  • Enterprise, $4,999 a month ($2,499 billed yearly). Growth plus cash out quotes and execution.

The rate limit is 600 requests a minute per key. Size your polling with the odds feed sizing article.

Who it is for and who it is not for

It is for a Python developer or small team building the back end of a licensed sportsbook, or an agency building one for a licensed operator. You write the front end, accounts, payments, KYC and wallet. The engine supplies prices, suspension, the risk answer and the settlement result.

It is not a hosted sportsbook, a wallet, a source of other bookmakers' odds or a pre-match feed. Markets open at kickoff, so you get in-play prices only. Compare it with the wider sportsbook API page before you choose.

Questions

Is there a Python SDK for the sports betting API?

There is no official SDK. The API is plain JSON over HTTPS with a bearer token, so the requests library covers it, and the docs show the webhook check with hmac from the standard library.

How do I verify the settlement webhook in Python?

Split the X-RTB-Signature header into t and v1, compute HMAC SHA-256 of the timestamp, a dot and the raw body with your endpoint secret, compare with hmac.compare_digest and reject anything older than 5 minutes.

Can I test the API before paying?

Yes. Every account gets a sandbox key with 1 sport, a 60 second delay, 1,000 requests and 7 days. It works on the risk check and bet recording too.

Does the API use WebSocket?

No. It is REST plus a server-sent events stream that pushes once a second. In Python you read the stream with requests and stream=True.

Does the API move customer money?

No. It never calls a wallet and never holds player funds. The signed bet.settled webhook tells your backend the result and your own wallet moves the money.

Sandbox key in minutes

Get sandbox key

Points only, no money. 18+.

Make your call