Your first request to the OddFeeds API

From your API key to the odds of one match in four requests, each one taking its id from the answer before it.

6 min read ·

Every answer of the API gives you the ids for the next request: countries lead to their leagues, leagues to their matches, and matches to their odds. This guide makes those four requests in order and shows what each answer holds.

Your API key

Every request is a POST to one address, with your key in the header: Authorization: Bearer followed by the key. Your key is on your account page once you have one, and the services page says how to get one.

1. The countries

A request without a scope lists the countries with odds right now, before kick-off and in play.

curl -X POST https://oddfeeds.com/api/v1/feeds \
  -H "Authorization: Bearer ofk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"prematch":true,"inplay":true}'

The answer · An answer from the API on Nov 26, 2026, showing its first rows. Your own answer has other ids: put those into the next request.

The answer in JSON: 1. The countries
{
  "status": "ok",
  "data": [
    {
      "id": 136,
      "name": "Slovakia",
      "prematch_leagues_cnt": 1,
      "inplay_leagues_cnt": 0
    },
    {
      "id": 42,
      "name": "Costa Rica",
      "prematch_leagues_cnt": 2,
      "inplay_leagues_cnt": 0
    }
  ],
  "time": "2026-11-26T15:14:19",
  "ms": "479us"
}

prematch_leagues_cnt and inplay_leagues_cnt count a country's leagues that have odds before kick-off and in play. Pick a country whose count is above zero.

2. A country's leagues

Put the country's id into tournament_ids. The answer lists its leagues and how many of their matches have odds.

curl -X POST https://oddfeeds.com/api/v1/feeds \
  -H "Authorization: Bearer ofk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"scope":"leagues","tournament_ids":[136]}'

The answer · An answer from the API on Nov 26, 2026. Your own answer has other ids: put those into the next request.

The answer in JSON: 2. A country's leagues
{
  "status": "ok",
  "data": [
    {
      "id": 10618,
      "tournament_id": 136,
      "name": "Super Liga",
      "prematch_matches_cnt": 6,
      "inplay_matches_cnt": 0
    }
  ],
  "time": "2026-11-26T15:14:19",
  "ms": "400us"
}

3. A league's matches

Put a league's id into league_ids.

curl -X POST https://oddfeeds.com/api/v1/feeds \
  -H "Authorization: Bearer ofk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"scope":"matches","league_ids":[10618]}'

The answer · An answer from the API on Nov 26, 2026, showing its first rows. Your own answer has other ids: put those into the next request.

The answer in JSON: 3. A league's matches
{
  "status": "ok",
  "data": [
    {
      "id": 13682297,
      "league_id": 10618,
      "teams": {
        "home": "Dukla Banska Bystrica",
        "away": "MFK Ruzomberok"
      },
      "start": "2026-11-28T14:30:00",
      "active": {
        "prematch": 1,
        "inplay": 0
      },
      "stats": {
        "start": "2026-11-28T14:30:00"
      }
    },
    {
      "id": 13683299,
      "league_id": 10618,
      "teams": {
        "home": "Slovan Bratislava",
        "away": "FC Kosice"
      },
      "start": "2026-11-28T17:00:00",
      "active": {
        "prematch": 1,
        "inplay": 0
      },
      "stats": {
        "start": "2026-11-28T17:00:00"
      }
    }
  ],
  "time": "2026-11-26T15:14:20",
  "ms": "700us"
}

start is the kick-off in UTC. active says in which mode the match has odds right now, and a match in play also carries stats.runtime with its minute and score.

4. The odds of one match

Put the match's id into match_ids. Without bookmaker_ids, the answer carries every bookmaker your key gives you.

curl -X POST https://oddfeeds.com/api/v1/feeds \
  -H "Authorization: Bearer ofk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"scope":"odds","match_ids":[13682297]}'

The answer · An answer from the API on Nov 26, 2026, showing its first rows.

