Normalizing Odds Across Sportsbooks: Events, Markets and IDs

How multi-source odds data is normalized into one schema. Event matching, team and player ids, market keys, periods, selection ids that join across books, and how to treat suspended and removed prices.

Normalizing odds across sportsbooks is mostly a naming problem. Every source has its own way of identifying a game, writing a team name, labelling a market and marking a period. A price only means something once you know exactly which game, which outcome and which line it belongs to. If those links are wrong, every comparison built on top of them is wrong too, and nothing shows it.

PreciseAPI normalizes 36 sources (23 sportsbooks, 7 exchanges, and 6 DFS pick'em apps) across 17 leagues into one schema. This post covers how that schema is organized, which ids to rely on for what, and the edge cases that matter when you join odds to your own data or compare books.

Five objects, five id types

Everything in the API is built from five objects. Every id is an opaque string with a type prefix and never changes.

ObjectId formatIdentifies
Eventevt_…A game, match, fight or golf matchup
Team / competitor{league}_…, e.g. nba_lalA team, or a slugged name in individual sports, e.g. tennis_carlos_alcaraz
Playernikola_jokicA player with prop coverage, keyed by the normalized name
Marketmkt_…One source's offer for a market key and period on an event, plus player or team where relevant
Selectionsel_…One outcome at one line, shared across every source

The table packs in one important asymmetry. Market ids are per source: DraftKings' full-game spread on a game and Pinnacle's full-game spread on the same game have different market ids. Selection ids are shared: the home team at −4.5 has the same selection id at every book that offers it. Most of what follows depends on that distinction. The data model reference has the full field list.

Event matching when normalizing odds across sportsbooks

Before you can compare prices for a game across 36 sources, you have to know they're all describing the same game. Sources can disagree on team naming, how precisely they report start times, and which side they list as home. Doubleheaders and neutral-site games make it harder still.

PreciseAPI resolves this upstream, as the first step of its odds normalization. Each game gets one evt_ id, and every source's markets for that game hang off it. The id stays the same through the whole scheduled → live → final lifecycle, so you can cache by event id without worrying about a game being re-keyed when it goes in-play. /v1/events/{id} lists the sources currently pricing an event and the market keys available for it.

Matching your own data to event ids

You face the same problem in reverse when you join odds to your own schedule, stats feed or content system. Do it in two stages: map team names to team ids, then match games on league, both team ids and a start-time window.

const API = 'https://api.preciseapi.com/v1';
const headers = { Authorization: `Bearer ${process.env.PRECISEAPI_KEY}` };
const norm = (s) => String(s).toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(/[^a-z0-9]/g, '');

// Stage 1: team names -> team ids. /v1/teams costs 1 credit; cache it.
async function teamIndex(league, overrides = {}) {
  const { data } = await (await fetch(`${API}/teams?league=${league}`, { headers })).json();
  const index = new Map();
  for (const t of data) for (const k of [t.id, t.name, t.abbr]) if (k) index.set(norm(k), t.id);
  for (const [alias, id] of Object.entries(overrides)) index.set(norm(alias), id); // your own spellings
  return index;
}

// Stage 2: one of your rows -> an event id.
function matchEvent(row, events, index) {
  const home = index.get(norm(row.home));
  const away = index.get(norm(row.away));
  if (!home || !away) return { status: 'unmapped_team' };
  const t = Date.parse(row.start);
  const near = events.filter((e) => e.league === row.league && Math.abs(Date.parse(e.start_time) - t) <= 6 * 3_600_000);
  const byGap = (a, b) => Math.abs(Date.parse(a.start_time) - t) - Math.abs(Date.parse(b.start_time) - t);
  const exact = near.filter((e) => e.home.id === home && e.away.id === away).sort(byGap);
  if (exact.length) return { status: 'matched', id: exact[0].id, ambiguous: exact.length > 1 };
  const swapped = near.find((e) => e.home.id === away && e.away.id === home);
  if (swapped) return { status: 'matched_swapped', id: swapped.id };
  return { status: 'no_match' };
}

Some design notes:

Players

/v1/players (1 credit) returns players with prop coverage, their position and team. Player ids are stable across seasons and books. You can filter by team using either the team id (nba_lal) or the abbreviation (LAL). Every prop market carries a player object with id, name, team and position, so join on player.id and keep names for display. For individual sports such as tennis, UFC and golf, /v1/teams returns the competitors themselves.

Market keys

Market labels are the other half of normalizing odds across sportsbooks: sources label the same market in many different ways. PreciseAPI uses over 100 market keys in five groups. The free /v1/markets endpoint returns them, optionally filtered by league.

GroupKeys
Main linesmoneyline, spread, total
Alternatesalternate_spread, alternate_total, alternate_team_total
Team totalsteam_total
Player propsplayer_points, player_rebounds, player_assists, player_threes, player_pra, player_pass_yds, player_pass_tds, player_rush_yds, player_rec_yds, player_receptions, player_strikeouts, player_hits, player_total_bases, player_shots_on_goal
Futuresoutright

A few rules make these keys consistent across sports:

Market identity and selection ids

A market's identity is its event, source, key, period, subject (player or team) and DFS variant. The line isn't part of it. When a book moves its spread from −3 to −3.5, the market id stays the same, but the outcomes change, and so do their selection ids, because the point is part of a selection's identity.

That gives you two joins for two different questions:

const dec = (a) => (a > 0 ? 1 + a / 100 : 1 + 100 / -a);

// Best price per selection for one event from /v1/odds.
function bestBySelection(event) {
  const best = new Map(); // sel id -> { key, name, point, price, books }
  for (const book of event.bookmakers) {
    if (book.type === 'dfs') continue; // pick'em entries aren't priced like book odds
    for (const m of book.markets) {
      if (m.suspended || (m.variant && m.variant !== 'standard')) continue;
      for (const o of m.outcomes) {
        const cur = best.get(o.id);
        if (!cur || dec(o.price) > dec(cur.price)) best.set(o.id, { key: m.key, name: o.name, point: o.point, price: o.price, books: [book.id] });
        else if (o.price === cur.price) cur.books.push(book.id);
      }
    }
  }
  return best;
}

The server-side version of this is /v1/best-lines. It groups comparable markets by key, period, subject and line, and only reports a group when at least two sources quote it. Alternates, suspended markets, DFS sources and non-standard variants are left out. It returns best_price and the tied best_books for each outcome. The odds comparison API page covers typical uses, and the line shopping glossary entry explains the concept.

Periods

Period is part of a market's identity. A first-half total and a full-game total are different markets that happen to share a key. PreciseAPI uses five period keys, and each league exposes the ones that apply to it:

PeriodsLeagues
full_game, 1h, 1qNFL, NBA
full_game, 1hNCAAF, CFL, WNBA, NCAAB, Soccer
full_game, f5MLB
full_game, 1pNHL
full_gameTennis, PGA, UFC and esports

Three practical notes:

Suspended, removed and stale prices

When normalizing odds across sportsbooks, a wrong price causes more harm than a missing one, so the schema separates "this market is temporarily unreliable" from "this market no longer exists":

StateRESTStreamWhat to do
ActiveIncludedIn the snapshot and deltasUse it
Suspended (source stopped reporting)Left out unless include_suspended=trueDelta with suspended: true, left out of snapshotsShow it greyed out and leave it out of comparisons
Removed (source pulled it)AbsentEntry in removed with the market_idDelete it
Event finishedOn /v1/scores for four hoursevent message with status finalArchive it

Note how updated_at behaves. It records the last time the market's price or line changed, not the last time the source confirmed it. A quiet pre-game moneyline can have an old updated_at and still be current. Use suspension as the authoritative stale signal, and use /v1/sportsbooks (free), which reports each source's live health status, for monitoring. After kickoff, a player prop stays only while its source keeps posting it, so expect some to go suspended when the game starts. The odds screen guide shows how to present all of this in a UI.

Prices default to American odds. Pass format=decimal (three decimal places) or format=probability to receive another representation. Probabilities are implied and still include each source's margin. The API doesn't remove vig, so you can apply whatever method you prefer, such as the one in our no-vig fair odds guide, or check a single market with the no vig calculator. Every paid plan returns this same schema; odds API pricing compares credits, rate limits and features.

Frequently asked questions

Do event ids change when a game goes live?

No. Event ids are kept through scheduled, live and final, and market ids stay stable as prices and lines move. Selection ids change only when the line changes, because the point is part of their identity.

How do I compare books that are offering different lines?

Group markets by key, period and subject, and keep the line as a column. Selection ids join identical outcomes at identical lines. /v1/best-lines groups by line as well, so a book offering a different line shows up in a separate group.

How do I map my own team names to PreciseAPI ids?

Build an alias index from /v1/teams (1 credit per league) covering id, name and abbreviation, then add overrides for your own spellings. Match games on league, both team ids and a start-time window, then store the resulting evt_ id.

Can I compare DFS pick'em lines with sportsbook props?

They come back in the same shape from /v1/props, keyed by the same player_* market keys and player ids. Compare standard lines with standard lines only, because goblin and demon lines are deliberately offset. See the DFS API page.

Why is a market in one response but missing from the next?

The source either suspended it, in which case it's hidden unless you pass include_suspended=true, or removed it. A prop its source stops posting after kickoff is suspended the same way. Request with include_suspended=true to tell the two cases apart.

Keep reading