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

# Prediction API

> Prediction-market historical ticks, live prices, reference data, and full-text search over base events, events, and contracts.

The **Prediction API** is the read API for prediction-market data: tick-level YES/NO price history, a live stream of prices, bids, and trades, the instrument catalogue, and full-text search across it. Use it to discover contracts, enumerate the outcomes under an event, show live prices, and back charts or models with historical prices. Order placement and order history are in [closed beta](#orders-closed-beta).

## Environments

These endpoints are available in two environments, selectable from the server dropdown in the playground on each endpoint page:

| Environment | Base URL |
| - | - |
| Production | `https://api.aries.com` |
| Staging | `https://api.tradearies.dev` |

Paths, parameters, and response shapes are identical in both. Staging carries its own catalogue and tick history, so symbols and event IDs will not match production.

***

## The three levels

Everything in this API is organized the same way, from broadest to narrowest:

| Level | What it is | Example ID |
| - | - | - |
| **Base event** | A series of recurring questions | `UNR` |
| **Event** | One real-world question within the series | `UNR_0822` |
| **Contract** | One tradable outcome or strike under an event | `UNR_0822_3.5` |

A contract's `symbol` is the key used everywhere else: it is what you pass to the historical-data endpoints and the live stream, and what search returns.

## Historical data

| Endpoint | Description |
| - | - |
| [**Get historical ticks**](https://finance.dev/api-reference/predictions/get-history.md) | Return YES/NO price history for a single contract over an optional time window. |
| [**Batch historical ticks**](https://finance.dev/api-reference/predictions/get-history-batch.md) | Retrieve ticks for up to 5 symbols in one request, each with its own window. |

## Live data

| Endpoint | Description |
| - | - |
| [**Stream live prices**](https://finance.dev/api-reference/predictions/stream-live-prices.md) | Server-sent events for contracts or whole events: each contract's last YES and NO price and statistics, then every new bid and trade as it happens. |

## Reference data and search

| Endpoint | Description |
| - | - |
| [**Search prediction market**](https://finance.dev/api-reference/predictions/search.md) | Full-text search returning hits as contracts, events, or base events, by symbol or by open interest. |
| [**List categories**](https://finance.dev/api-reference/predictions/list-categories.md) | Return the category tree, for browsing and for filtering search by category. |
| [**Get event contracts**](https://finance.dev/api-reference/predictions/get-event-contracts.md) | Return one event together with every contract under it. |
| [**Get base event**](https://finance.dev/api-reference/predictions/get-base-event.md) | Return a base event with its events and each event's contracts. |

## Elections

| Endpoint | Description |
| - | - |
| [**Get election map**](https://finance.dev/api-reference/predictions/get-election-map.md) | Every Senate, House and governor race of a cycle in all 50 states, with each candidate's price and the chamber-control markets, in one response. |

## Orders (closed beta)

> [!WARNING]
>
> The order endpoints are in **closed beta**. They are available only to accounts enrolled in the beta, and require an authenticated user. Request and response shapes may change before general availability.

| Endpoint | Description |
| - | - |
| [**Place prediction order**](https://finance.dev/api-reference/predictions/place-order.md) | Place an order for the authenticated user. Returns `202` once the order is sent, normally in `pending_new`. |
| [**List prediction orders**](https://finance.dev/api-reference/predictions/list-orders.md) | The user's orders, newest first, filtered by state, account, or symbol. |
| [**Get prediction order**](https://finance.dev/api-reference/predictions/get-order.md) | One order with every venue execution report against it. |
| [**Stream prediction orders**](https://finance.dev/api-reference/predictions/stream-orders.md) | Server-sent events for one account: its open orders, then every change to its orders as it happens. |

***

## Working with this API

### Prices are decimal strings

`yesPrice`, `noPrice`, and `tickSize` are exact decimals serialized as JSON **strings** (`"0.54"`, not `0.54`). Parse them with a decimal type. Reading them into a binary float loses precision at the tick sizes these contracts trade at.

### Search trails the catalogue

Search results come from an index that lags the catalogue by seconds. Use a hit's `symbol` as a key, then read anything that must be current — `state`, `tradable` — from [Get Event Contracts](https://finance.dev/api-reference/predictions/get-event-contracts.md). Do not act on a hit's own fields.

### Conditional contracts are not served

Aries does not offer contracts the venue files under its `Conditional` category, at any level of a base event's `categoryLevels`. This API leaves them out everywhere:

| Endpoint | A conditional contract or event |
| - | - |
| [Search](https://finance.dev/api-reference/predictions/search.md) and [List Categories](https://finance.dev/api-reference/predictions/list-categories.md) | Never returned |
| [Get Event Contracts](https://finance.dev/api-reference/predictions/get-event-contracts.md) and [Get Base Event](https://finance.dev/api-reference/predictions/get-base-event.md) | `404`, as if it did not exist |
| [Get Election Map](https://finance.dev/api-reference/predictions/get-election-map.md) | Left off the map |
| [Stream Live Prices](https://finance.dev/api-reference/predictions/stream-live-prices.md) | Not streamed. Named in an [`unavailable`](https://finance.dev/api-reference/predictions/stream-live-prices#unavailable) event, and the rest of the request streams. |

### Venue times carry no zone

`expectedPayoutTime`, `expectedLastTradeTime`, and `expectedResolutionTime` are venue **wall-clock** times. The upstream feed carries no time zone, so the trailing `Z` is a label rather than a conversion — do not shift these into local time.

### Response envelope

Every response uses the same envelope. On success:

```json theme={null}
{
  "success": true,
  "data": { }
}
```

On failure, `success` is `false` and `error` is a structured object with a categorical `type` (`VALIDATION`, `NOT_FOUND`, `INTERNAL`, `EXTERNAL_SERVICE`, …), a machine-readable `code`, and a human-readable `message`. Branch on `type` and `code`; message text is not fixed. The order endpoints return `type` in lowercase (`bad_request`, `not_found`, `timeout`, …).

```json theme={null}
{
  "success": false,
  "error": {
    "type": "NOT_FOUND",
    "code": "EVENT_NOT_FOUND",
    "message": "string"
  }
}
```

A `502` means the upstream data store or search index was unavailable — retry it; it does not indicate a bad request.

## Common uses

* Discover contract symbols and event IDs with search before pulling historical ticks.
* Enumerate every strike under an event, or the full event/contract tree under a base event.
* Pull YES/NO tick history for one or many contracts to drive charting and modeling workflows.
* Stream live prices, bids, and trades for every contract under an event.
* Re-read `state` and `tradable` from the catalogue before acting on a symbol found through search.


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