# Massive x402 API – Stock Aggregate Bars

> Massive x402 API – Stock Aggregate 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-15).

Returns OHLCV aggregate bars for a US stock ticker over a specified time range and timespan granularity, billed per request via x402 micropayment.

## Facts

- Endpoint: GET https://agent.massive.com/v2/aggs/ticker/%7BstocksTicker%7D/range/%7Bmultiplier%7D/%7Btimespan%7D/%7Bfrom%7D/%7Bto%7D
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/massive-x402-api-stock-aggregate-bars-6caab36d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4JI8XCFnubneiXoToVdkw

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 massive-x402-api-stock-aggregate-bars-6caab36d
```

Example prompt: Pull daily adjusted OHLCV bars for AAPL from 2024-01-01 to 2024-06-30, sorted ascending — I need every required/open/high/low/close/volume candle for that half-year period.

## When to prefer this

Choose this endpoint when you need historical or recent US stock OHLCV aggregate bars at any granularity (minute through year) without setting up an account or subscription — payment is per-request via x402 USDC micropayment. Prefer this over subscription-based data APIs when running ad-hoc or low-frequency queries where paying per call is more economical than a monthly plan.

## Known failure modes

- 402 Payment Required returned when x402 payment has not yet settled — normal flow, agent must complete payment before data is returned
- Invalid ticker symbol returns an empty results array or error status
- Date range produces no results if market was closed or range is invalid
- Malformed date format (not YYYY-MM-DD or millisecond timestamp) causes a 400 error
- Limit exceeding 50000 is rejected
- Network timeout if payment settlement is slow

## How this service works

US stock market data, sold per request over x402. Every path here answers 402 with the payment terms in the PAYMENT-REQUIRED header, and answers with the data once the payment settles. No account, no API key, no subscription.

## Output

A JSON object containing the ticker symbol, an array of aggregate bar objects (each with open, high, low, close, volume, volume-weighted average price, number of transactions, and a millisecond timestamp), adjusted flag, result count, query count, request ID, and an optional next_url for cursor-based pagination.

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "status": "OK",
  "ticker": "AAPL",
  "results": [
   {
    "c": 75.0875,
    "h": 75.15,
    "l": 73.7975,
    "n": 1,
    "o": 74.06,
    "t": 1577941200000,
    "v": 135647456,
    "vw": 74.6099
   },
   {
    "c": 74.3575,
    "h": 75.145,
    "l": 74.125,
    "n": 1,
    "o": 74.2875,
    "t": 1578027600000,
    "v": 146535512,
    "vw": 74.7026
   }
  ],
  "adjusted": true,
  "next_url": "https://api.massive.com/v2/aggs/ticker/AAPL/range/1/day/1578114000000/2020-01-10?cursor=bGltaXQ9MiZzb3J0PWFzYw",
  "queryCount": 2,
  "request_id": "6a7e466379af0a71039d60cc78e72282",
  "resultsCount": 2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/massive-x402-api-stock-aggregate-bars-6caab36d/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)
