> For the complete documentation index, see [llms.txt](https://resolvedmarkets.com/llms.txt). Every docs page is also served as Markdown: append `.md` to its URL or send `Accept: text/markdown`.

## Reference

### Data Model — Market object

| Field | Type | Description |
| --- | --- | --- |
| conditionId | string | Unique market identifier (hex string) |
| category | string | Market category — crypto, sports, economics, weather |
| subcategory | string | Specific sub-type — BTC, NBA, FOMC, NYC, etc. |
| label | string | Human-readable market name |
| tokenIds | string[] | Array of token IDs (replaces tokenIdUp/tokenIdDown) |
| outcomes | string[] | Outcome labels — ["UP","DOWN"], ["Yes","No"], etc. |
| configId | string | Category configuration reference |
| slug | string | Human-readable identifier (e.g., btc-updown-5m-1772799300) |
| endDate | string | When the market resolves (ISO 8601) |
| expired | boolean | Whether the market has expired |
| expiresIn | number | Milliseconds until expiry |

### Data Model — `polymarket.snapshots_hf` (ClickHouse)

| Column | Type | Description |
| --- | --- | --- |
| crypto | LowCardinality(String) | BTC, ETH, SOL, XRP |
| timeframe | LowCardinality(String) | Per-category: 5m, 15m, 1h, 4h, 1d, hit-price, game, rates, weekly, daily-high, daily-low, event, seasonal, annual, monthly, daily, earnings, quarterly, valuation, comparison, leaderboard |
| market_id | String | Polymarket conditionId |
| token_id | String | CLOB token ID |
| token_side | Enum8 | UP or DOWN |
| timestamp | DateTime64(3, 'UTC') | Millisecond precision |
| crypto_price | Float64 | Spot price at capture time (crypto markets only — omitted in API responses for other categories) |
| best_bid | Float64 | Top of book bid |
| best_ask | Float64 | Top of book ask |
| mid_price | Float64 | (bid + ask) / 2 |
| spread | Float64 | ask - bid |
| bid_depth_total | Float64 | Total bid depth |
| ask_depth_total | Float64 | Total ask depth |
| bids | Array(Tuple(Float64, Float64)) | Full bid book [price, size] |
| asks | Array(Tuple(Float64, Float64)) | Full ask book [price, size] |

### Error Codes

| Status | Meaning | When |
| --- | --- | --- |
| 200 | OK | Success |
| 400 | Bad Request | Missing required parameter |
| 401 | Unauthorized | Missing X-API-Key header |
| 402 | Payment Required | Out of credits |
| 403 | Forbidden | Invalid or revoked API key |
| 404 | Not Found | Market or snapshot not found |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Database query failure |

Error response examples:

```json
// 400
{"error": "timestamp is required"}

// 401
{"error": "API key required", "message": "Include your API key in the X-API-Key header."}

// 403
{"error": "Invalid API key", "message": "The provided API key is not valid or has been revoked."}

// 404
{"error": "Market not found"}
```
