RapidOddsAPIRapidOddsAPI
Home/Blog/Guide

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.

GET https://api.rapidoddsapi.com/sports/{sport_id}/markets

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:

GET https://api.rapidoddsapi.com/sports/NBA/markets ?api_key=your_api_key &market_type=head_to_head &bookmaker=Sportsbet &bookmaker=DraftKings &bookmaker=Pinnacle

cURL

curl "https://api.rapidoddsapi.com/sports/NBA/markets?\ api_key=your_api_key&\ market_type=head_to_head&\ bookmaker=Sportsbet&\ bookmaker=DraftKings&\ bookmaker=Pinnacle"

Python

Using the requests library, pass repeated parameters as a list and it handles the rest:

import requests response = requests.get( "https://api.rapidoddsapi.com/sports/NBA/markets", params={ "api_key": "your_api_key", "market_type": ["head_to_head"], "bookmaker": ["Sportsbet", "DraftKings", "Pinnacle"], }, ) data = response.json() for game in data["games"]: home = game["game"]["home_team"] away = game["game"]["away_team"] print(f"{away} at {home}") for book in game["bookmakers"]: for market in book["markets"]: prices = ", ".join( f"{o['name']} {o['price']}" for o in market["outcomes"] ) print(f" {book['name']}: {prices}")

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.

const params = new URLSearchParams({ api_key: "your_api_key", market_type: "head_to_head", }) params.append("bookmaker", "Sportsbet") params.append("bookmaker", "DraftKings") params.append("bookmaker", "Pinnacle") const response = await fetch( `https://api.rapidoddsapi.com/sports/NBA/markets?${params}` ) const data = await response.json() for (const game of data.games) { const { home_team, away_team } = game.game console.log(`${away_team} at ${home_team}`) for (const book of game.bookmakers) { for (const market of book.markets) { const prices = market.outcomes .map((o) => `${o.name} ${o.price}`) .join(", ") console.log(` ${book.name}: ${prices}`) } } }

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.

{ "sport": "NBA", "games": [ { "game": { "commence_time": "2026-02-14T10:00:00", "home_team": "Charlotte Hornets", "away_team": "Detroit Pistons" }, "bookmakers": [ { "name": "Sportsbet", "last_update": "2026-02-14T05:34:27", "markets": [ { "key": "head_to_head", "outcomes": [ { "name": "Detroit Pistons", "price": 1.65 }, { "name": "Charlotte Hornets", "price": 2.29 } ] } ] }, { "name": "Pinnacle", "last_update": "2026-02-14T05:34:01", "markets": [ { "key": "head_to_head", "outcomes": [ { "name": "Detroit Pistons", "price": 1.67 }, { "name": "Charlotte Hornets", "price": 2.31 } ] } ] } ] } ] }

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:

GET https://api.rapidoddsapi.com/sports/NFL/markets ?api_key=your_api_key &market_type=head_to_head &market_type=totals &bookmaker=Sportsbet&bookmaker=TAB&bookmaker=Ladbrokes &bookmaker=DraftKings&bookmaker=Pinnacle

How credits are counted

Each request costs credits based on how much you ask for, using this formula:

credits = market_types × ceil(bookmakers / 5)

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.

Get Your Free API KeyRead the Docs