Quick Start Guide: Get Up and Running in 5 Minutes with odds-api.io
Get your API key and make your first call to Odds-API.io
Written By Markus
Last updated About 2 months ago
Overview
Welcome to Odds-API.io! This guide will walk you through everything you need to start fetching real-time sports betting odds from 415+ bookmakers. You'll go from zero to your first API call in under 5 minutes.
What you'll accomplish:
✅ Create your account and get your API key
✅ Make your first API call to fetch sports data
✅ Understand the basic workflow for getting odds
✅ See real odds data from multiple bookmakers
Step 1: Create Your Account & Get Your API Key
Getting started with Odds-API.io is simple.
Sign Up and Choose a Plan
Visit odds-api.io and click "Get Started"
Enter your email address to create your account
Pick a plan. Solo (£49/month) is the entry plan:
2 bookmakers, sharp and exchange books included
5,000 requests/hour
Full REST API access
New free API keys are paused.
Want to try WebSocket? On any paid plan you can start a one-time 7-day WebSocket trial from your dashboard.
Select Your Bookmakers
Once you're signed up, go to odds-api.io/dashboard to pick your bookmakers. You can swap them out anytime. Solo gives you 2 slots, Starter 5, Growth 10 and Pro 15. Browse all 415+ bookmakers at odds-api.io/sportsbooks.
Receive Your API Key
Within seconds, you'll receive an email containing:
✉️ Your unique API key
📚 Links to documentation
🚀 Quick start resources
Your API key looks like this: 8adfbfjdubjva7313481832...
⚠️ Important: Keep your API key secure! Never share it publicly. Always use environment variables to store it (never direct in your code)
Step 2: Make Your First API Call
Let's start with the simplest endpoint that doesn't even require authentication - fetching the list of available sports.
Want to skip the code and play around faster? You can view this interactive documentation where you can test out the api with just your key, no code writing needed:

