# x402stock Stock Price History (OHLCV Aggregates)

> x402stock Stock Price History (OHLCV Aggregates) is a paid API for AI agents from agents.x402stock.xyz, paid per call via MPP, $0.02/call, status healthy (last checked 2026-09-18, last successful call 2026-08-28).

Returns historical OHLCV (open, high, low, close, volume) bars for a US-listed stock or ETF at a specified timespan and multiplier between two dates.

## Facts

- Endpoint: GET https://agents.x402stock.xyz/api/v1/aggregates/{ticker}
- Price: $0.02/call
- Payment: MPP
- Status: healthy
- Last checked: 2026-09-18
- Last successful call: 2026-08-28
- Success rate: 100% of calls made through Zero
- Activations on Zero: 1
- Provider: agents.x402stock.xyz
- Website: https://agents.x402stock.xyz
- Canonical page: https://www.zero.xyz/c/agents-x402stock-xyz-x402stock-stock-price-history-ohlcv-aggregates-6c81338d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-fnTJz4mZj_WiLzlNeiye

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 agents-x402stock-xyz-x402stock-stock-price-history-ohlcv-aggregates-6c81338d
```

Example prompt: Can you pull the daily adjusted OHLCV price history for NVDA from January 1, 2024 to June 30, 2024, sorted ascending?

## When to prefer this

Choose this endpoint when you need historical price bars (OHLCV) for a US-listed stock or ETF across any timeframe from minute to yearly granularity, especially for charting, trend analysis, or backtesting. Prefer it over real-time quote endpoints when historical depth matters. It requires no API key — only a USDC micropayment via x402, making it ideal for autonomous AI agents.

## Known failure modes

- Invalid or unlisted ticker returns empty bars or error
- Date range outside available data returns empty result
- Exceeding limit of 50,000 bars may truncate results
- Payment failure via x402/USDC blocks the request
- Invalid timespan or multiplier value returns a 400 error
- Future dates may return empty or partial data

## 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 bar objects, each containing open, high, low, close, volume, VWAP, trade count, and timestamp, along with the total bar count, whether prices are adjusted, the ticker symbol, data source, and an as-of timestamp.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "ticker"
 ],
 "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
  },
  "ticker": {
   "type": "string",
   "description": "US-listed ticker symbol (uppercase), e.g. AAPL."
  },
  "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
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "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"
       },
       "high": {
        "type": "number"
       },
       "open": {
        "type": "number"
       },
       "vwap": {
        "anyOf": [
         {
          "type": "number"
         },
         {
          "type": "null"
         }
        ]
       },
       "close": {
        "type": "number"
       },
       "volume": {
        "type": "number"
       },
       "timestamp": {
        "anyOf": [
         {
          "type": "string"
         },
         {
          "type": "null"
         }
        ]
       },
       "trade_count": {
        "anyOf": [
         {
          "type": "number"
         },
         {
          "type": "null"
         }
        ]
       }
      },
      "additionalProperties": false
     }
    },
    "count": {
     "type": "number"
    },
    "adjusted": {
     "type": "boolean"
    }
   },
   "additionalProperties": false
  },
  "as_of": {
   "type": "string"
  },
  "source": {
   "type": "string",
   "const": "x402stock"
  },
  "ticker": {
   "type": "string"
  },
  "feedback": {
   "type": "object",
   "required": [
    "endpoint",
    "method",
    "free",
    "note"
   ],
   "properties": {
    "free": {
     "type": "boolean"
    },
    "note": {
     "type": "string"
    },
    "method": {
     "type": "string",
     "const": "POST"
    },
    "endpoint": {
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agents-x402stock-xyz-x402stock-stock-price-history-ohlcv-aggregates-6c81338d/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)
