# x402stock.xyz OHLCV Aggregates

> x402stock.xyz OHLCV Aggregates is a paid API for AI agents from x402stock.xyz, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Returns historical OHLCV (open, high, low, close, volume) aggregate bars for a given US equity ticker over a specified date range and timespan.

## Facts

- Endpoint: GET https://x402stock.xyz/api/v1/aggregates/AAPL
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402stock-xyz-84621029
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-4VhUv9Z8PA74nFIQiQQ_

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-xyz-84621029
```

Example prompt: Can you pull daily adjusted OHLCV bars for AAPL from 2024-01-01 to 2024-03-31, sorted ascending with a limit of 500 bars?

## When to prefer this

Use this endpoint when you need historical OHLCV candlestick or bar data for a specific US equity ticker over a custom date range. Prefer it over the end-of-day market snapshot endpoint when you need intraday granularity, multi-day history, or adjusted price series for a single ticker. The x402 micropayment model ($0.02/call) makes it cost-effective for targeted lookups.

## Known failure modes

- Invalid ticker symbol returns empty or error response
- Date range with no trading data (e.g. weekends/holidays only) returns zero bars
- Invalid timespan or multiplier value causes validation error
- Exceeding limit of 50000 bars returns error
- Missing required query parameters (multiplier, timespan, from, to) causes 400-level error
- Payment failure (HTTP 402) if USDC payment not included

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

Returns an object containing the ticker symbol, a data block with an array of OHLCV bars (open, high, low, close, volume, VWAP, trade_count, timestamp), the total bar count, whether the data is adjusted, the data source ('massive'), and the as_of date.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "to": "2024-03-31",
   "from": "2024-01-01",
   "sort": "asc",
   "limit": 500,
   "adjusted": true,
   "timespan": "day",
   "multiplier": 1
  }
 }
}
```

## 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"
    },
    "queryParams": {
     "type": "object",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "required": [
      "multiplier",
      "timespan",
      "from",
      "to",
      "adjusted",
      "sort",
      "limit"
     ],
     "properties": {
      "to": {
       "type": "string",
       "default": "2026-09-15",
       "minLength": 1
      },
      "from": {
       "type": "string",
       "default": "2025-09-15",
       "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
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "required": [
      "ticker",
      "data",
      "source",
      "as_of"
     ],
     "properties": {
      "data": {
       "type": "object",
       "required": [
        "bars",
        "count"
       ],
       "properties": {
        "bars": {
         "type": "array",
         "items": {
          "type": "object",
          "required": [
           "open",
           "high",
           "low",
           "close",
           "volume",
           "vwap",
           "trade_count",
           "timestamp"
          ],
          "properties": {
           "low": {
            "type": "number"
  
… (truncated)
```

## More

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