# Blockrun US Stock OHLC History — SPY

> Blockrun US Stock OHLC History — SPY is a paid API for AI agents from blockrun-web-vbsbhh7lea-uc.a.run.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Returns historical OHLC (open/high/low/close/volume) bar data for the SPY ETF at configurable resolutions from Pyth network

## Facts

- Endpoint: GET https://blockrun-web-vbsbhh7lea-uc.a.run.app/api/v1/stocks/us/history/SPY
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/blockrun-us-stock-ohlc-history-spy-9d533b84
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NJWFiqUrk1cHNzBgLF-iy

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-ohlc-history-spy-9d533b84
```

Example prompt: Pull daily OHLC bars for SPY from January 1, 2024 (Unix timestamp 1704067200) to March 31, 2024 (Unix timestamp 1711843200) using day resolution — I want to do a backtest on S&P 500 performance over that quarter.

## When to prefer this

Use this endpoint when you need historical OHLC candlestick bars for the SPY ETF specifically (S&P 500 tracker) sourced from Pyth network, especially for backtesting, charting, or time-series analysis across daily, weekly, monthly, or intraday resolutions. Prefer this over realtime price endpoints when you need a range of historical bars rather than a single current price.

## Known failure modes

- Missing required 'from' or 'to' query parameters returns 400 error
- Invalid symbol returns empty bars array or 404
- Unix timestamp range too large may return partial data
- Future timestamps return empty bars array
- Payment not made results in 402 Payment Required
- Invalid resolution enum value returns 400

## How this service works

US Stock OHLC bars for SPY @ D

## Output

An array of OHLC bar objects each containing Unix timestamp (t), open (o), high (h), low (l), close (c), and volume (v) fields, along with metadata including symbol, resolution, source ('pyth'), and the window start/end timestamps.

## 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-ohlc-history-spy-9d533b84/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from blockrun-web-vbsbhh7lea-uc.a.run.app](https://www.zero.xyz/host/blockrun-web-vbsbhh7lea-uc.a.run.app/llms.txt)
