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

# Sports Markets

PolyNode sports endpoints expose Polymarket-native sports market data: leagues, teams, games, markets, token IDs, current CLOB prices, and historical price series.

These endpoints replace the old sportsbook/OddsJam experiment. They do not return sportsbook odds. They return Polymarket market prices and metadata, normalized around sports games.

## Endpoints

| Endpoint                                | Description                                                                                  |
| --------------------------------------- | -------------------------------------------------------------------------------------------- |
| `GET /v2/sports/leagues`                | Sports and esports league metadata from Polymarket Gamma                                     |
| `GET /v2/sports/summary`                | League-level active/live/date summary                                                        |
| `GET /v2/sports/live`                   | Backward-compatible live overview derived from `/sports/summary`                             |
| `GET /v2/sports/leagues/{league}/teams` | Teams for a league, with logos and records when available                                    |
| `GET /v2/sports/leagues/{league}/games` | Games/events for a league, including markets, token IDs, and Gamma fallback metadata         |
| `GET /v2/sports/games/{slug}`           | Full game/event detail with normalized markets                                               |
| `GET /v2/sports/games/{slug}/state`     | Canonical game state: metadata, score fields, markets, current prices, and subscribe payload |
| `GET /v2/sports/games/{slug}/context`   | Agent-friendly context bundle from generated game queries and optional external sources      |
| `GET /v2/sports/games/{slug}/prices`    | Current bid, ask, midpoint, and spread for game tokens                                       |
| `GET /v2/sports/games/{slug}/history`   | Batch CLOB price history for game tokens                                                     |
| `GET /v2/sports/market-types`           | Polymarket sports market type codes with PolyNode labels/categories                          |
| `GET /v2/sports/search?q={query}`       | Search sports events and teams                                                               |

## Game state

## League games

Use league games for schedule discovery, such as listing all active FIFA World Cup match markets:

```bash theme={null}
curl "https://api.polynode.dev/v2/sports/leagues/fifwc/games?status=active&sort=startDate&direction=asc&limit=50" \
  -H "x-api-key: YOUR_KEY"
```

The response is filtered and sorted by PolyNode after resolving the league code to Polymarket's sports `series_id`. If Polymarket Gamma's primary event listing is unavailable, the response can still succeed through alternate Gamma sources and will include `fallback: true`. If Gamma is fully unavailable and PolyNode has a recent good response, it returns that cached response with `stale: true`.

Use this when you want one game-centric object instead of manually joining game metadata, CLOB prices, markets, and websocket subscription details.

```bash theme={null}
curl "https://api.polynode.dev/v2/sports/games/nba-cle-nyk-2026-05-31/state?price_limit_tokens=20" \
  -H "x-api-key: YOUR_KEY"
```

```json theme={null}
{
  "slug": "nba-cle-nyk-2026-05-31",
  "title": "Cavaliers vs. Knicks",
  "status": "scheduled",
  "source": {
    "metadata": "polymarket_gamma",
    "prices": "polymarket_clob",
    "history": null,
    "score": "polymarket_gamma"
  },
  "score": {
    "source": "gamma:event",
    "score": null,
    "period": "NS",
    "live": null,
    "freshness": "unknown"
  },
  "markets": [
    {
      "question": "Cavaliers vs. Knicks",
      "sportsMarketType": "moneyline",
      "clobTokenIds": ["..."],
      "prices": [
        {
          "outcome": "Cavaliers",
          "best_bid": "0.31",
          "best_ask": "0.47",
          "midpoint": "0.39",
          "spread": "0.16"
        }
      ]
    }
  ],
  "subscribe": {
    "ws": "wss://ws.polynode.dev/ws",
    "action": "subscribe",
    "type": "orderbook",
    "token_ids": ["..."]
  }
}
```

Add `include_history=true` to include CLOB price history in the same response:

```bash theme={null}
curl "https://api.polynode.dev/v2/sports/games/nba-cle-nyk-2026-05-31/state?include_history=true&history_limit_tokens=2&interval=1d" \
  -H "x-api-key: YOUR_KEY"
```

## Game context

Use this for agent workflows that need game-specific search context next to the normalized sports object. PolyNode generates a small set of matchup, injury, lineup, news, or market-specific queries from the Polymarket game record, then runs the requested sources.

```bash theme={null}
curl "https://api.polynode.dev/v2/sports/games/nba-cle-nyk-2026-05-31/context?sources=x,online&query_set=injuries&max_queries=2&max_per_query=5&include_state=true&price_limit_tokens=20" \
  -H "x-api-key: YOUR_KEY"
```

