> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xinsider.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The Markdown of an API reference page leaves out the OpenAPI schema.
> Every object an endpoint returns or a webhook carries, with each field's type, presence and meaning, is on https://docs.0xinsider.com/api-reference/objects.md.
> The full OpenAPI 3.1 spec names each operation's and each webhook's exact parameters, request body and response schema: https://docs.0xinsider.com/api-reference/openapi.json.

# Market closing line

> Get a sports or esports market's closing price on each side, the price at kickoff, with where it came from.

Use this endpoint to read the price a market closed at: Polymarket's own price for each outcome in the last minute before the game started. It is the line every large trade's `clv` is measured against, so you can check any trade's closing line value yourself.

For one wallet's closing line value over many trades, use [Trader closing line value](https://docs.0xinsider.com/api-reference/endpoint/get-trader-clv.md).

## Parameters

| Parameter | Description |
| - | - |
| `condition_id` | Polymarket's own id for the market, or the market's `mkt_` id. |

## Key response fields

| Field | Meaning |
| - | - |
| `status` | `measured` when the close is stored and `outcomes` carries it. `pending` when it is not stored yet and 0xinsider will still read it, for example before kickoff or before the market settles. `unavailable` when no close will be served. |
| `unavailable_reason` | Why there is no close. It is set only when `status` is `unavailable`. The values are listed below. |
| `outcomes` | One entry per side, YES then NO, when `status` is `measured`. It is an empty list otherwise. |
| `outcomes[].close_price` | The side's closing price, from 0 to 1 (0.62 is 62 cents). |
| `outcomes[].derived_from_yes` | `true` on the NO side. Its price is 1 minus the YES price, because Polymarket's two prices for a market add up to 1. |
| `close_anchor_at` | The time the close was measured at, which is the market's kickoff when 0xinsider stored it. |
| `game_start_time` | The market's kickoff as 0xinsider has it now. |
| `anchor_stale` | `true` when the kickoff has moved by more than `lookback_seconds` since the close was stored, for example after a postponement. Large trades on such a market carry no closing line value. |
| `observed_at`, `observation_window_seconds` | The price interval the close comes from. It starts at `observed_at`, lasts 60 seconds (3,600 for a game played more than about six days before it was read), and ends at or before `close_anchor_at`. |
| `lookback_seconds` | How far before kickoff that interval may start: 21,600 seconds (6 hours). With no price in that time, the market is `unavailable`. |
| `price_source`, `basis_version` | The Polymarket price history the close was read from and the version of the rules it was read under. |
| `captured_at` | When 0xinsider stored the close. A close is stored once and never changes. |

### Why a close is unavailable

| `unavailable_reason` | Meaning |
| - | - |
| `no_observation_in_lookback` | Polymarket's price history has no interval that ends in the 6 hours before kickoff. |
| `provider_empty_window` | Polymarket returned no prices for that time. |
| `provider_invalid_contract` | Polymarket's answer was not in the shape its documentation describes. |
| `capture_window_closed` | 0xinsider did not read the market within 30 days of its kickoff. |
| `no_game_start_time` | The market has no kickoff time, so it has no close. |
| `not_one_sided_resolution` | The market resolved to neither side, for example a cancelled game. |
| `not_captured` | 0xinsider does not read this market's close: no tracked wallet bought it before it resolved, or its kickoff was more than 30 days ago. |
| `close_token_mismatch` | The close was read for a different YES token than the market has now, so it cannot be paired with today's outcomes. |

## Example

```bash theme={null}
curl -H "Authorization: Bearer $OXINSIDER_API_KEY" \
  "https://api.0xinsider.com/api/v1/market/0x123.../close"
```

## What it does not return

* A price computed from the last trade. The close is Polymarket's own price history, read once after the market settles.
* A close for a market outside sports and esports. That market returns `404` with `error.reason` `market_out_of_scope`, and a market 0xinsider has no record of returns `404` too.
* `0` in place of a missing price. A market without a close says `pending` or `unavailable`.
* Several markets at once. Request each market, or read `clv.close_price` on its large trades.

## Caching

Save the response's `ETag` and send it in `If-None-Match` on your next request. If nothing has changed, the server returns `304 Not Modified` with no body. A `measured` close never changes.


## API Specification

The full API specification for this endpoint is available in the [documentation index](https://docs.0xinsider.com/llms.txt).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.