The answer in JSON: 4. The odds of one match
{
  "status": "ok",
  "data": {
    "prematch": [
      {
        "id": 390798263,
        "active": 1,
        "match_id": 13682297,
        "event_id": 72533074,
        "bookmaker": {
          "id": 59,
          "name": "Bet8"
        },
        "datetime": "2026-11-26T01:35:42",
        "period_id": 0,
        "type_id": 11,
        "order": 1,
        "back_lay_id": 0,
        "liquidity": -1,
        "hc": 0,
        "hc_as_draw": 0,
        "price": 1.231,
        "nav": "{\"v\":1,\"scope\":\"prematch\",\"eventId\":\"18450709\",\"oddId\":\"4..."
      },
      {
        "id": 390634623,
        "active": 1,
        "match_id": 13682297,
        "event_id": 72531615,
        "bookmaker": {
          "id": 34,
          "name": "Trbet"
        },
        "datetime": "2026-11-26T01:36:24",
        "period_id": 0,
        "type_id": 9,
        "order": 1,
        "back_lay_id": 0,
        "liquidity": -1,
        "hc": 2,
        "hc_as_draw": 0,
        "price": 1.14,
        "nav": "{\"v\":1,\"scope\":\"prematch\",\"eventId\":\"42575268\",\"oddId\":\"7..."
      }
    ],
    "inplay": []
  },
  "time": "2026-11-26T15:15:19",
  "ms": "15.97ms"
}

The rows come in two lists, prematch and inplay, one for each mode, and each row is one price of one bookmaker. These are the fields you read first:

Fields of an odds row
FieldMeaning
bookmakerid + name of the source bookmaker.
type_idMarket type, see the type_id table.
period_id0 = first half, 1 = full time, 6 = second half.
hcThe handicap / total line, e.g. -0.5 or 2.5. On 1X2 rows (type_id 2, 3, 4) a non-zero hc is a European handicap line, and for correct score (type_id 66) it carries the score; see the type_id table.
priceThe odd, decimal format. On an exchange it's the price as the exchange shows it, with no commission taken off.
datetimeWhen this price last changed (UTC).

What each number in a row stands for is in the reference tables of the documentation.

When the API says no

These are the two answers a first request meets most often, in the API's own words:

Error answers
HTTP statusMeaning
400A body that is not valid JSON, a malformed parameter, a scope without its id list, or id lists that count as more requests than one request may (see 429); the error field says what was wrong.
401Missing or unknown API key.

The whole walk in one script

This script makes the four requests in order and passes each id on. It reads your key from the ODDFEEDS_KEY environment variable, so the key stays out of your code.

// The whole walk: the countries, a country's leagues, a league's
// matches and the odds of one match. Run it with your key:
//   ODDFEEDS_KEY=<your key> node first-request.mjs
const API = process.env.ODDFEEDS_URL || 'https://oddfeeds.com/api/v1/feeds';

async function ask(body) {
  const res = await fetch(API, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.ODDFEEDS_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(body),
  });
  const feed = await res.json();
  if (feed.status !== 'ok') throw new Error(`${res.status}: ${feed.error}`);
  return feed.data;
}

const countries = await ask({ prematch: true, inplay: true });
const country = countries.find(
  (c) => c.prematch_leagues_cnt > 0 || c.inplay_leagues_cnt > 0);
if (!country) throw new Error('No country has odds right now.');

const leagues = await ask({ scope: 'leagues', tournament_ids: [country.id] });
const league = leagues.find(
  (l) => l.prematch_matches_cnt > 0 || l.inplay_matches_cnt > 0);

const matches = await ask({ scope: 'matches', league_ids: [league.id] });
const match = matches[0];

const odds = await ask({ scope: 'odds', match_ids: [match.id] });
const rows = [...odds.prematch, ...odds.inplay];

const { home, away } = match.teams;
console.log(`${country.name} / ${league.name} / ${home} - ${away}: ${rows.length} prices`);
for (const r of rows.slice(0, 5)) {
  console.log(r.bookmaker.name, r.type_id, r.hc, r.price);
}

Next

The documentation has every scope, field and market table, and the use cases page shows what developers build on these requests.

Try it on live data

The playground in a free account runs these requests in your browser on live data.