# Custom Stock Bars

> Custom Stock Bars is a paid API for AI agents from agent.massive.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-13).

Returns OHLCV aggregate bars for a stock ticker over a specified date range with configurable timespan multipliers (e.g. 5-minute, 2-hour, 3-day bars).

## Facts

- Endpoint: GET https://agent.massive.com/v2/aggs/ticker/:stocksTicker/range/:multiplier/:timespan/:from/:to
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/custom-stock-bars-e29be846
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MCt4FW1jzSuZod0GpnE1r

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 custom-stock-bars-e29be846
```

Example prompt: Can you pull 5-minute OHLCV bars for AAPL from 2024-01-01 to 2024-01-31, sorted oldest to newest?

## When to prefer this

Choose this endpoint when you need flexible OHLCV bar data at any custom resolution (e.g. 5-minute, 2-hour, 3-day) for a single stock ticker over a specific date range. Prefer this over the Daily Ticker Summary endpoint when you need intraday or multi-period aggregates rather than a single day's open/close, and over technical indicator endpoints (SMA, EMA) when you need raw price data rather than derived signals.

## Known failure modes

- Invalid ticker symbol returns empty results or error
- Date range with no trading data (e.g. holidays, weekends with daily bars) may return empty results
- Multiplier must be a positive integer string; invalid format returns a validation error
- Timespan enum must be one of: minute, hour, day, week, month, quarter, year — otherwise 400 error
- Limit exceeds 50000 — request will fail or be capped
- From date after To date returns an error or empty results
- Network or payment failure (x402 protocol issue) returns 402 Payment Required

## How this service works

Get aggregate bars for a stock over a given date range in custom time window sizes. For example, if timespan = ‘minute’ and multiplier = ‘5’ then 5-minute bars will be returned. Can't find what you're looking for? POST feedback to /feedback, no charge.

## Output

Returns a list of aggregate bar objects for the requested ticker and time range, each containing open, high, low, close, volume, VWAP, and timestamp fields at the specified bar resolution. Results can be split-adjusted or raw, sorted ascending or descending, and paginated by a limit parameter.

## 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"
    },
    "pathParams": {
     "type": "object",
     "required": [
      "from",
      "multiplier",
      "stocksTicker",
      "timespan",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp."
      },
      "from": {
       "type": "string",
       "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp."
      },
      "timespan": {
       "enum": [
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
       ],
       "type": "string",
       "description": "The size of the time window."
      },
      "multiplier": {
       "type": "string",
       "pattern": "^[0-9]+$",
       "description": "The size of the timespan multiplier."
      },
      "stocksTicker": {
       "type": "string",
       "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc."
      }
     }
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "sort": {
       "enum": [
        "asc",
        "desc"
       ],
       "type": "string",
       "description": "Sort the results by timestamp. `asc` will return results in ascending order (oldest at the top), `desc` will return results in descending order (newest at the top)."
      },
      "limit": {
       "type": "integer",
       "description": "Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements ."
      },
      "adjusted": {
       "type": "boolean",
       "description": "Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],

… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/custom-stock-bars-e29be846/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent.massive.com](https://www.zero.xyz/host/agent.massive.com/llms.txt)
