# Market Data OHLC Candlestick Aggregates

> Market Data OHLC Candlestick Aggregates is a paid API for AI agents from marketdata.use.x402atlas.com, paid per call via x402, $0.015/call, status unknown (last checked 2026-10-12).

Returns historical OHLC candlestick bars (aggregates) for stocks, crypto, forex, and options over a configurable time window and bar size.

## Facts

- Endpoint: GET https://marketdata.use.x402atlas.com/aggregates?utm_source=zero.xyz
- Price: $0.015/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 1
- Tags: x402
- Canonical page: https://www.zero.xyz/c/market-data-ohlc-candlestick-aggregates-37fc3af2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UlABSUE0IEL7pKG7GPwAB

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 market-data-ohlc-candlestick-aggregates-37fc3af2
```

Example prompt: Can you pull the daily OHLC candlestick bars for AAPL from 2024-01-01 to 2024-06-30, adjusted for splits, sorted ascending?

## When to prefer this

Use this endpoint when you need historical candlestick OHLC bar data for any supported asset class (stocks, crypto, forex, options) at any granularity from minute to year. Prefer this over the previous-day endpoint when you need multi-period historical data or custom bar sizes for backtesting, charting, or technical analysis.

## Known failure modes

- Missing required parameters (ticker, multiplier, timespan, from, to) returns a 400 error
- Invalid ticker format (e.g. missing asset prefix for crypto like X:BTCUSD) returns no results or error
- Date range with no trading activity returns empty results array
- Limit exceeds 50000 returns a validation error
- Invalid timespan value returns a 400 error
- Payment not processed (x402 payment required) returns 402 status

## How this service works

Market data OHLC candlestick bars for stocks, crypto, forex and options — historical aggregates over any window by ticker.

## Output

Returns a list of OHLC candlestick bar objects for the requested ticker and time window, each containing open, high, low, close prices, volume, VWAP, and timestamp. Bars are sized by the multiplier × timespan combination (e.g. 5-minute, 1-day, 1-week).

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "ticker",
      "multiplier",
      "timespan",
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "Window end: YYYY-MM-DD or millisecond epoch"
      },
      "from": {
       "type": "string",
       "description": "Window start: YYYY-MM-DD or millisecond epoch. Historical depth is limited (~2 years); prefer recent windows"
      },
      "sort": {
       "enum": [
        "asc",
        "desc"
       ],
       "type": "string",
       "description": "Result ordering"
      },
      "limit": {
       "type": "integer",
       "maximum": 50000,
       "minimum": 1,
       "description": "Max base aggregates returned"
      },
      "ticker": {
       "type": "string",
       "description": "Asset-prefixed ticker, e.g. AAPL, X:BTCUSD, C:EURUSD"
      },
      "adjusted": {
       "type": "boolean",
       "default": true,
       "description": "Adjust for splits"
      },
      "timespan": {
       "enum": [
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
       ],
       "type": "string",
       "description": "Aggregate window unit"
      },
      "multiplier": {
       "type": "integer",
       "maximum": 50000,
       "minimum": 1,
       "description": "Size of the timespan multiplier (e.g. 5 for 5-minute bars)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "queried_at",
      "ticker",
      "multiplier",
      "timespan",
      "from",
      "to",
      "adjusted",
      "candles"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "Echo of the requested window end."
      },
      "from": {
       "type": "string",
       "description": "Echo of the requested window start."
      },
      "ticker": {
       "type": "string",
       "desc
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "to": "2024-01-31",
  "from": "2024-01-01",
  "ticker": "X:BTCUSD",
  "candles": [
   {
    "low": 41500,
    "high": 43000,
    "open": 42000,
    "time": "2024-01-01T00:00:00Z",
    "vwap": 42500,
    "close": 42800,
    "volume": 12000,
    "transactions": 98000
   }
  ],
  "adjusted": true,
  "timespan": "day",
  "multiplier": 1,
  "queried_at": "2026-07-06T12:00:00Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/market-data-ohlc-candlestick-aggregates-37fc3af2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from marketdata.use.x402atlas.com](https://www.zero.xyz/host/marketdata.use.x402atlas.com/llms.txt)
