Skip to Content
API ReferenceClosing Line

Closing Line

Returns the closing-line snapshot for an event — the per-book odds captured the moment each sportsbook flipped the event from pre-match to live. The endpoint is the canonical source for closing-line value (CLV) analysis on bets placed before tip-off.

GET /api/v1/odds/closing

Each sportsbook is captured independently the first time it transitions a given event to is_live=true. Captured snapshots live in Valkey for 48 hours after the event starts. Beyond that window, use /api/v1/historical/odds/closing (Enterprise, ClickHouse-backed).

Authentication

Requires API key. Available to Pro, Sharp, and Enterprise tiers (closing_line feature).

Query Parameters

ParameterTypeDefaultDescription
event_idstringrequiredEvent identifier. Same IDs as /api/v1/events.
sportsbookstringallComma-separated book filter (e.g., draftkings,fanduel). books= is accepted as a legacy alias.

event_id is required. Omitting it returns 400 validation_error. Invalid characters in the value also return 400 validation_error.

Example Requests

curl -X GET "https://api.sharpapi.io/api/v1/odds/closing?event_id=mlb_athletics_mariners_2026-04-22" \ -H "X-API-Key: YOUR_API_KEY"

Response

{ "success": true, "data": { "event_id": "mlb_athletics_mariners_2026-04-22", "sport": "baseball", "league": "mlb", "home_team": "Seattle Mariners", "away_team": "Athletics", "event_start_time": "2026-04-22T22:10:00Z", "captured_at": "2026-04-22T22:09:58.412Z", "books": { "draftkings": [ { "sportsbook": "draftkings", "market_type": "moneyline", "selection": "Seattle Mariners", "selection_type": "home", "odds_american": -165, "odds_decimal": 1.606 }, { "sportsbook": "draftkings", "market_type": "spread", "selection": "Seattle Mariners", "selection_type": "home", "line": -1.5, "odds_american": 130, "odds_decimal": 2.30 } ], "pinnacle": [ { "sportsbook": "pinnacle", "market_type": "moneyline", "selection": "Seattle Mariners", "selection_type": "home", "odds_american": -158, "odds_decimal": 1.633 } ] } }, "meta": { "source": "valkey", "updated_at": "2026-04-22T17:34:54.692Z" } }

Empty Response

If no closing snapshot has been captured (event hasn’t started yet, or event ID has no captures within the 48h window), the response returns an empty books object:

{ "success": true, "data": { "event_id": "mlb_athletics_mariners_2026-04-22", "books": {} }, "meta": { "source": "valkey", "updated_at": "2026-04-22T17:34:54.692Z" } }

Response Fields

FieldTypeDescription
data.event_idstringEvent identifier echoed from the request.
data.sportstringSport (e.g., baseball). Empty when no captures exist.
data.leaguestringLeague (e.g., mlb). Empty when no captures exist.
data.home_team, data.away_teamstringTeam names. Empty when no captures exist.
data.event_start_timestringISO 8601 scheduled start time.
data.captured_atstringISO 8601 timestamp of the first capture (the earliest book to flip the event live).
data.booksobjectMap of book_id → ClosingOdd[]. Empty {} if nothing captured.

ClosingOdd shape

FieldTypeDescription
sportsbookstringBook identifier (lowercase).
market_typestringe.g., moneyline, spread, total, player_prop.
selectionstringSelection label (e.g., team name, player name, over, under).
selection_typestringhome, away, over, under, etc.
linenumber?Spread or total line, when applicable. Omitted on moneylines.
odds_americanintegerAmerican-format odds at the moment of capture.
odds_decimalnumberDecimal-format odds (3 decimal places).
player_namestring?Present for player props.
stat_categorystring?Stat category (points, rebounds, etc.) for player props.

Caching

Responses are cached at the edge for 30s (s-maxage=30) and at the client for 10s (max-age=10). Closing snapshots don’t change after capture, so this is safe.

Error Codes

StatusCodeMeaning
400validation_errorMissing or malformed event_id.
401missing_api_key / invalid_api_keySee Authentication.
403tier_restrictedTier below Pro.
503not_readyClosing-line capture is not currently available (e.g., backing store unreachable). Retry.
Last updated on