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

# CLV — Closing Line Value

> Measure value against the Pinnacle closing price — the single best predictor of long-term betting profit.

**CLV** (Closing Line Value) compares the **price you bet at** to the **closing price** (the last fair odds just before kick-off). Because Pinnacle's closing line is the sharpest on the market, consistently beating it is **the best predictor of long-term profit** — far more reliable than the outcome of any single bet.

Positive CLV = you took a **better** price than the final market. Over hundreds of bets, a positive average CLV trends toward positive ROI.

## How to compute it

`CLV% = (bet_odds / closing_odds − 1) × 100`

Example: you bet at **2.10**, the close settles at **1.90**. `2.10 / 1.90 − 1 = +10.5%` → you beat the close by 10.5%.

<Info>
  Use the **fair** (devigged, `todds`) closing price rather than the raw odds: the margin skews the comparison. The `/api/clv` endpoint already returns a margin-free CLV.
</Info>

## With apinn

The [`/api/clv`](/en/api-reference/introduction) endpoint does the math for you: pass the event, period, market, selection and your `bet_price`.

<Steps>
  <Step title="Query the CLV of a bet">
    ```bash theme={null}
    curl "https://api.apinn.io/api/clv?event_id=1632370816&period=0&market=moneyline&selection=draw&bet_price=3.5" \
      -H "X-API-Key: YOUR_KEY"
    # → { "closing_price": 3.11, "clv_pct": 12.54 }
    ```
  </Step>

  <Step title="Track your portfolio's average CLV">
    Store each bet's `clv_pct` and track the **average** over time — it's your profitability compass.
  </Step>
</Steps>

```python Python theme={null}
import requests

BASE, H = "https://api.apinn.io", {"X-API-Key": "YOUR_KEY"}

# your past bets: (event_id, period, market, selection, price taken)
bets = [
    (1632370816, 0, "moneyline", "draw", 3.5),
    (1632370817, 0, "moneyline", "home", 1.95),
]

clvs = []
for event_id, period, market, sel, price in bets:
    r = requests.get(f"{BASE}/api/clv", headers=H, params={
        "event_id": event_id, "period": period, "market": market,
        "selection": sel, "bet_price": price}).json()
    clvs.append(r["clv_pct"])
    print(f"{event_id} {sel}: CLV {r['clv_pct']:+.2f}%  (close {r['closing_price']})")

if clvs:
    print(f"\nAverage CLV: {sum(clvs)/len(clvs):+.2f}%")
```

## Best practices

* **Judge on CLV, not the result**: a losing bet with positive CLV is still a good decision.
* **Volume**: CLV only means something aggregated over many bets.
* **Timing**: the earlier you bet (before the line hardens), the higher the potential CLV — see [dropping odds](/en/concepts/dropping-odds).
* **Benchmark**: always compare against the **Pinnacle** close, the most efficient line.
