> For the complete documentation index, see [llms.txt](https://predictbase.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://predictbase.gitbook.io/docs/developer/endpoints/read-markets.md).

# Read Markets

### Read-Only Market Data Endpoints

These endpoints provide **public, read-only access** to PredictBase market data.

* **No authentication required**
* **Rate-limited**
* Market data may be **delayed by up to \~2 seconds**

***

#### Get Active Markets

Returns the list of **active markets** (`status = 0`), enriched with the **best available Sell prices** for each option.

**Endpoint**

```http
GET /get_active_markets
```

**Full URL**

```
https://api.predictbase.app/get_active_markets
```

**Authentication**

* None (rate-limited)

#### Response Example

```json
[
  {
    "id": "123",
    "creator": "0xCreator",
    "question": "Will BTC close above $100k in 2026?",
    "status": 0,
    "details": "...",
    "categories": ["Crypto", "BTC"],
    "image": "https://...",
    "volume": "123000000",
    "endsAt": "1735689600",
    "createdAt": "1733000000",
    "updatedAt": "1734000000",
    "optionTitles": ["Yes", "No"],
    "optionPrices": ["550000", "480000"],
    "optionVolumes": ["...", "..."],
    "shares": ["...", "..."],
    "winningOption": null,
    "creatorRevenue": "0",
    "platformRevenue": "0"
  }
]
```

***

#### Get Market

Returns a **single active market by** **ID**, enriched with the best available **SELL prices** for each option. The market ID can be extracted directly from the PredictBase market URL (e.g. <https://predictbase.app/market/10001>).

**Endpoint**

```http
GET /get_market/{id}
```

**Full URL**

```
https://api.predictbase.app/get_market/{id}
```

**Authentication**

* None (rate-limited)

#### Response Example

```json
{
  "id": "123",
  "creator": "0xCreator",
  "question": "Will BTC close above $100k in 2026?",
  "status": 0,
  "details": "...",
  "categories": ["Crypto", "BTC"],
  "image": "https://...",
  "volume": "123000000",
  "endsAt": "1735689600",
  "createdAt": "1733000000",
  "updatedAt": "1734000000",
  "optionTitles": ["Yes", "No"],
  "optionPrices": ["550000", "480000"],
  "optionVolumes": ["...", "..."],
  "shares": ["...", "..."],
  "winningOption": null,
  "creatorRevenue": "0",
  "platformRevenue": "0"
}
```

***

#### Get Market Orderbook

Returns the **market orderbook**, listing all available **BUY** and **SELL** orders for a given market, sorted by price.

**Endpoint**

```http
GET /get_market_orderbook/{id}
```

**Full URL**

```
https://api.predictbase.app/get_market_orderbook/{id}
```

**Authentication**

* None (rate-limited)

#### Response Example

```json
{
  "marketId": "123",
  "buys": [
    {
      "id": "ORDER#6ddcdb08-3147-47ce-8650-e6484e5491d2",
      "marketId": "10001",
      "optionIndex": 0,
      "side": "SELL",
      "type": "LIMIT",
      "qty": 300,
      "filledQty": 0,
      "price": 0.5,
      ...}
    ],
  "sells": [
     {
      "id": "ORDER#6ddcd328-3147-47ce-8650-e6hef5491d2",
      "marketId": "10001",
      "optionIndex": 1,
      "side": "SELL",
      "type": "LIMIT",
      "qty": 500,
      "filledQty": 100,
      "price": 0.6,
      ...}
    ]
}
```

***

#### Data Notes

* **USDC values** use **1e6 precision** (Example: `"550000"` = 0.55 USDC)
* `optionPrices` reflect the **best available ask prices**
* Timestamps are **Unix seconds**
* `winningOption` is `null` until market resolution

#### Market Status Values

| Status | Meaning  |
| ------ | -------- |
| `0`    | Active   |
| `1`    | Resolved |
| `2`    | Canceled |

***

#### 💡 Common Use Cases

* Market discovery and browsing
* Live odds displays
* Trading dashboards and bots
* Analytics and research tools
