# Polymarket — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Browse top Polymarket events and markets by volume/liquidity and view the Polymarket trader leaderboard (profit or volume) over common timeframes.

**Category:** Finance & Markets | **Website:** [polymarket.com/](https://polymarket.com/) | **Docs:** [parse.bot/marketplace/356a9c18-7737-49f7-9179-1b9f1b69e0a5/polymarket-com-api](https://parse.bot/marketplace/356a9c18-7737-49f7-9179-1b9f1b69e0a5/polymarket-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-polymarket-com-api-356a9c18/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_event_details

Get detailed event/market data by event slug. Returns comprehensive information including all associated markets, their CLOB token IDs, volume metrics, resolution status, and order book parameters. The slug comes from search_markets or get_top_markets results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `slug` | string | Yes | Event slug identifier (from search_markets or get_top_markets results, e.g. 'bitcoin-above-on-june-10-2026'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-polymarket-com-api-356a9c18/get_event_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"slug":"<string>"}'
```

### get_last_trade_prices

Get the last trade price and side for one or more market tokens. Token IDs are obtained from get_event_details markets[*].clob_token_ids.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `token_ids` | string | Yes | Comma-separated CLOB token IDs (from get_event_details markets[*].clob_token_ids). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-polymarket-com-api-356a9c18/get_last_trade_prices \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"token_ids":"<string>"}'
```

### get_leaderboard

Get leaderboard data showing top traders ranked by profit or volume, along with biggest wins for the selected timeframe. Sourced from Polymarket's server-side rendered page data.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of traders to return. |
| `sort` | string | No | Sort traders by metric. |
| `timeframe` | string | No | Timeframe for leaderboard data. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-polymarket-com-api-356a9c18/get_leaderboard \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","sort":"<string>","timeframe":"<string>"}'
```

### get_order_book

Get real-time order book data for one or more market tokens. Returns current bids, asks, and market parameters for the specified CLOB token IDs. Token IDs are obtained from get_event_details markets[*].clob_token_ids.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `token_ids` | string | Yes | Comma-separated CLOB token IDs (from get_event_details markets[*].clob_token_ids). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-polymarket-com-api-356a9c18/get_order_book \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"token_ids":"<string>"}'
```

### get_price_history

Get historical price data for a market token as a time series. Returns price points at the specified fidelity interval. Token IDs are obtained from get_event_details markets[*].clob_token_ids.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `fidelity` | string | No | Minutes between data points. |
| `interval` | string | No | Time interval for history. |
| `token_id` | string | Yes | CLOB token ID (from get_event_details markets[*].clob_token_ids). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-polymarket-com-api-356a9c18/get_price_history \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fidelity":"<string>","interval":"<string>","token_id":"<string>"}'
```

### get_top_markets

Get top prediction market events with sorting and filtering options. Supports pagination via offset and filtering by category, active/closed status. Each event includes full market details with CLOB token IDs for order book queries.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `active` | string | No | Filter for active markets: true or false. |
| `ascending` | string | No | Sort direction: true for ascending, false for descending. |
| `category` | string | No | Category tag slug to filter by (e.g. sports, crypto, politics). |
| `closed` | string | No | Filter for closed markets: true or false. |
| `limit` | integer | No | Maximum number of events to return. |
| `offset` | integer | No | Pagination offset for results. |
| `order` | string | No | Sort field for ordering results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-polymarket-com-api-356a9c18/get_top_markets \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"active":"<string>","ascending":"<string>","category":"<string>","closed":"<string>","limit":"<integer>","offset":"<integer>","order":"<string>"}'
```

### get_trending_markets

Get currently trending prediction markets sorted by 24-hour trading volume. Returns each event's title, current yes/no prices (odds), total volume, liquidity, categories, and market details.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of trending events to return. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-polymarket-com-api-356a9c18/get_trending_markets \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>"}'
```

### search_markets

Full-text search over prediction market events by keyword. Returns matching events with their associated markets, current prices, and status. has_more indicates additional results exist beyond the returned set.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of results to return per type. |
| `query` | string | Yes | Search keyword to find prediction market events. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-polymarket-com-api-356a9c18/search_markets \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","query":"<string>"}'
```
