Skip to content

VALUEODDSAPI / BUYER GUIDES

How should you key odds API prices in your database?

Use price_id for each quote, selection_id for mapped cross-bookmaker comparison, and event_id for the fixture join.

Published by ValueOddsAPI · 30 November 2026

A price ID links one odds row across REST, changes and history while a selection ID groups the comparable selection across bookmakers
Use price_id for the current quote and selection_id for a mapped cross-bookmaker comparison. This is a schema diagram; the labels are documented fields, not sample odds.

In 30 seconds

Which ID identifies one bookmaker quote?

The v2 PriceRow schema describes price_id as the same identifier in REST, streaming and history. It is the natural key for an application’s current-price row. A change for that ID should update the row’s price, status and observation time. Do not key a quote only by event_id: one event can have many bookmakers, markets, lines and outcomes.

selection_id has a different job. The schema says it is the same across bookmakers and null when the price is unmapped. Compare mapped quotes for the same selection, but retain price_id as the identity of each bookmaker quote. See the mapping guide for semantic checks before publishing a comparison.

What should a price-store schema retain?

Keys and state for a current-price table
FieldDocumented roleSuggested client use
price_idSame ID in REST, stream and historyPrimary upsert key for the current quote.
event_idReference to the eventJoin to sport, teams, start time and phase.
selection_idCross-bookmaker selection; nullable if unmappedGroup only comparable mapped prices.
bookmaker, market, line, outcomeSource and selection dimensionsAudit what the quote represents before display.
status, price, checked_atAvailability, last value and observation timeSeparate stored row from current actionable offer.

The contract defines the fields and nullability. The storage pattern is a recommendation; no particular database engine is required.

How do updates and removals affect the key?

The change-feed description says writes include new prices, status changes, removals and mapping changes. Keep the row keyed by price_id while applying those states. A removed row may carry price: null; treating null as decimal zero or leaving the old price in an actionable display would misrepresent availability.

Apply the documented change cursor in order and design for at-least-once delivery. An upsert keyed by price_id makes replay safe for your current-state table, provided you also preserve the ordering semantics documented for your chosen endpoint. After a cursor failure, rebuild from a fresh snapshot; the pagination guide explains complete snapshot reads.

What if an event is merged?

The Event schema has merged_into and previous_ids. Keep an alias from an old event ID to the surviving event ID when those fields are present. That lets an application join historical references without pretending that two event records are independent fixtures. Do not infer a merge solely from similar team names or kickoff time.

In a pilot, select actual entitled events. Record each event ID and the number of distinct price IDs before and after a snapshot refresh. Count duplicate current rows, unresolved event aliases and unmapped selection IDs as separate measures. Publish the denominator and observation window; do not turn a local sample into a general coverage claim.

Frequently asked questions

Can event_id be the primary key of an odds table?

Not for individual quotes. An event can contain many bookmakers, markets, lines and outcomes; price_id identifies a quote row in the v2 schema.

Is selection_id always present?

No. The v2 PriceRow schema permits null for an unmapped price.

Should a removed price be deleted immediately?

You may retain it for audit, but do not display it as an open offer. The change feed marks removal and the current price can be null.

ValueOddsAPI provides odds data, not betting advice. Betting involves risk of loss and is for adults (18+) only. If gambling stops being fun, contact your local support service, such as StopSpillet in Denmark.

Validate the row model

Compare your current-price table with an entitled v2 REST response, one change-feed replay and a fresh snapshot. Measure duplicate and missing price_id values before selecting a production storage design.