# agent402.tools Stock History OHLCV Bars

> agent402.tools Stock History OHLCV Bars is a paid API for AI agents from agent402.tools, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Returns historical OHLCV (open, high, low, close, volume) price bars for a stock ticker at configurable intervals and date ranges, ready for charting or backtesting.

## Facts

- Endpoint: GET https://agent402.tools/api/stock-history
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-stock-history-ohlcv-bars-21013773
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_N6ZUmvV0tu0KeXCyS3h8S

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 agent402-tools-stock-history-ohlcv-bars-21013773
```

Example prompt: Pull the daily OHLCV bars for NVDA over the past 6 months so I can chart them and run a backtest.

## When to prefer this

Use this endpoint when you need structured OHLCV candlestick data for US stocks, ETFs, or indices at a specific granularity (from 1-minute to monthly) and a defined historical window. Prefer this over a live quote endpoint when you need multiple historical data points for charting, backtesting, or technical analysis. Note that intraday data is capped at ~60 days by the upstream provider.

## Known failure modes

- Invalid or unknown ticker symbol returns an error or empty array
- Intraday intervals (1m–60m) requested for ranges beyond ~60 days return truncated or no data due to Yahoo Finance limits
- Missing required 'symbol' query parameter returns a validation error
- Unsupported interval or range value returns a 400 bad request
- Network or upstream Yahoo Finance outage may cause 5xx errors

## How this service works

Historical OHLCV bars for a symbol. Configurable interval (1m, 5m, 15m, 30m, 60m, 1d, 1wk, 1mo, 3mo) and range (1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max). Intraday intervals are limited by Yahoo to ~60 days of data. Returns a flat array of bars (time, open, high, low, close, volume) ready for charting or backtests.

## Output

A flat array of bar objects each containing time, open, high, low, close, and volume fields for the requested symbol, interval, and range — suitable for direct use in charting libraries or quantitative backtests.

## 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": [
      "symbol"
     ],
     "properties": {
      "range": {
       "type": "string",
       "description": "History window: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default 1mo)"
      },
      "symbol": {
       "type": "string",
       "description": "Ticker symbol"
      },
      "interval": {
       "type": "string",
       "description": "Bar size: 1m, 5m, 15m, 30m, 60m, 1d, 1wk, 1mo, 3mo (default 1d)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "symbol",
      "interval",
      "range",
      "currency",
      "timezone",
      "bars",
      "count"
     ],
     "properties": {
      "bars": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "low": {
          "type": "number"
         },
         "high": {
          "type": "number"
         },
         "open": {
          "type": "number"
         },
         "time": {
          "type": "string"
         },
         "close": {
          "type": "number"
         },
         "volume": {
          "type": "integer"
         }
        }
       }
      },
      "count": {
       "type": "integer"
      },
      "range": {
       "type": "string"
      },
      "symbol": {
       "type": "string"
      },
      "currency": {
       "type": "string"
      },
      "interval": {
       "type": "string"
      },
      "timezone": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "bars": [
   {
    "low": 217.65,
    "high": 220.3,
    "open": 218.2,
    "time": "2026-05-20T13:30:00Z",
    "close": 219.8,
    "volume": 48123456
   }
  ],
  "count": 1,
  "range": "1mo",
  "symbol": "AAPL",
  "currency": "USD",
  "interval": "1d",
  "timezone": "America/New_York"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-stock-history-ohlcv-bars-21013773/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
