# x402stock Crypto Spot OHLCV Historical Bars

> x402stock Crypto Spot OHLCV Historical Bars is a paid API for AI agents from agents.x402stock.xyz, paid per call via MPP or x402, $0.02/call, status unknown (last checked 2026-09-13).

Returns historical OHLCV candlestick bars for major crypto spot pairs (e.g. BTC-USD, ETH-USD) at a configurable timespan and multiplier between two dates.

## Facts

- Endpoint: GET https://agents.x402stock.xyz/api/v1/crypto/{pair}/aggregates
- Price: $0.02/call
- Payment: MPP, x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Provider: agents.x402stock.xyz
- Website: https://agents.x402stock.xyz
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agents-x402stock-xyz-x402stock-crypto-spot-ohlcv-historical-bars-57f7ac23
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_v2uYqYNGwrIBhzeofamYP

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-crypto-spot-ohlcv-historical-bars-57f7ac23
```

Example prompt: Pull me daily BTC-USD OHLCV bars from January 1 2024 to June 30 2024, sorted ascending, so I can chart Bitcoin's price trend over the first half of last year.

## When to prefer this

Use this endpoint when you need multi-period historical OHLCV candlestick data for major centralized-market crypto spot pairs like BTC-USD or ETH-USD. Choose this over /api/v1/spot (which is for Hyperliquid-listed tokens) or /api/v1/perps (for perpetual futures). Best for backtesting, charting, trend analysis, and any workflow requiring time-series price data with volume and VWAP across configurable timespans.

## Known failure modes

- Unsupported or misspelled pair (e.g. not a major coin) returns an error or empty data
- Date range too large or limit exceeded may truncate results or return an error
- Invalid timespan or multiplier value returns a validation error
- Future date ranges return empty or partial data
- Pair formatted incorrectly (not BASE-QUOTE) returns a bad request error
- Payment failure (insufficient USDC balance) blocks the request

## How this service works

Historical OHLCV bars for a major-coin crypto spot pair at the requested multiplier and timespan (minute, hour, day, week, month) between `from` and `to`. Pass the pair in the path as BASE-QUOTE, e.g. BTC-USD or ETH-USD. Aggregated centralized-market spot — for Hyperliquid-listed token spot use /api/v1/spot, for perps use /api/v1/perps. From x402stock, a market & economic data API (x402, USDC).

## Output

Returns an array of OHLCV bars each containing open, high, low, close, volume, VWAP, trade count, and timestamp, along with a total bar count, adjusted flag, source identifier, and as-of timestamp. Data represents aggregated centralized-market spot prices for the requested pair and time window.

## 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": {
     "pair": {
      "type": "string"
     },
     "type": "object"
    },
    "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
  }
 }
}
```

## 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-crypto-spot-ohlcv-historical-bars-57f7ac23/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)
