# x402stock.xyz Previous Close OHLCV

> x402stock.xyz Previous Close OHLCV is a paid API for AI agents from x402stock.xyz, paid per call via x402, $0.01/call, status healthy (last checked 2026-09-13, last successful call 2026-09-02).

Returns the previous trading day's OHLCV bar (open, high, low, close, volume, VWAP, trade count, timestamp) for a single US stock ticker symbol.

## Facts

- Endpoint: GET https://x402stock.xyz/api/v1/prev-close/AAPL
- Price: $0.01/call
- Payment: x402
- Status: healthy
- Last checked: 2026-09-13
- Last successful call: 2026-09-02
- Success rate: 100% of calls made through Zero
- Activations on Zero: 4
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402stock-xyz-abb597dd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EsER59j7Zq03MPTvoI5Xz

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 x402stock-xyz-abb597dd
```

Example prompt: What were Apple's previous-day OHLCV numbers — open, high, low, close, volume, and VWAP — for AAPL?

## When to prefer this

Use this endpoint when you need the most recent completed trading day's OHLCV bar for a single specific US equity ticker and want a simple per-call micropayment model. Prefer this over bulk daily snapshots when you only need one symbol, or over real-time endpoints when historical end-of-day data suffices.

## Known failure modes

- Invalid or unknown ticker symbol returns null data field
- Non-trading day or weekend may return null or stale data
- Payment failure (402) if USDC balance insufficient
- Rate limiting or network timeout on x402 payment protocol
- Ticker for non-US or delisted security may return null data

## How this service works

Open, high, low, close, volume, and VWAP for a ticker's most recent completed trading day. One call returns one bar, handy for prior-close reference without setting a date range. From x402stock, a pay-per-call market & economic data API for AI agents. No API key or account; pay in USDC via x402.

## Output

Returns a JSON object with the ticker symbol, source ('massive'), as_of date string, and a data object containing: open, high, low, close (all numbers), volume (number), vwap (number or null), trade_count (number or null), and timestamp (string or null) for the previous trading session. Returns null for data if no data is available.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {}
 }
}
```

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "required": [
      "ticker",
      "data",
      "source",
      "as_of"
     ],
     "properties": {
      "data": {
       "anyOf": [
        {
         "type": "object",
         "required": [
          "open",
          "high",
          "low",
          "close",
          "volume",
          "vwap",
          "trade_count",
          "timestamp"
         ],
         "properties": {
          "low": {
           "type": "number"
          },
          "high": {
           "type": "number"
          },
          "open": {
           "type": "number"
          },
          "vwap": {
           "anyOf": [
            {
             "type": "number"
            },
            {
             "type": "null"
            }
           ]
          },
          "close": {
           "type": "number"
          },
          "volume": {
           "type": "number"
          },
          "timestamp": {
           "anyOf": [
            {
             "type": "string"
            },
            {
             "type": "null"
            }
           ]
          },
          "trade_count": {
           "anyOf": [
            {
             "type": "number"
            },
            {
             "type": "null"
            }
           ]
          }
         },
         "additionalProperties": false
        },
        {
         "type": "null"
        }
       ]
      },
      "as_of": {
       "type": "string"
      },
      "source": {
       "type": "string",
       "const": "x402stock"
      },
      "ticker": {
       "type": "string"
      },
      "feedback": {
       "type": "object",
       "required": [
        "endpoint",
        "method",
        "free",
        "note"
       ],
       "properties": {
        "f
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402stock-xyz-abb597dd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402stock.xyz](https://www.zero.xyz/host/x402stock.xyz/llms.txt)
