# x402stock Historical OHLCV Aggregates

> x402stock Historical OHLCV Aggregates is a paid API for AI agents from agents.x402stock.xyz, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-02, last successful call 2026-08-28).

Returns historical OHLCV (open, high, low, close, volume) bar data for a US stock ticker at a specified timespan and multiplier between two dates

## Facts

- Endpoint: GET https://agents.x402stock.xyz/api/v1/aggregates/:ticker?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Last successful call: 2026-08-28
- Success rate: 100% of calls made through Zero
- Rating: 5.0 / 5 from 1 review
- Activations on Zero: 3
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402stock-historical-ohlcv-aggregates-ad2e5b49
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UMesmoLRo-Xfz5i90y7TH

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402stock-historical-ohlcv-aggregates-ad2e5b49
```

Example prompt: Pull daily adjusted OHLCV bars for AAPL from 2024-01-01 to 2024-12-31, sorted ascending — I want to chart the full-year price history.

## When to prefer this

Use this endpoint when you need multi-period historical OHLCV data for charting, backtesting, or trend analysis over any custom date range. Prefer this over the single-day snapshot endpoint when you need more than one bar or need data spanning days, weeks, months, or years. Ideal for technical analysis workflows, strategy backtesting engines, and visualization pipelines that require flexible granularity (minute through year).

## Known failure modes

- Invalid ticker symbol returns empty results or 404
- Date range outside available data returns empty bar array
- Multiplier or limit exceeding maximum (50000) returns validation error
- Invalid timespan enum value returns 400 bad request
- Payment failure via x402 protocol returns 402 Payment Required
- Future date range returns empty results

## How this service works

The stock price history endpoint. Returns historical OHLCV bars at the requested multiplier and timespan (minute, hour, day, week, month) between `from` and `to`. Use for price history, charting, backtesting, and trend analysis over any date range. From x402stock, a pay-per-call market & economic data API for AI agents. No API key or account; pay in USDC via x402.

## Output

An array of OHLCV aggregate bar objects, each containing open, high, low, close, volume, and timestamp for the requested ticker and time interval. Bars are returned in the specified sort order (asc or desc) and reflect split/dividend-adjusted prices when adjusted=true.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object",
     "ticker": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "to": {
       "type": "string",
       "default": "2026-07-31",
       "minLength": 1
      },
      "from": {
       "type": "string",
       "default": "2025-07-31",
       "minLength": 1
      },
      "sort": {
       "enum": [
        "asc",
        "desc"
       ],
       "type": "string",
       "default": "asc"
      },
      "limit": {
       "type": "integer",
       "default": 5000,
       "maximum": 50000,
       "exclusiveMinimum": 0
      },
      "adjusted": {
       "type": "boolean",
       "default": true
      },
      "timespan": {
       "enum": [
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
       ],
       "type": "string",
       "default": "day"
      },
      "multiplier": {
       "type": "integer",
       "default": 1,
       "maximum": 50000,
       "exclusiveMinimum": 0
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402stock-historical-ohlcv-aggregates-ad2e5b49/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.x402stock.xyz](https://www.zero.xyz/host/agents.x402stock.xyz/llms.txt)
