> ## 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.

# 市场详情

> 了解事件市场 Market 的结构、状态、结果代币与交易限制。

根据 Market ID 或 slug 查询公开市场详情时，两种接口返回同一 MarketDetail 模型，包含多语言 `question` 和 Outcome、Unix 秒级市场时间及交易参数。两种接口均无需认证。

生产环境 Base URL：

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

## 查询 Market

根据 Market ID：

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

根据 slug：

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

## Market 详情响应

按 ID 和按 slug 查询均返回 MarketDetail。以下示例展示常用字段；`outcomes[].token_id` 可直接用于对应 Token 的价格和订单簿接口。

```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,
  "accepting_orders": true,
  "enable_order_book": true,
  "start_date": 1782666000,
  "end_date": 1782752400,
  "outcomes": [
    { "outcome": { "en": "Yes" }, "token_id": "ge_yes" },
    { "outcome": { "en": "No" }, "token_id": "ge_no" }
  ]
}
```

| 字段 | 说明 |
| - | - |
| `market_id`、`event_id` | Market 与所属 Event 的 ID；后续请求应原样使用 |
| `question` | 多语言市场问题对象 |
| `condition_id` | Condition ID |
| `outcomes` | 每项包含多语言 `outcome` 和 `token_id` |
| `status`、`closed` | 市场状态 |
| `accepting_orders`、`enable_order_book` | 交易与订单簿状态；无值时可为 `null` |
| `min_order_size`、`tick_size`、`neg_risk` | 交易限制；无值时可为 `null` |
| `best_bid`、`best_ask`、`last_trade_price` | 盘口与最近成交摘要 |
| `start_date`、`end_date` | Unix 秒级时间戳；无值时为 `null` |

按 ID 查询详见[查询市场](https://dexbuilder.mintlify.site/zh/event-markets/rest/query-market.md)，按 slug 查询详见[按 Slug 查询市场](https://dexbuilder.mintlify.site/zh/event-markets/rest/query-market-by-slug.md)。

## 使用 Outcome Token

从 `outcomes[].token_id` 获取 Token ID 后，可以继续调用价格、Ticker 和订单簿接口：

```bash cURL theme={null}
TOKEN_ID="<token_id>"

curl "https://api.dexbuilder.com/api/v4/prediction/tokens/$TOKEN_ID/order_book?depth=20"
curl "https://api.dexbuilder.com/api/v4/prediction/tokens/$TOKEN_ID/price"
curl "https://api.dexbuilder.com/api/v4/prediction/tokens/$TOKEN_ID/ticker"
```

API 已直接在 `outcomes` 数组中返回 Token ID，无需额外解析 JSON 字符串形式的 Token 列表。

## 查询所属 Event

使用响应中的 `event_id` 查询父级 Event：

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

Market 公开数据无需认证；下单、持仓、账户等私有接口需要认证。


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