# BlockRun US Stock Historical OHLCV

> BlockRun US Stock Historical OHLCV is a paid API for AI agents from blockrun.ai, paid per call via x402, $0.001/call, status down (last checked 2026-09-15).

Returns historical OHLCV bar data for a given US stock ticker (NYSE/Nasdaq/AMEX) over a specified time window and bar resolution, sourced from Pyth, paid per-call in USDC.

## Facts

- Endpoint: GET https://blockrun.ai/api/v1/usstock/history/AAPL
- Price: $0.001/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/blockrun-us-stock-historical-ohlcv-0e09dbe4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9Gg0Mm8sbmJTm1xoQpfGD

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 blockrun-us-stock-historical-ohlcv-0e09dbe4
```

Example prompt: Pull daily OHLCV bars for AAPL from January 1 2024 to June 30 2024 — I need the open, high, low, close, and volume for each day.

## When to prefer this

Choose this endpoint when you need historical OHLCV candlestick data for US-listed stocks (NYSE, Nasdaq, AMEX) and want pay-per-call pricing settled in USDC with no API key setup. Particularly useful for AI agents that need financial time series data on demand without managing subscriptions, and when TradingView-compatible bar resolutions (1/5/15/60/240 min, D, W, M) are required.

## Known failure modes

- Invalid or unsupported ticker symbol returns an error or empty bars array
- from/to timestamps out of available data range returns empty bars
- Malformed Unix timestamp integers cause a 400-level error
- Unsupported resolution enum value causes a validation error
- Payment failure (insufficient USDC balance) results in 402 Payment Required
- Network timeout for Pyth data source may cause delayed or failed response

## How this service works

Pay for the outcome. One endpoint for every model, tool and data source an agent needs — each call priced before it runs, at the best value per dollar. 99 models and 183 data and tool APIs.

## Output

An array of OHLCV bars for the requested ticker and time window, each containing bar-start Unix timestamp, open, high, low, close, and volume values, along with the symbol, resolution, and data source (Pyth).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "path": {
     "type": "object",
     "required": [
      "symbol"
     ],
     "properties": {
      "symbol": {
       "type": "string",
       "example": "AAPL",
       "description": "NYSE/Nasdaq/AMEX ticker (AAPL, TSLA, NVDA, CRCL, SPY, …)."
      }
     }
    },
    "query": {
     "type": "object",
     "required": [
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "integer",
       "description": "Window end (Unix seconds)."
      },
      "from": {
       "type": "integer",
       "description": "Window start (Unix seconds)."
      },
      "session": {
       "enum": [
        "pre",
        "post",
        "on"
       ],
       "type": "string",
       "description": "Optional US market session."
      },
      "resolution": {
       "enum": [
        "1",
        "5",
        "15",
        "60",
        "240",
        "D",
        "W",
        "M"
       ],
       "type": "string",
       "default": "D",
       "description": "Bar resolution (TradingView convention): 1/5/15/60/240 min, D day, W week, M month."
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "symbol",
    "resolution",
    "bars",
    "source"
   ],
   "properties": {
    "to": {
     "type": "integer"
    },
    "bars": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "t",
       "o",
       "h",
       "l",
       "c",
       "v"
      ],
      "properties": {
       "c": {
        "type": "number",
        "description": "Close"
       },
       "h": {
        "type": "number",
        "description": "High"
       },
       "l": {
        "type": "number",
        "description": "Low"
       },
       "o": {
        "type": "number",
        "description": "Open"
       },
       "t": {
        "type": "integer",
        "description": "Bar start (Unix seconds)"
       },
       "v": {
        "type": "number",
        "description": "Volume"
       }
      }
     }
    },
    "from": {
     "type": "integer"
    },
    "source": {
     "type": "string",
     "const": "pyth"
    },
    "symbol": {
     "type": "string",
     "example": "AAPL"
    },
    "resolution": {
     "type": "string",
     "example": "D"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/blockrun-us-stock-historical-ohlcv-0e09dbe4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from blockrun.ai](https://www.zero.xyz/host/blockrun.ai/llms.txt)
