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

# Public Market Data

> Read endpoints under /api/public/* — markets, search, regime, gov, econ, content, theses, and skills.

Endpoints under `/api/public/*` are public read surfaces by default. Most do not require an API key for basic use. Auth may unlock higher rate limits, higher model tiers, or user-specific overlays on supported routes.

## Markets

| Endpoint | Purpose |
| - | - |
| `GET /api/public/markets` | Market universe (paginated) |
| `GET /api/public/newmarkets` | Recently listed markets |
| `GET /api/public/scan` | Multi-mode scan: keyword, series, market |
| `GET /api/public/screen` | Indicator-based screener |
| `GET /api/public/screen-by-tickers` | Screen explicit ticker list |
| `GET /api/public/search` | Server-side search across markets + content |
| `GET /api/public/market/{ticker}` | Full market detail (set `?depth=true` for orderbook levels) |
| `GET /api/public/market/{ticker}/history` | Price history |
| `GET /api/public/market-microstructure-history` | Spread/depth/flow over time |
| `GET /api/public/live-tickers` | Live-priced ticker list |
| `GET /api/public/market/{ticker}/candles` | OHLCV/K-line candles for SDK and Agent SDK screening |

### Market candles

```http theme={null}
GET /api/public/market/{ticker}/candles?venue=kalshi&timeframe=1m&limit=500
```

Query parameters:

| Param | Values | Notes |
| - | - | - |
| `venue` | `kalshi` \| `polymarket` | Optional. Use it when the ticker/id is ambiguous. |
| `timeframe` / `tf` | `1m` \| `5m` \| `15m` \| `1h` \| `1d` | Default `1m`. |
| `limit` | number | Default `500`, max `2000`. |

This is the hosted API mapping for the strict `market.candles` SDK/Agent contract. The Vercel API route proxies to the terminal/Fly candle service and normalizes the response for SDK consumers.

## Cross-venue

| Endpoint | Purpose |
| - | - |
| `GET /api/public/cross-venue/pairs` | Kalshi ↔ Polymarket pairs |
| `GET /api/public/cross-venue/stats` | Pair counts + confidence distribution |

## Regime + index

| Endpoint | Purpose |
| - | - |
| `GET /api/public/regime/scan` | Regime label per market |
| `GET /api/public/index` | Current SimpleFunctions Index v2 (four gauges) |
| `GET /api/public/index/history` | SimpleFunctions Index time series |

`GET /api/public/regime/history` is deprecated and returns `410 Gone`. Use `GET /api/public/regime/scan` for current regime labels and `GET /api/public/market-microstructure-history` for spread/depth history.

See [Index methodology](/concepts/index-methodology) and [Regime](/concepts/regime).

## Probability index (`/odds`)

The SimpleFunctions Probability Index aggregates one liquidity-weighted YES probability per question across Kalshi + Polymarket, refreshed every 15 minutes. Same data the [`/odds`](https://simplefunctions.dev/odds) page renders.

| Endpoint | Purpose |
| - | - |
| `GET /api/public/odds` | Full snapshot — categories, contested questions, cross-venue gaps. |
| `GET /api/public/odds.md` | Markdown variant for agents — capped at 500 slugs. |

Query parameters (both endpoints):

| Param | Values | Notes |
| - | - | - |
| `category` | string | Filter by category (`politics`, `economy`, `crypto`, etc.). |
| `band` | `mid` \| `moving` | `mid` = probabilities near 50%; `moving` = recently shifted. |
| `limit` | number | Cap question count. |

## Calendar + milestones

| Endpoint | Purpose |
| - | - |
| `GET /api/public/calendar` | Upcoming resolutions |
| `GET /api/public/yield-curves` | Yield curve list |
| `GET /api/public/yield-curves/{event}` | One yield curve |

## Liquidity + contagion

| Endpoint | Purpose |
| - | - |
| `GET /api/public/liquidity-by-theme` | Liquidity grouped by theme |
| `GET /api/public/contagion` | Lagging related markets |

## Government data

| Endpoint | Purpose |
| - | - |
| `GET /api/public/query-gov` | Search bills, members, treaties (congress mirror backed) |
| `GET /api/public/legislation` | Legislation list |
| `GET /api/public/legislation/{billId}` | One bill |
| `GET /api/public/congress/members` | Congress member list |
| `GET /api/public/congress/member/{id}` | One member |

## Economic data

| Endpoint | Purpose |
| - | - |
| `GET /api/public/query-econ` | Search FRED series (fred mirror backed) |
| `GET /api/public/fred` | FRED series detail |
| `GET /api/public/databento` | Databento traditional markets |
| `GET /api/public/trad-markets` | Traditional market anchors |

## Content

| Endpoint | Purpose |
| - | - |
| `GET /api/public/query` | Headline cross-venue search |
| `GET /api/public/topic/{slug}` | Topic page data |
| `GET /api/public/answer/{slug}` | Wayback-stable answer page |
| `GET /api/public/glossary` | Glossary |
| `GET /api/public/glossary/{slug}` | Glossary entry |
| `GET /api/public/guide` | Agent guide |
| `GET /api/public/highlights` | Editorial highlights |
| `GET /api/public/briefing` | Daily briefing |
| `GET /api/public/diff` | Daily diff |
| `POST /api/public/discuss` | Discussion topics |

## Skills

| Endpoint | Purpose |
| - | - |
| `GET /api/public/skills` | Public skill catalog |
| `GET /api/public/skill/{slug}` | One skill |

## Theses + opinions

| Endpoint | Purpose |
| - | - |
| `GET /api/public/theses` | Public theses |
| `GET /api/public/thesis/{slug}` | One published thesis |
| `GET /api/public/opinions` | Editorial opinions |
| `GET /api/public/opinions/{slug}` | One opinion |

## Technicals

| Endpoint | Purpose |
| - | - |
| `GET /api/public/technicals` | Technical guides |
| `GET /api/public/technicals/{slug}` | One guide |

## Ideas

| Endpoint | Purpose |
| - | - |
| `GET /api/public/ideas` | Trade ideas |
| `GET /api/public/ideas/{id}` | One idea |

## Context

| Endpoint | Purpose |
| - | - |
| `GET /api/public/context` | Global market context (no thesis) |

## Caching

Most public endpoints set `Cache-Control: public, s-maxage=N` and CDN-cache aggressively. Per-route TTLs vary:

* markets, scan, screen — 60s
* query, query-gov, query-econ — 5–10min in-memory + 5min CDN swr
* index, regime — 30s
* legislation, congress members — 1h ISR

See [Rate limits](/enterprise/rate-limits) for per-key throttling.

## See also

<CardGroup cols={2}>
  <Card title="Agent API" href="/api-reference/agent">
    LLM-shaped variants under `/api/agent/*`.
  </Card>

  <Card title="World model guide" href="/guides/world-model">
    Recommended agent loop using these endpoints.
  </Card>
</CardGroup>


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