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

# Get Historical Ticks

> Returns YES/NO price history for a single prediction-market contract over an optional time window. Prices are exact decimals serialized as JSON strings.

**Use Case:** Back charts and models with tick-level price history for one contract symbol.


## Overview

Each tick is a pair trade on one contract: the price paid for YES, the matching price for NO, and the traded quantity. Pass the contract `symbol` — the same symbol returned by [search](/api-reference/predictions/search) and [event contracts](/api-reference/predictions/get-event-contracts).

## Time range

`from` and `to` are both optional and both inclusive. Each accepts either an RFC3339 timestamp or a Unix epoch value in seconds or milliseconds:

```
GET /v1/predictions/historical-data?symbol=HORC_1126_Republican&from=2026-04-01T00:00:00Z&to=2026-04-20T00:00:00Z
GET /v1/predictions/historical-data?symbol=HORC_1126_Republican&from=1774915200&to=1776556800
```

Omit both to take the service default window. Omitting only one leaves that side unbounded.

## Limit

`limit` caps the number of ticks returned. `0` or an omitted value means **10,000**, and any larger value is clamped to 10,000 — the response never reports a limit larger than the one actually applied. To walk a longer history, page by narrowing `from`/`to` rather than by raising `limit`.

## Prices are strings

`yesPrice` and `noPrice` are exact decimals serialized as JSON **strings**:

```json theme={null}
{
  "success": true,
  "data": {
    "symbol": "HORC_1126_Republican",
    "count": 1,
    "ticks": [
      {
        "timestamp": "2026-04-18T13:45:01.234Z",
        "yesPrice": "0.54",
        "noPrice": "0.46",
        "quantity": 10
      }
    ]
  }
}
```

Parse them with a decimal type. Reading them into a binary float loses precision at the tick sizes these contracts trade at.

## Example

```bash theme={null}
curl -X GET "https://api.aries.com/v1/predictions/historical-data?symbol=HORC_1126_Republican&limit=500"
```

## Errors

* `400` — `symbol` missing, or `from`/`to`/`limit` failed validation
* `502` — the upstream data store was unavailable

Both return the prediction-market error envelope: `success: false` with a structured `error` object.


## OpenAPI

