---
title: "Main and alternate lines in an odds API"
description: "Use main_line filters, selection IDs and current price states to compare the same betting threshold across bookmakers."
url: https://valueoddsapi.com/guides/odds-api-main-lines/
---

VALUEODDSAPI / BUYER GUIDES

# How do you handle main and alternate lines in an odds API?

Use the v2 main_line filter to choose a view, then verify selection, threshold and price state before comparing bookmakers.

Published by ValueOddsAPI · 2 December 2026

The v2 main-line filter narrows one event or market query. Compare bookmaker prices only after verifying the same selection and line. The diagram shows contract fields, not observed odds or measured coverage.

## In 30 seconds

- Choose your product view first. Send `main_line=true` for main lines or `main_line=false` for alternates on a scoped `GET /v2/odds` request.
- Main is bookmaker-specific. `is_main_line` is determined per event, market, bookmaker and player; it is not a universal threshold for all books.
- Compare the same selection. Check `selection_id`, `line` and `outcome` before comparing prices or using a fair-price estimate.
- Do not assume every row has a flag. Unmapped rows can have `is_main_line: null`; a product that needs them requires the right entitlement.

## What is a main line in this API?

The [v2 PriceRow contract](https://valueoddsapi.com/api-contract.json) defines `is_main_line` per event, market, bookmaker and player. For a market with a numeric line, it marks the open threshold whose two sides are priced closest to even. A market without a line is always marked true; an unmapped price has a null flag. The contract does not promise that two bookmakers will nominate the same threshold as their main line.

An alternate line is another threshold for the same market, such as a different total or handicap. The client must retain the `line` string and `outcome` as separate fields. A label like “main total” cannot replace the actual selection in a comparison table. The [market-mapping guide](https://valueoddsapi.com/guides/market-mapping-odds-api/) explains the distinct roles of market, line and outcome.

## Which request returns main lines or alternates?

Documented GET /v2/odds main-line choices
| Request | Meaning | Integration check |
|---|---|---|
| `main_line=true` | Only prices flagged as main lines. | Supply an `event` or `market` filter; keep it fixed through pagination. |
| `main_line=false` | Only alternate lines. | Use when your product needs a line ladder, not just the primary threshold. |
| No `main_line` parameter | Do not apply the main/alternate filter. | Read and classify each returned `is_main_line` value. |
| `is_main_line: null` | The row is unmapped, so the main-line choice is unresolved. | Do not silently treat null as false. Check mapping and entitlement. |

The filter is documented on [GET /v2/odds](https://valueoddsapi.com/api-contract.json); its definition and null case are in PriceRow. The handling advice in the last column is our integration recommendation.

## Why can two books have different main totals?

Because the main-line flag is assigned within each bookmaker’s open prices, two sources can identify different thresholds for the same event and market. This follows from the per-bookmaker contract definition; it is a possible state, not a measured frequency. A client that joins rows only on `event_id` and `market` could then display unlike selections as competing offers.

For a cross-book comparison, group by a non-null `selection_id`, then verify the visible `line`, `outcome`, player and period match what the user expects. The [price identity guide](https://valueoddsapi.com/guides/odds-api-price-identity/) distinguishes the cross-book selection ID from a bookmaker-specific `price_id`. If mapping is unresolved, do not manufacture a selection join.

## How should an application keep its line view current?

Use a complete, paginated `GET /v2/odds` snapshot for the chosen scope. Each price row carries `status`, `changed_at`, `checked_at` and `is_main_line`. Show only open, sufficiently fresh prices according to your product’s own policy. A suspended or removed quote should not remain an actionable main line merely because it was once displayed.

The [v2 change-feed contract](https://valueoddsapi.com/api-contract.json) documents `GET /v2/odds/changes` for later writes, including status and removals. That endpoint has event, market and bookmaker filters but does not document a `main_line` query parameter. Keep a current store by `price_id` and evaluate each updated row’s flag in the client. If the cursor expires, resync the scoped snapshot as described in the [recovery guide](https://valueoddsapi.com/guides/odds-api-stream-recovery/). Recompute the displayed main-line view from current rows rather than assuming a threshold is permanently primary.

## What should a buyer measure before choosing a package?

Confirm the pilot key’s products, bookmakers and limits with `GET /v2/me`. For the markets your product will actually show, capture complete snapshots with `main_line=true`, `main_line=false` and no flag. Count rows, unique lines and selections with non-null IDs for each query, and record how often the main-line views from two target bookmakers refer to the same selection. These are measurements to make with your own entitled sample, not published coverage percentages.

Include a period of updates and a resync in the pilot. Record rows whose status changes or whose mapping is unresolved, as well as payload bytes and page counts. The [bandwidth worksheet](https://valueoddsapi.com/guides/odds-api-bandwidth/) explains how to measure transfer separately from database storage. Compare the observed requirements with [current plan descriptions](https://valueoddsapi.com/pricing/) and your `/v2/me` response; do not infer coverage or rights from a generic example.

## Frequently asked questions

**Does main_line=true return every available threshold? **

No. It filters to the main line. Use main_line=false for alternates, or omit the filter and classify returned rows.

**Does “main” mean the same line at every bookmaker? **

No. The v2 flag is defined per bookmaker. Compare selection_id and the displayed line before treating prices as comparable.

**Is an unmapped line an alternate? **

Not necessarily. An unmapped row can have is_main_line: null, which is an unresolved state rather than false.

**Can the changes endpoint be filtered with main_line=true? **

The published v2 contract does not document that filter on /v2/odds/changes. Filter the current rows in your client and resync if needed.

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.

## Run a same-selection pilot

Choose one target market family and two entitled bookmakers. Fetch all pages for each main-line mode, reconcile the returned selections, and test updates and removals. Report your sample size, filters and observation window alongside the share of directly comparable selections. The result is a buying criterion grounded in your own product, not a claim about a universal “best” line.
