How to pull bookmaker odds with a REST API
A step by step guide to fetching live bookmaker odds over a simple REST endpoint, with working Python, JavaScript, and cURL examples.
Guide · Updated June 2026
To pull bookmaker odds over REST with RapidOddsAPI, send a GET request to https://api.rapidoddsapi.com/sports/{sport_id}/markets with your API key, the bookmakers, and the market types you want as query parameters. You get back standardised JSON with each game, each bookmaker, and their prices. It works on every plan, including the free tier, and one endpoint covers every sport.
REST is the simplest way to get odds into your app. You ask for what you want, you get prices back, done. No connection to keep alive, no subscriptions to manage. This guide covers the endpoint, the parameters, the response shape, and how credits are counted, with copy and paste examples you can run right now.
One endpoint for everything
There is a single endpoint. You pick the sport in the path, then choose the bookmakers and market types with query parameters.
The sport_id is a path parameter such as NBA, NFL, or MLB. The full list of sport IDs, bookmakers, and market types is on the coverage page.
Parameters
- api_key (required) Your API key, from your dashboard.
- market_type (required) The market you want, for example head_to_head. Repeat the parameter to request several.
- bookmaker (required) The bookmaker name, for example Sportsbet. Repeat the parameter to request several.
Your first request
Here is a complete request for NBA head to head odds from three bookmakers, including Pinnacle, which is a common reference book for fair value:
cURL
Python
Using the requests library, pass repeated parameters as a list and it handles the rest:
JavaScript (Node.js)
Run this server side to keep your API key off the client. Node 18 and up has fetch built in, so there is nothing to install.
What you get back
The response is standardised JSON. Each game holds the teams and start time, then a list of the bookmakers you asked for, each with their markets and prices. Team and player names are already normalised across books, so a price on one bookmaker compares cleanly to the next with no mapping layer.
Spreads and totals add a point field for the line value, and player props add a player_name field on each outcome. The full field reference is in the docs.
Requesting more in one call
Both market_type and bookmaker can be repeated, so you can pull several markets across many books in a single request. For example, head to head and totals across five bookmakers at once:
How credits are counted
Each request costs credits based on how much you ask for, using this formula:
Every five bookmakers count as one group, rounded up. So one market across five books is one credit, one market across six books is two, and two markets across ten books is four. You are only charged when data is returned. If your query matches no games, you are not charged.
Error codes
- 401 Invalid API key.
- 403 Subscription is not active.
- 404 Sport not found.
- 422 Missing a required parameter (api_key, market_type, or bookmaker).
- 429 Insufficient credits, or the 30 requests per second rate limit was exceeded.
When to reach for WebSocket instead
REST is perfect for snapshots and scheduled jobs. If you need prices the instant they change, for an arbitrage or live betting tool, polling REST starts to feel slow and wasteful. That is what the WebSocket feed is for, and we compare the two approaches head to head in REST vs WebSocket for odds data.
Start building with RapidOddsAPI
Real-time, standardised odds from 100+ bookmakers over REST and WebSocket. Start free with 250 credits, no credit card required.