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 James Mccoy

Last updated About 1 month 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 250+ 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 and requires no credit card for the free trial.

Sign Up for Your Free Trial

  1. Visit odds-api.io and click "Get Started"

  2. Enter your email address to create your account

  3. You'll receive a 10-day free trial with full API access

    • No credit card required

    • 5,000 requests/hour included

    • Access to all 250+ bookmakers

    • Full feature access

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:

https://api.odds-api.io/v3/docs/index.html

Fetch Available Sports (No API Key Required)

This endpoint returns all sports currently available through the API:

Example
const response = await fetch('https://api.odds-api.io/v3/sports'); const sports = await response.json(); console.log(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) or live (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

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();

Storing 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 key

  • sport - Sport slug (e.g., "football", "basketball")

  • league - League slug (e.g., "england-premier-league")

  • eventId - Specific event ID

  • bookmakers - Comma-separated list of bookmaker names

  • status - "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.