# x402stock Crypto Pair OHLCV Aggregates

> x402stock Crypto Pair 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 candlestick bar data for a cryptocurrency trading pair over a specified time range and timespan granularity, paid per request in USDC via x402.

## Facts

- Endpoint: GET https://x402stock.xyz/api/v1/crypto/%7Bpair%7D/aggregates
- 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-crypto-pair-ohlcv-aggregates-7fd35dc3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_X6zd4R3l2tLxxrB-vVmVi

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-crypto-pair-ohlcv-aggregates-7fd35dc3
```

Example prompt: Pull daily OHLCV bars for BTC-USD on x402stock from January 1 2025 to June 1 2025, adjusted, sorted ascending, limit 500 bars.

## When to prefer this

Use this endpoint when you need historical OHLCV candlestick data for a specific cryptocurrency pair and want pay-per-call access with no API key or account setup, paying $0.02 USDC per request via x402 on Base. Prefer this over subscription-based data providers when running AI agents that need on-demand crypto price history for backtesting, charting, or analysis.

## Known failure modes

- Invalid or unsupported crypto pair symbol returns an error or empty bar array
- Date range with no trading data returns bars array with count 0
- Payment failure (insufficient USDC balance or x402 protocol error) blocks the request
- Exceeding the maximum limit of 50000 bars returns a validation error
- Invalid timespan enum value returns a schema validation error
- from date later than to date returns an error or empty result

## How this service works

Pay-per-call market and economic data API for AI agents: US stocks, ETFs and options, forex, crypto and on-chain perps, energy commodities, US and global macro (Fed, CPI, jobs, GDP, Treasury, World Bank), SEC filings, congressional trades, and market sentiment. No API keys, no accounts. Pay per request in USDC via x402 on Base.

## Output

A JSON object containing the ticker symbol, an as_of timestamp, the data source label ('x402stock'), and a data object with a count and an array of candlestick bars — each bar includes open, high, low, close, volume, VWAP, trade count, and an ISO timestamp — plus an adjusted boolean flag.

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "bars": [
    {
     "low": 192.5,
     "high": 196,
     "open": 193,
     "vwap": 194.8,
     "close": 195.12,
     "volume": 50000000,
     "timestamp": "2026-05-28T04:00:00.000Z",
     "trade_count": 450000
    }
   ],
   "count": 1,
   "adjusted": true
  },
  "as_of": "2026-05-29T20:00:00.000Z",
  "source": "x402stock",
  "ticker": "AAPL"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402stock-crypto-pair-ohlcv-aggregates-7fd35dc3/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)