Fetch Available Sports (No API Key Required)
This endpoint returns all sports currently available through the API:
const response = await fetch('https://api.odds-api.io/v3/sports'); const sports = await response.json(); console.log(sports);import requests response = requests.get('https://api.odds-api.io/v3/sports') sports = response.json() print(sports)<?php $response = file_get_contents('https://api.odds-api.io/v3/sports'); $sports = json_decode($response, true); print_r($sports);curl "https://api.odds-api.io/v3/sports"Expected Response
You'll receive a JSON array of sports objects:
json
[
{
"name": "Football",
"slug": "football"
},
{
"name": "Basketball",
"slug": "basketball"
},
{
"name": "Tennis",
"slug": "tennis"
}
// ... more sports
]
```Step 3: Let's walk through each step:
1️⃣ Get Sports
What it does: Returns all available sports (football, basketball, tennis, etc.)
When to use: Starting point to see what sports you can access
Endpoint: GET /v3/sports
2️⃣ Get Leagues
What it does: Returns leagues within a specific sport
When to use: After choosing a sport, find specific leagues (e.g., Premier League, La Liga)
Endpoint: GET /v3/leagues?sport=football
Example:
javascript
const apiKey = process.env.ODDS_API_KEY; const response = await fetch( `https://api.odds-api.io/v3/leagues?apiKey=${apiKey}&sport=football` ); const leagues = await response.json();3️⃣ Get Events
What it does: Returns upcoming and live matches/games
When to use: After choosing a league, find specific events to get odds for
Endpoint: GET /v3/events?sport=football&league=england-premier-league
Example:
javascript
const apiKey = process.env.ODDS_API_KEY; const response = await fetch( `https://api.odds-api.io/v3/events?apiKey=${apiKey}&sport=football&league=england-premier-league&status=pending&limit=10` ); const events = await response.json();Parameters:
sport- The sport slug (from step 1)league- The league slug (from step 2)status-pending(upcoming) orlive(in progress)limit- Maximum number of events to return
4️⃣ Get Odds
What it does: Returns betting odds from multiple bookmakers for a specific event
When to use: After selecting an event, get the actual odds to compare bookmakers
Endpoint: GET /v3/odds?eventId={eventId}&bookmakers={bookmakers}
Example:
javascript
const apiKey = process.env.ODDS_API_KEY; const eventId = 123456; // From step 3 const bookmakers = 'Bet365,Unibet,SingBet'; // Comma-separated list const response = await fetch( `https://api.odds-api.io/v3/odds?apiKey=${apiKey}&eventId=${eventId}&bookmakers=${bookmakers}` ); const odds = await response.json();Step 4: Your First Complete Workflow
Let's put it all together with a complete example that gets odds for an upcoming Premier League match:
JavaScript/Node.js - Complete Example
// Store your API key in environment variables
const apiKey = process.env.ODDS_API_KEY;
async function getFirstOdds() {
try {
// Step 1: Get available sports (no auth needed)
const sportsRes = await fetch('https://api.odds-api.io/v3/sports');
const sports = await sportsRes.json();
console.log('✅ Available sports:', sports.length);
// Step 2: Get Premier League events
const eventsRes = await fetch(
`https://api.odds-api.io/v3/events?apiKey=${apiKey}&sport=football&league=england-premier-league&status=pending&limit=1`
);
const events = await eventsRes.json();
if (events.length === 0) {
console.log('No upcoming events found');
return;
}
const event = events[0];
console.log(`✅ Found event: ${event.home} vs ${event.away}`);
// Step 3: Get odds from multiple bookmakers
const oddsRes = await fetch(
`https://api.odds-api.io/v3/odds?apiKey=${apiKey}&eventId=${event.id}&bookmakers=Bet365,Unibet,SingBet`
);
const oddsData = await oddsRes.json();
// Step 4: Find best home odds
let bestHomeOdds = null;
Object.entries(oddsData.bookmakers).forEach(([bookmaker, markets]) => {
const mlMarket = markets.find(m => m.name === 'ML');
if (mlMarket?.odds[0]?.home) {
const homeOdds = parseFloat(mlMarket.odds[0].home);
if (!bestHomeOdds || homeOdds > bestHomeOdds.odds) {
bestHomeOdds = { bookmaker, odds: homeOdds };
}
}
});
console.log(`✅ Best home odds: ${bestHomeOdds.odds} at ${bestHomeOdds.bookmaker}`);
} catch (error) {
console.error('❌ Error:', error.message);
}
}
getFirstOdds();import os
import requests
api_key = os.environ.get('ODDS_API_KEY')
def get_first_odds():
try:
# Step 1: Get available sports (no auth needed)
sports_response = requests.get('https://api.odds-api.io/v3/sports')
sports = sports_response.json()
print(f'✅ Available sports: {len(sports)}')
# Step 2: Get Premier League events
events_response = requests.get(
'https://api.odds-api.io/v3/events',
params={
'apiKey': api_key,
'sport': 'football',
'league': 'england-premier-league',
'status': 'pending',
'limit': 1
}
)
events = events_response.json()
if not events:
print('No upcoming events found')
return
event = events[0]
print(f"✅ Found event: {event['home']} vs {event['away']}")
# Step 3: Get odds from multiple bookmakers
odds_response = requests.get(
'https://api.odds-api.io/v3/odds',
params={
'apiKey': api_key,
'eventId': event['id'],
'bookmakers': 'Bet365,Unibet,SingBet'
}
)
odds_data = odds_response.json()
# Step 4: Find best home odds
best_home_odds = None
for bookmaker, markets in odds_data['bookmakers'].items():
ml_market = next((m for m in markets if m['name'] == 'ML'), None)
if ml_market and ml_market['odds'][0].get('home'):
home_odds = float(ml_market['odds'][0]['home'])
if not best_home_odds or home_odds > best_home_odds['odds']:
best_home_odds = {'bookmaker': bookmaker, 'odds': home_odds}
print(f"✅ Best home odds: {best_home_odds['odds']} at {best_home_odds['bookmaker']}")
except Exception as error:
print(f'❌ Error: {str(error)}')
get_first_odds()
```
---
## Expected Output
When you run the complete example, you should see output like this:
```
✅ Available sports: 12
✅ Found event: Manchester United vs Liverpool
✅ Best home odds: 2.15 at SingBetStoring Your API Key Securely
Never hardcode your API key directly in your code if you are pushing a project live, it’s best practice to keep it safe. Instead, use environment variables:
You can use your API key in your code if you are just playing around with a non deployed codebase.
Need Help?
If you run into any issues or have questions:
📧 Email: hello@odds-api.io
📖 Documentation: Full API docs and guides
⏱️ Response Time: Usually within 24 hours
or use the live chat.
Quick Reference
Key Endpoints

Common Parameters
apiKey- Your API authentication keysport- Sport slug (e.g., "football", "basketball")league- League slug (e.g., "england-premier-league")eventId- Specific event IDbookmakers- Comma-separated list of bookmaker namesstatus- "pending" (upcoming) or "live" (in progress)limit- Maximum number of results to return
🎉 Congratulations! You're now ready to start building with Odds-API.io. Happy coding! And remember, utilise tools like chatgpt to help you understand things, just copy and paste our documentation to it.
Was this helpful?
More in Quick Start Guide
Understanding the API WorkflowStill need help? Ask the team