Bookmaker API Integration From First Price to Payout
5 min read
Test the live odds API on a sandbox key, no sales call.
Get sandbox key
RealTimeBets is a bookmaker API for live in-play betting: it gives your backend prices, suspension, a risk decision and a signed settlement result, and your own wallet moves the money. Short answer for a team planning an integration: five calls cover a bet from first price to payout, and the order matters more than the endpoints.
This walkthrough follows one tennis bet through all five calls with the numbers from the API docs. It is written for a developer or product lead who typed "bookmaker API" and wants to know what the integration really involves before choosing a plan.
What a bookmaker API has to do for a betting app
The word covers two different products. A data API returns odds and results, and you build everything that decides whether a bet is accepted. An engine API also prices the markets, suspends them on incidents, checks the bet against liability limits and tells you the result. RealTimeBets is the second kind. Its prices carry a fixed margin of about 6 percent and every selection has a probability, so an operator can apply its own margin on its side.
It does not carry other bookmakers' lines and it does not hold player funds. If your product has to show DraftKings or FanDuel prices, you need an aggregator, and the odds API pricing comparison covers those.
The five calls in order
| Step | Call | What comes back | Plans |
|---|---|---|---|
| 1. Find the event | GET /api/v1/events | Live events, Replay matches labelled Replay | All |
| 2. Show the price | GET /api/v1/odds?sport= or the stream | One board per sport, stream pushes once a second | All |
| 3. Check the bet | POST /api/v1/risk/check | accepted, reduced with max_stake, or rejected with a reason | Growth, Enterprise |
| 4. Record the bet | POST /api/v1/bets | 201 when accepted, 422 otherwise | All |
| 5. Receive the result | bet.settled webhook | status, payout, winning selection | All |
Cash out is a sixth call, available on Enterprise only: a GET on the bet's cashout path quotes the value of an open bet from the live price, and a POST pays it and sends a signed bet.cashed_out webhook.
One bet from first price to payout
The numbers below are the example from the docs, so you can test the same sequence in the sandbox. A customer, cust_4410, wants to back the server in a tennis game at 1.52 with a stake of 250.
Steps 1 and 2: the price the customer sees
Your app lists events and opens the board for tennis. The market key in the example is pt:57 and the selection is "server", priced at 1.52. For a screen that refreshes itself, the server-sent event stream pushes once a second. Each connection lasts up to 60 seconds and then sends an end event, so the client reconnects. The WebSocket alternative article explains why that is enough for a bet slip.
Step 3: the risk check says reduced
The app sends the proposed bet with customer_ref, event_id, market_key, selection_key, stake and price to the risk check. With market liability already at 9,880 against a 10,000 limit, the answer is reduced with a max_stake of 120 and the reason liability_limit. Liability after would be 10,005 for the full bet, so the engine returns the largest stake that fits instead of a flat no.
Two other answers matter for your bet slip. A rejected result with market_closed means the market suspended while the customer was typing. A rejected result with price_changed returns the current_price so the slip can ask the customer to accept the new price. Limits come from the console. Without your own limits the defaults are 50,000 liability per market and 5,000 per customer. A customer with at least 20 settled bets and a win rate of 60 percent or more is flagged sharp and gets half the limits.
Step 4: record the accepted bet
The customer takes 120 instead of 250, then a later bet of 40 at 1.52 is accepted. Your backend posts it to the bets endpoint with your own bet_id, here B-10442. A 201 means it is stored and now counts toward liability. A 422 means the engine declined it and your backend must not confirm the bet to the customer. You can read the bet back at any time and its status is open, won, lost or cashed_out.
Step 5: the signed settlement webhook
When the market resolves, RealTimeBets posts a bet.settled event to your https endpoint. For the 40 stake at 1.52 the data shows status won and payout 60.8. The request carries an X-RTB-Signature header with a timestamp and a v1 signature, which is an HMAC SHA-256 of the timestamp, a dot and the raw body, keyed with your endpoint secret.
Verify the signature, reject anything older than 5 minutes, and use the webhook id so a repeated delivery never pays twice. Deliveries are tried up to 3 times until you answer with any 2xx. Only then does your wallet credit 60.8. The money never passes through RealTimeBets.
What to test in the sandbox first
Every new account gets a sandbox key: 1 sport, a 60 second delay, 1,000 requests and 7 days. It is enough to run the full sequence above on a replay match. The checks that find real bugs are short:
- A bet posted while the market is suspended must come back rejected and never reach the customer as accepted.
- A duplicate bet.settled delivery must not credit the wallet twice.
- A reduced answer must show the customer the lower stake before anything is recorded.
- The stream client must reconnect cleanly when the 60 second end event arrives.
The sportsbook integration checklist extends this list for go-live.
What it costs and which plan the integration needs
Steps 1, 2, 4 and 5 work on every plan. Step 3, the risk check, and the automatic suspension of micro-markets need Growth. Starter is $499 a month ($249 billed yearly) and Growth is $1,999 a month ($999 billed yearly). Enterprise is $4,999 a month ($2,499 billed yearly) and adds cash out. A production key needs a paid plan and a stored licence record. Choosing a plan reserves it at the listed price and nothing is charged yet.
If you are building the app itself, the betting app development page lists what stays with your team. For the full endpoint list, see the sportsbook API page and the official MDN guide to server-sent events for the client side of the stream.
Who this is for and who it is not for
It fits a developer or product lead at a licensed or soon to be licensed operator who wants prices, suspension, risk and settlement as one integration. It does not fit a team that needs pre-match fixtures, player props, bet builder pricing, a hosted wallet or a finished front end on its own domain. Prices cover soccer, basketball, tennis, American football, ice hockey, baseball and CS2 from kickoff.
Bookmaker API questions
Does the bookmaker API move player money?
No. The API never calls a wallet. It sends a signed bet.settled webhook with the status and payout, and your backend credits or debits the wallet itself.
How fast do prices update?
Prices recompute every second and the stream pushes once a second. There is no WebSocket. You read the same data over REST or server-sent events.
Can I try the integration before paying?
Yes. The sandbox key gives 1 sport on a 60 second delay, 1,000 requests and 7 days, and it can use the risk check and bet recording on the delayed feed.