````yaml openapi.json GET /v1/predictions/historical-data
openapi: 3.0.3
info:
  contact:
    email: dev@aries.com
    name: Aries Financial
  description: >-
    OpenAPI Specification for the Aries trading platform API.


    # Authentication


    Learn how to authenticate with the Aries API using OAuth2 and manage access
    tokens in your SDK.


    ## Overview


    The Aries API uses **OAuth2 with Bearer tokens** (JWT format) for
    authentication. All API requests require a valid access token in the
    `Authorization` header:


    ```

    Authorization: Bearer <access_token>

    ```


    ## Providing Client ID and Client Secret (SDK)


    When using the generated SDK, provide your **Client ID** and **Client
    Secret** when you create the API client (e.g. in the constructor or security
    options). The SDK will use these to obtain and refresh the access token
    internally; you do not need to manage tokens yourself.


    Obtain your OAuth2 credentials from the Aries platform (e.g. Client Center /
    Manage Account at https://app.aries.com):


    - **Client ID** – Your application identifier (pass to SDK client)

    - **Client Secret** – Your application secret key (pass to SDK client; use
    PKCE for public clients where secret cannot be stored)


    ## Authentication Flow


    ### 1. Authorization Code Flow


    For server-side or confidential clients:


    1. **Redirect the user** to the authorization URL to sign in and consent:
     - **URL:** `https://app.aries.com/oauth2/authorize`
     - **Query params:** `response_type=code`, `client_id`, `redirect_uri`, `scope`, `state`

    2. **Exchange the code for tokens** (after user is redirected back with
    `?code=.`):
     - **POST** `https://api.aries.com/v1/oauth2/token`
     - **Body:** `grant_type=authorization_code`, `code`, `redirect_uri`, `client_id`, `client_secret`
     - Response includes `access_token` and `refresh_token`

    3. **Call the API** with the access token: `Authorization: Bearer
    <access_token>`


    ### 2. PKCE Flow


    For SPAs and mobile apps (public clients that cannot store `client_secret`):


    1. Generate a **code_verifier** (random string) and **code_challenge** =
    BASE64URL(SHA256(code_verifier)).

    2. **Redirect the user** to `https://app.aries.com/oauth2/authorize` with
    `code_challenge`, `code_challenge_method=S256`, plus `client_id`,
    `redirect_uri`, `scope`, `state`.

    3. **Exchange the code** at POST `https://api.aries.com/v1/oauth2/token`
    with `grant_type=authorization_code`, `code`, `redirect_uri`, `client_id`,
    `code_verifier` (no client_secret).

    4. Use the returned `access_token` as Bearer.


    ### 3. MFA Verification


    If the user has MFA enabled, the authorize step may return `is_mfa: true`
    and a `next_step_auth_id`. Call **POST**
    `https://api.aries.com/v1/oauth2/authorize/mfa` with `next_step_auth_id` and
    `verification_code` (6-digit code). Then continue with **POST**
    `/v1/oauth2/authorize/confirm` to get the authorization code, and exchange
    it at `/v1/oauth2/token`.


    ## Token Management


    - **Refresh when expired:** POST `https://api.aries.com/v1/oauth2/token`
    with `grant_type=refresh_token`, `client_id`, `client_secret`,
    `refresh_token`.

    - **Using a Bearer token directly:** If you already have an access token,
    set the header `Authorization: Bearer <access_token>` on every request. The
    SDK can accept a pre-obtained token and use it until it expires.


    ## OAuth2 Scopes


    Request only the scopes your application needs. Available scopes:


    | Scope | Description |

    |-------|-------------|

    | `user:information` | View user profile and personal details |

    | `account:information` | View account balances, positions, and transaction
    history |

    | `order:execution` | Place, modify, and cancel orders |

    | `order:information` | View order history and status |

    | `position:information` | View current positions and holdings |

    | `market:information` | Access live and historical market data |

    | `calendar:information` | Access earnings, economic, and market schedule
    data |

    | `options:information` | Access options chains and expiration data |

    | `analytics:information` | View analytics, ratings, and market insights |

    | `market:supplemental` | News, company profiles, financials, filings, ETF
    data, technical analysis |


    Specify multiple scopes as a space-separated string, e.g.
    `account:information order:execution market:information`.


    ## Security Best Practices


    - **Store credentials securely** – Use environment variables or a secrets
    manager for `client_id` and `client_secret`. Never hardcode them.

    - **Handle token expiration** – Check for 401 responses and refresh the
    token using the refresh_token, then retry the request.

    - **Use HTTPS** – All authorization and token endpoints must be called over
    HTTPS.

    - **Validate state** – When using the authorization code flow, validate the
    `state` parameter on the callback to prevent CSRF.


    ## Error Handling


    - **400 Bad Request** – Invalid or missing parameters, validation failures,
    or malformed JSON. Response bodies follow the same patterns as other errors
    (flat `error` string, optional `codes`, nested `error` object, or rarely no
    body).


    - **401 Unauthorized** – Invalid or expired access token; refresh the token
    or re-authenticate. JSON bodies are not identical on every route: you may
    see a flat `error` string (sometimes with `codes`), a nested `error` object
    (`type`, `code`, `message`), or rarely an empty body


    - **403 Forbidden** – Insufficient scope or permissions for the requested
    resource. Error JSON may be flat or nested, like 400/401.


    - **404 Not Found** – Resource does not exist or is not visible. Error JSON
    may be flat or nested.


    - **429 Too Many Requests** – Rate limit exceeded; slow down and respect
    `Retry-After` when the header is present. Error JSON may be flat or nested.


    - **500 / 5xx** – Server or upstream failure; retry with backoff. Do not
    depend on a single error JSON shape; some responses may have no body.



    ---


    Endpoints in this spec: health, OAuth2 (authorize, confirm, mfa, token),
    users, accounts, orders, market data, watchlist, chart, analytics,
    calendars, company, economy, financials, indices, options, news, and
    supplemental data.
  title: Aries API — OpenAPI Specification
  version: 1.0.0
servers:
  - description: Production server
    url: https://api.aries.com
security: []
tags:
  - description: >-
      Analytics endpoints for market data analysis including top gainers,
      losers, volume leaders, sector analysis, analyst ratings, market breadth,
      and net inflow
    name: Analytics
  - description: User management and profile endpoints
    name: Users
  - description: >-
      Order management endpoints for placing, updating, canceling, and
      previewing orders
    name: Orders
  - description: Account management endpoints for positions, orders, and balances
    name: Accounts
  - description: Calendar and mergers/acquisitions endpoints
    name: Calendar
  - description: >-
      Market data endpoints for symbol search, real-time data access, and equity
      details
    name: Market Data
  - description: >-
      Watchlist endpoints for listing, creating, updating, and deleting
      watchlists
    name: Watchlist
  - description: Chart endpoints for config, symbols, history, quotes, and server time
    name: Chart
  - description: News and news sentiment endpoints
    name: News
  - description: >-
      Indices endpoints for groups, list, search, bar, bars, chart-bars,
      realtime values
    name: Indices
  - description: Logos search and sync endpoints
    name: Logos
  - description: 'Corporate actions: spinoffs, tender offers, IPO calendar, dividends'
    name: Corporate Actions
  - description: 'Economy endpoints: inflation, inflation expectations, treasury yields'
    name: Economy
  - description: >-
      Options endpoints: expiry dates, contracts, activity, trades, quotes,
      unusual activity
    name: Options
  - description: >-
      Financials: reported, statements, revenue breakdown, short volume, ratios,
      short interest
    name: Financials
  - description: Signals and bull-bear cases
    name: Signals
  - name: Company
  - name: ETF
  - name: Filings
  - name: Market
  - name: Ownership
  - name: Stocks
  - name: Stock Estimates
  - name: Stock Alternative
    description: >-
      Transcripts, company presentation, social sentiment, investment themes,
      supply chain, and ESG data
  - name: Technical Analysis
  - name: Prediction Historical Data
    description: Historical YES/NO tick data for prediction-market contracts
  - name: Prediction Market Data
    description: >-
      Prediction-market reference data and full-text search over base events,
      events, and contracts
paths:
  /v1/predictions/historical-data:
    servers:
      - url: https://api.aries.com
        description: Production
      - url: https://api.tradearies.dev
        description: Staging
    get:
      tags:
        - Prediction Historical Data
      summary: Get historical ticks for a single symbol
      description: >-
        Returns prediction-market YES/NO price history for a single symbol. Time
        range is optional; omit both `from` and `to` to use the service default.
        `from`/`to` accept RFC3339 strings (e.g. `2026-04-01T00:00:00Z`) or Unix
        seconds/milliseconds.
      operationId: getHistory
      parameters:
        - name: symbol
          in: query
          required: true
          schema:
            type: string
            example: HORC_1126_Republican
        - name: from
          in: query
          required: false
          description: RFC3339 timestamp or Unix seconds/milliseconds.
          schema:
            type: string
            example: '2026-04-01T00:00:00Z'
        - name: to
          in: query
          required: false
          description: RFC3339 timestamp or Unix seconds/milliseconds.
          schema:
            type: string
            example: '2026-04-20T00:00:00Z'
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            example: 500
            maximum: 10000
          description: 0 or omitted means 10000; values above 10000 are clamped to it.
      responses:
        '200':
          description: Historical ticks
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PredMdSuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/PredMdHistoryResponse'
        '400':
          $ref: '#/components/responses/PredMdBadRequest'
        '502':
          $ref: '#/components/responses/PredMdBadGateway'
      security: []
components:
  schemas:
    PredMdSuccessEnvelope:
      type: object
      description: >-
        Standard success envelope used by all success responses. `data` is
        endpoint-specific.
      properties:
        success:
          type: boolean
          example: true
        data: {}
      required:
        - success
    PredMdHistoryResponse:
      type: object
      properties:
        symbol:
          type: string
        from:
          format: date-time
          type: string
        to:
          format: date-time
          type: string
        count:
          type: integer
          minimum: 0
        ticks:
          type: array
          items:
            $ref: '#/components/schemas/PredMdTick'
      required:
        - symbol
        - count
        - ticks
    PredMdTick:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          example: '2026-04-18T13:45:01.234Z'
        yesPrice:
          type: string
          format: decimal
          description: >-
            Exact decimal, serialized as a string so no client parses it through
            a float.
          example: '0.54'
        noPrice:
          type: string
          format: decimal
          description: >-
            Exact decimal, serialized as a string so no client parses it through
            a float.
          example: '0.46'
        quantity:
          type: integer
          format: int64
          minimum: 0
          example: 10
      required:
        - timestamp
        - yesPrice
        - noPrice
        - quantity
    ErrorEnvelope:
      type: object
      description: >-
        Prediction-market error envelope. Returned by historical-data and
        prediction-market reference endpoints on 400/404/500/502.
      properties:
        success:
          type: boolean
          example: false
        error:
          $ref: '#/components/schemas/AppError'
      required:
        - success
        - error
    AppError:
      type: object
      description: Structured application error returned inside an `ErrorEnvelope`.
      properties:
        type:
          type: string
          description: >-
            Categorical error type. Use this for branching error-handling logic;
            the values are stable across endpoints:

            - `VALIDATION` — request body or query parameters failed validation.

            - `AUTHENTICATION` — missing, invalid, or expired token.

            - `AUTHORIZATION` — token is valid but lacks the required
            scope/permission.

            - `NOT_FOUND` — the requested resource does not exist.

            - `CONFLICT` — request conflicts with current state (e.g.
            duplicate).

            - `INTERNAL` — server-side error; retry or contact support.

            - `TIMEOUT` — operation took too long.

            - `UNKNOWN` — uncategorized error; check `message`.

            (Additional categorical values may appear in service-specific
            responses.)
          enum:
            - UNKNOWN
            - VALIDATION
            - AUTHENTICATION
            - AUTHORIZATION
            - NOT_FOUND
            - CONFLICT
            - INTERNAL
            - TIMEOUT
            - RATE_LIMIT
            - BAD_REQUEST
            - DATABASE
            - EXTERNAL_SERVICE
            - PRECONDITION_FAILED
            - SERVICE_UNAVAILABLE
            - GRPC
            - QUEUE
            - JSON_PARSING
        code:
          type: string
          description: Machine-readable code, e.g. `SYMBOL_REQUIRED`, `EVENT_NOT_FOUND`.
          example: SYMBOL_REQUIRED
        message:
          type: string
          description: >-
            Error detail as a string. Exact message content is not fixed and
            should not be hard-coded.
          example: string
        details:
          type: object
          additionalProperties: true
        service:
          type: string
        operation:
          type: string
        request_id:
          type: string
      required:
        - type
        - code
        - message
  responses:
    PredMdBadRequest:
      description: >-
        Invalid request (validation error, malformed JSON, or missing required
        parameters). Response body is a prediction-market `ErrorEnvelope` with a
        structured `AppError`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            success: false
            error:
              type: VALIDATION
              code: SYMBOL_REQUIRED
              message: string
    PredMdBadGateway:
      description: >-
        Upstream data source failure. Response body is a prediction-market
        `ErrorEnvelope` with a structured `AppError`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            success: false
            error:
              type: EXTERNAL_SERVICE
              code: UPSTREAM_UNAVAILABLE
              message: string

````