> ## 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.

# Build with Claude

> Connect Claude to apinn and build a dropping-odds detector in plain English.

apinn ships an [MCP server](/en/mcp-server): **Claude calls the API directly** (sports, fixtures, odds, history) in natural language. Copy the prompt below and Claude builds you a **dropping odds** system (spotting odds that shorten — a sign of sharp money).

## 1. Connect Claude to apinn

<CodeGroup>
  ```bash Claude Code theme={null}
  claude mcp add --transport http apinn https://docs.apinn.io/mcp
  ```

  ```json Claude Desktop / Cursor theme={null}
  {
    "mcpServers": {
      "apinn": { "url": "https://docs.apinn.io/mcp" }
    }
  }
  ```
</CodeGroup>

When Claude calls the API, give it your **key** (`pnk_…`, from your [dashboard](https://www.apinn.io/account)). No MCP? The prompt also works by giving Claude HTTP access: base `https://api.apinn.io`, header `X-API-Key`.

## 2. The "dropping odds" prompt

<Info>
  A **dropping odd** = an outcome whose decimal price **drops** (shortens) meaningfully over time (e.g. 2.50 → 2.10). Shorter odds = rising implied probability = money coming in on that side. It's a *steam move* / sharp-action signal.
</Info>

Paste this into Claude as‑is (tweak the key and parameters at the top):

```text Prompt theme={null}
You have access to the apinn API (real-time Pinnacle odds) via the "apinn" MCP tools
(or over HTTP: base https://api.apinn.io, header  X-API-Key: MY_KEY ).

GOAL — Build me a "DROPPING ODDS" monitor.
A dropping odd = an outcome whose decimal price has DROPPED (shortened)
significantly over time → a sign of sharp money / a steam move.

PARAMETERS (change as needed):
- sport       = 29         # 29=football, 33=tennis, 4=basketball
- market      = moneyline  # moneyline | spread | totals
- drop_pct    = 8          # minimum % drop to flag
- odds_min/max= 1.30 / 6.00    # ignore extremes
- refresh     = 60         # seconds between passes

METHOD:
1. Get live matches:
   GET /api/fixtures?sport_id={sport}&live=1
2. For each event, get the full odds history:
   GET /api/odds?event_id={id}&full_history=1&main_lines_only=1&market={market}
   (each row has a timestamp + odds1=home, odds0=draw, odds2=away ;
    todds1/0/2 = the same prices WITHOUT the margin — use them for a cleaner signal).
3. For each outcome, take the OPENING price (first snapshot) and the CURRENT price
   (last snapshot). Compute  drop% = (open − current) / open × 100.
4. Keep outcomes where  drop% ≥ drop_pct  AND  odds_min ≤ current ≤ odds_max.
5. Sort by drop% descending.
6. Print a table: match | market | outcome | open → current | drop% | minutes since open.
7. Re-run every {refresh}s ; only alert on NEW or increasing drops.

Every response returns quota headers (X-Quota-Remaining) — respect the limit (5,000 req/h).
Start now: list the current dropping odds.
```

## 3. Take it further

<CardGroup cols={2}>
  <Card title="A standalone script" icon="python">
    Ask Claude: *"turn this into a standalone Python script that loops and alerts me (print/Telegram) on every new dropping odd"*.
  </Card>

  <Card title="Real-time" icon="bolt" href="/en/concepts/streaming">
    For sub‑second, have Claude read the SSE stream `/api/stream` instead of polling.
  </Card>
</CardGroup>

<Tip>
  Handy variants to ask Claude for: **rising odds** (prices drifting out = money leaving), **opening vs closing** comparison (CLV), restrict to certain **leagues**, or window over the **last N minutes** instead of since the open.
</Tip>
