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

# Discover Markets

> Query public Events, Markets, and Tags through the Prediction API, with support for ID, slug, filters, and cursor pagination.

This page explains how to find and filter public Events and Markets. Market discovery and public market-data endpoints do not require authentication.

Production API Base URL:

```text theme={null}
https://api.dexbuilder.com
```

Unless an endpoint says otherwise, Event and Market time fields use Unix timestamps in seconds. Event `title`, `description`, and Tag `label` may be multilingual objects; Market `question` and `outcomes[].outcome` are multilingual objects too. Market lists return summaries, while ID and slug lookups return details.

## Events

An Event groups one or more related Markets.

### Get an Event by ID

```bash cURL theme={null}
curl "https://api.dexbuilder.com/api/v4/prediction/events/<event_id>"
```

### Get an Event by slug

```bash cURL theme={null}
curl "https://api.dexbuilder.com/api/v4/prediction/events/slug/<event_slug>"
```

Common Event detail fields:

| Field | Description |
| - | - |
| `event_id` | Unique Event identifier |
| `slug` | URL-friendly Event identifier |
| `title` | Multilingual Event title object |
| `description` | Multilingual Event description object |
| `markets` | Market summaries under the Event |
| `markets_has_more` | Whether more embedded Market data is available |
| `active`, `closed` | Event lifecycle state |
| `start_date`, `start_time`, `end_date`, `closed_time` | Event time fields |
| `volume` | Event trading volume, returned as a decimal string |
| `tags` | Tag summaries |

```json Example theme={null}
{
  "event_id": "event-123",
  "slug": "example-event",
  "title": { "en": "Example event" },
  "active": true,
  "closed": false,
  "markets": [],
  "markets_has_more": false
}
```

### List Events

```bash cURL theme={null}
curl "https://api.dexbuilder.com/api/v4/prediction/events?limit=20&active=true&closed=false&sort=start_date&ascending=true"
```

Main supported query parameters:

| Parameter | Description |
| - | - |
| `limit` | Number of results, from 1–100 |
| `cursor` | The `next_cursor` returned by the previous page |
| `sort` | `start_date`, `start_time`, `end_date`, or `closed_time` |
| `ascending` | Whether to sort ascending |
| `event_id` | Filter by Event ID |
| `slug` | Filter by Event slug |
| `tag_slug` | Filter by Tag slug |
| `active`, `closed` | Filter by lifecycle state |
| `start_date_min`, `start_date_max` | Start-time range, Unix milliseconds |
| `end_date_min`, `end_date_max` | End-time range, Unix milliseconds |

Response:

```json Example theme={null}
{
  "items": [
    {
      "event_id": "event-123",
      "slug": "example-event",
      "title": { "en": "Example event" },
      "active": true,
      "closed": false,
      "volume": "12500.50",
      "tags": [
        { "tag_id": "sports", "slug": "sports", "label": { "en": "Sports" } }
      ]
    }
  ],
  "next_cursor": "eyJvZmZzZXQiOjIwfQ"
}
```

When `next_cursor` is non-empty, pass it unchanged as `cursor` in the next request:

```bash cURL theme={null}
curl "https://api.dexbuilder.com/api/v4/prediction/events?limit=20&cursor=<next_cursor>"
```

## Markets

A Market is the actual tradable question. Each Market contains one or more Outcome Tokens.

### Get by Market ID

```bash cURL theme={null}
curl "https://api.dexbuilder.com/api/v4/prediction/markets/<market_id>"
```

### Get by slug

```bash cURL theme={null}
curl "https://api.dexbuilder.com/api/v4/prediction/markets/slug/<market_slug>"
```

Market lists return Market summaries; ID and slug lookups return Market details. All three use a multilingual `question`, multilingual `outcomes[].outcome`, and Unix-second `start_date` and `end_date`. Use `outcomes[].token_id` for price and order-book requests.

| Field | Description |
| - | - |
| `market_id` | Unique Market identifier; pass it unchanged in later requests |
| `event_id` | Parent Event ID |
| `slug` | Market slug |
| `question` | Multilingual Market question object |
| `condition_id` | Condition ID |
| `outcomes` | Outcome list; each item has a multilingual `outcome` and a `token_id` |
| `status`, `closed` | Market state |
| `best_bid`, `best_ask`, `last_trade_price` | Order-book and latest-trade summary |
| `start_date`, `end_date` | Market times in Unix seconds; `null` when unavailable |

This Market summary example omits detail-only trading and resolution fields:

```json Example theme={null}
{
  "market_id": "ge_42_7",
  "event_id": "ge_42",
  "slug": "example-market",
  "question": { "en": "Will the outcome occur?" },
  "condition_id": "ge_condition",
  "status": "active",
  "closed": false,
  "start_date": 1782666000,
  "end_date": 1782752400,
  "outcomes": [
    { "outcome": { "en": "Yes" }, "token_id": "ge_yes" },
    { "outcome": { "en": "No" }, "token_id": "ge_no" }
  ]
}
```

### List Markets

```bash cURL theme={null}
curl "https://api.dexbuilder.com/api/v4/prediction/markets?limit=20&active=true&closed=false&tag_slug=sports"
```

Main parameters:

| Parameter | Description |
| - | - |
| `limit` | Number of results, from 1–100 |
| `cursor` | The `next_cursor` returned by the previous page |
| `market_id` | Market ID |
| `event_id` | Parent Event ID |
| `slug` | Market slug |
| `condition_id` | Condition ID |
| `tag_slug` | Tag slug of the parent Event |
| `active`, `closed` | Market lifecycle state |

## Tags

Tags can be used to build category filters:

```bash cURL theme={null}
curl "https://api.dexbuilder.com/api/v4/prediction/tags?limit=20&cursor=<cursor>"
```

```json theme={null}
{
  "items": [
    { "tag_id": "sports", "slug": "sports", "label": { "en": "Sports" } }
  ],
  "next_cursor": "eyJvZmZzZXQiOjIwfQ"
}
```

## Current API Scope

The current Prediction API provides Events, Markets, Tags, public market trades, and Token market-data capabilities. Third-party-specific endpoints that are not defined in the DexBuilder API contract should not be treated as formal integration dependencies.


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