# PredictIt Political Markets API
> Live prices from PredictIt, the real-money political prediction market where traders buy and sell shares in the outcome of US elections, economic events and policy questions — served from PredictIt's public market-data feed, no key, nothing stored. Each market asks a question (for example "Which party will control the House?" or "Who will win the 2028 presidential election?") and holds one or more yes/no contracts whose price, between 0 and 1 US dollar, is the market-implied probability of that outcome — a contract trading at 0.27 means the market prices a 27% chance. The markets endpoint lists every open market with its question and contract count. The market endpoint returns a single market with every contract — last trade price, best buy and sell yes/no quotes, last close — and the implied probability. The search endpoint finds markets by keyword (president, Senate, Fed, shutdown). Read what bettors really think will happen, as live JSON. This is the political prediction-market / event-odds cut — distinct from the crypto prediction markets (Polymarket) and the play-money markets in the catalogue.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/predictit-api/..."
```

## Pricing
- **Free** (Free) — 21,000 calls/Mo, 3 req/s
- **Analyst** ($8/Mo) — 235,000 calls/Mo, 10 req/s
- **Pro** ($23/Mo) — 920,000 calls/Mo, 28 req/s
- **Scale** ($54/Mo) — 3,150,000 calls/Mo, 60 req/s

## Endpoints

### Markets

#### `GET /v1/markets` — Every open market with question and contracts

**Parameters:**
- `limit` (query, optional, string) — Max markets (1-400) Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/predictit-api/v1/markets?limit=100"
```

**Response:**
```json
{
    "data": {
        "count": 249,
        "source": "PredictIt",
        "markets": [
            {
                "id": 7589,
                "url": "https://www.predictit.org/markets/detail/7589/How-many-House-seats-will-Republicans-win-in-the-2026-midterm-election",
                "name": "How many House seats will Republicans win in the 2026 midterm election?",
                "status": "Open",
                "short_name": "Republican House Seats won in midterms?",
                "contract_count": 11
            },
            {
                "id": 8152,
                "url": "https://www.predictit.org/markets/detail/8152/Who-will-win-the-2028-Republican-presidential-nomination",
                "name": "Who will win the 2028 Republican presidential nomination?",
                "status": "Open",
                "short_name": "Republican presidential nominee in 2028?",
                "contract_count": 14
            },
            {
                "id": 8153,
                "url": "https://www.predictit.org/markets/detail/8153/Who-will-win-the-2028-Democratic-presidential-nomination",
                "name": "Who will win the 2028 Democratic presidential nomination?",
                "status": "Open",
                "short_name": "Democratic presidential nominee in 2028?",
                "contract_count": 17
            },
            {
                "id": 8155,
                "url": "https://www.predictit.org/markets/detail/8155/Which-party-will-contro
…(truncated, see openapi.json for full schema)
```

### Market

#### `GET /v1/market` — A single market with all contracts and odds

**Parameters:**
- `id` (query, required, string) — Market id Example: `7589`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/predictit-api/v1/market?id=7589"
```

**Response:**
```json
{
    "data": {
        "id": 7589,
        "url": "https://www.predictit.org/markets/detail/7589/How-many-House-seats-will-Republicans-win-in-the-2026-midterm-election",
        "name": "How many House seats will Republicans win in the 2026 midterm election?",
        "note": "Prices are US dollars 0.00-1.00; a contract priced at 0.27 implies a 27% probability.",
        "source": "PredictIt",
        "status": "Open",
        "contracts": [
            {
                "id": 28361,
                "name": "192 or fewer",
                "buy_no": 0.74,
                "status": "Open",
                "buy_yes": 0.27,
                "sell_no": 0.73,
                "end_date": null,
                "sell_yes": 0.26,
                "last_close": 0.26,
                "last_trade": 0.26,
                "implied_probability_pct": 26
            },
            {
                "id": 28362,
                "name": "193 to 197",
                "buy_no": 0.91,
                "status": "Open",
                "buy_yes": 0.1,
                "sell_no": 0.9,
                "end_date": null,
                "sell_yes": 0.09,
                "last_close": 0.11,
                "last_trade": 0.11,
                "implied_probability_pct": 11
            },
            {
                "id": 28369,
                "name": "198 to 202",
                "buy_no": 0.9,
                "status": "Open",
                "buy_yes": 0.11,
                "sell_no": 0.89,
             
…(truncated, see openapi.json for full schema)
```

### Search

#### `GET /v1/search` — Find markets by keyword

**Parameters:**
- `q` (query, required, string) — Search query (min 2 chars) Example: `president`
- `limit` (query, optional, string) — Max results (1-200) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/predictit-api/v1/search?q=president&limit=50"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "query": "president",
        "source": "PredictIt",
        "markets": [
            {
                "id": 8152,
                "url": "https://www.predictit.org/markets/detail/8152/Who-will-win-the-2028-Republican-presidential-nomination",
                "name": "Who will win the 2028 Republican presidential nomination?",
                "status": "Open",
                "short_name": "Republican presidential nominee in 2028?",
                "contract_count": 14
            },
            {
                "id": 8153,
                "url": "https://www.predictit.org/markets/detail/8153/Who-will-win-the-2028-Democratic-presidential-nomination",
                "name": "Who will win the 2028 Democratic presidential nomination?",
                "status": "Open",
                "short_name": "Democratic presidential nominee in 2028?",
                "contract_count": 17
            },
            {
                "id": 8171,
                "url": "https://www.predictit.org/markets/detail/8171/Who-will-win-the-2028-US-presidential-election",
                "name": "Who will win the 2028 US presidential election?",
                "status": "Open",
                "short_name": "2028 US presidential election winner?",
                "contract_count": 13
            },
            {
                "id": 8181,
                "url": "https://www.predictit.org/markets/detail/8181/Which-party-will-win-the-2028-US-presidentia
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/predictit-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Prices are USD 0.00-1.00; 0.27 implies a 27% probability. Get a market id from /v1/markets or /v1/search, then call /v1/market?id=. The full feed is cached ~60s per PredictIt's guidance.",
        "source": "PredictIt (predictit.org/api/marketdata, live)",
        "service": "predictit-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/market": "A single market with all contracts and implied probabilities (id=7589).",
            "GET /v1/search": "Find markets by keyword (q=president, limit=50).",
            "GET /v1/markets": "Every open market with its question and contract count (limit=100)."
        },
        "description": "Live prices from PredictIt, the real-money political prediction market where traders buy and sell shares in the outcome of US elections, economic events and policy questions. Each market asks a question and holds yes/no contracts whose price (0.00-1.00 USD) is the market-implied probability of that outcome. The markets endpoint lists every open market; the market endpoint returns a single market with every contract (last trade, best buy/sell yes and no, last close) and implied probability; the search endpoint finds markets by keyword. Live, no key, nothing stored. The political prediction-market / event-odds cut — distinct from the crypto prediction markets (Polymarket) and play-money markets.",
        "open_markets": 249,
        "upstream_status": "ok"
    },
    "me
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/predictit-api
OpenAPI spec: https://www.oanor.com/api/predictit-api/openapi.json