```json theme={null}
{
  "slug": "nba-cle-nyk-2026-05-31",
  "title": "Cavaliers vs. Knicks",
  "query_set": "injuries",
  "generated_queries": [
    {
      "id": "matchup-injuries",
      "query": "Cavaliers Knicks injury",
      "reason": "Availability and injury context for both teams."
    }
  ],
  "sources_requested": ["x", "online"],
  "sources": {
    "x": {
      "status": "ok",
      "result_count": 5,
      "queries": [
        {
          "query": "Cavaliers Knicks injury",
          "tweets": []
        }
      ]
    },
    "online": {
      "status": "ok",
      "source": "search_online",
      "adapter": "searxng",
      "queries": []
    }
  },
  "state": {
    "slug": "nba-cle-nyk-2026-05-31",
    "markets": []
  }
}
```

Parameters:

| Parameter            | Description                                                                                                                      |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `sources`            | Comma-separated sources. Defaults to `x`. Supported: `x`, `online`. `web`, `search`, `ddg`, and `ddg_instant` alias to `online`. |
| `query_set`          | Query strategy. Supported: `default`, `injuries`, `lineups`, `news`, `social`, `markets`.                                        |
| `max_queries`        | Number of generated queries to run. Defaults to `3`, capped at `5`.                                                              |
| `max_per_query`      | Per-source result count per query. Defaults to `5`, capped at `10`.                                                              |
| `include_state`      | Include the `/state` response in the same payload. Defaults to `false`.                                                          |
| `price_limit_tokens` | Token cap used when `include_state=true`. Defaults to `20`, capped at `200`.                                                     |

The `x` source uses the same X Search beta quota and 1 request/second key-level rate limit as `/v2/x/search`. Each generated X query consumes one X Search quota unit. The `online` source uses `/v2/search/online` and returns normalized public web results.

## Current prices

```bash theme={null}
curl "https://api.polynode.dev/v2/sports/games/nba-nyk-cle-2026-05-25/prices?limit_tokens=10" \
  -H "x-api-key: YOUR_KEY"
```

```json theme={null}
{
  "slug": "nba-nyk-cle-2026-05-25",
  "title": "Knicks vs. Cavaliers",
  "source": "polymarket_clob",
  "count": 10,
  "total_tokens": 106,
  "truncated": true,
  "tokens": [
    {
      "token_id": "36872217940161491972120830074682109141065398170878601426051147635064624582652",
      "outcome": "Knicks",
      "question": "Knicks vs. Cavaliers",
      "market_type": "moneyline",
      "best_bid": "0.56",
      "best_ask": "0.57",
      "midpoint": "0.565",
      "spread": "0.01"
    }
  ],
  "subscribe": {
    "ws": "wss://ws.polynode.dev/ws",
    "action": "subscribe",
    "type": "orderbook",
    "token_ids": ["..."]
  }
}
```

## Price history

```bash theme={null}
curl "https://api.polynode.dev/v2/sports/games/nba-nyk-cle-2026-05-25/history?limit_tokens=2" \
  -H "x-api-key: YOUR_KEY"
```

`limit_tokens` defaults to `20` and is capped at `20` because Polymarket's batch history endpoint caps requests at 20 market asset IDs. If you do not pass `interval`, `start_ts`, or `end_ts`, PolyNode requests the full available CLOB history with `interval=max`.

```json theme={null}
{
  "slug": "nba-nyk-cle-2026-05-25",
  "source": "polymarket_clob",
  "count": 2,
  "total_tokens": 106,
  "truncated": true,
  "tokens": [
    {
      "token_id": "36872217940161491972120830074682109141065398170878601426051147635064624582652",
      "outcome": "Knicks",
      "history": [
        { "t": 1779615604, "p": 0.555 }
      ]
    }
  ]
}
```

## Notes

* `prices` fans out to Polymarket CLOB batch price, midpoint, and spread endpoints.
* `history` uses Polymarket CLOB batch price history. Bare `/history` calls default to `interval=max`; pass `interval=1d`, `interval=1w`, or an explicit `start_ts`/`end_ts` window when you want a smaller range.
* Scores are included only where Polymarket Gamma has score fields on the event. Use score fields as best-effort metadata, not guaranteed live scoreboard state.
* For live orderbook updates, use the returned `subscribe.token_ids` with PolyNode orderbook WebSocket.
