# x402stock On-Chain Perps Candlestick Data

> x402stock On-Chain Perps Candlestick Data is a paid API for AI agents from x402stock.xyz, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Returns OHLCV candlestick data for a specified cryptocurrency perpetuals contract traded on Hyperliquid, with configurable interval and lookback period.

## Facts

- Endpoint: GET https://x402stock.xyz/api/v1/perps/candles/%7Bcoin%7D
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402stock-on-chain-perps-candlestick-data-0bd0d4ca
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QiMKszXKPkWAwa_lmswaF

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-on-chain-perps-candlestick-data-0bd0d4ca
```

Example prompt: Pull the last 200 one-hour candles for BTC perpetuals from x402stock — I want open, high, low, close, and volume so I can analyze recent price action.

## When to prefer this

Use this endpoint when you need on-chain perpetuals OHLCV candlestick data specifically from Hyperliquid, without needing API keys or subscriptions — ideal for AI agents doing technical analysis, backtesting signals, or monitoring crypto perp price action on a pay-per-call basis.

## Known failure modes

- Invalid coin symbol returns error or empty candles array
- Lookback exceeds maximum of 5000 resulting in validation error
- Invalid interval value not in allowed enum returns 400-level error
- Start/end timestamps out of range or inverted may return empty results
- Payment failure via x402 protocol returns 402 Payment Required
- Network timeout on Hyperliquid data source returns 503 or error

## How this service works

Pay-per-call market and economic data API for AI agents: US stocks, ETFs and options, forex, crypto and on-chain perps, energy commodities, US and global macro (Fed, CPI, jobs, GDP, Treasury, World Bank), SEC filings, congressional trades, and market sentiment. No API keys, no accounts. Pay per request in USDC via x402 on Base.

## Output

A JSON object containing the coin symbol, venue (Hyperliquid), interval, timestamp of the response, count of candles, and an array of OHLCV candle objects each with start time, end time, open, high, low, close, volume, and trade count fields.

## 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",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "required": [
      "interval",
      "lookback"
     ],
     "properties": {
      "end": {
       "type": "integer",
       "maximum": 9007199254740991,
       "exclusiveMinimum": 0
      },
      "start": {
       "type": "integer",
       "maximum": 9007199254740991,
       "exclusiveMinimum": 0
      },
      "interval": {
       "enum": [
        "1m",
        "3m",
        "5m",
        "15m",
        "30m",
        "1h",
        "2h",
        "4h",
        "8h",
        "12h",
        "1d",
        "3d",
        "1w",
        "1M"
       ],
       "type": "string",
       "default": "1h"
      },
      "lookback": {
       "type": "integer",
       "default": 200,
       "maximum": 5000,
       "exclusiveMinimum": 0
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "required": [
      "source",
      "as_of",
      "venue",
      "coin",
      "interval",
      "count",
      "candles"
     ],
     "properties": {
      "coin": {
       "type": "string"
      },
      "as_of": {
       "type": "string"
      },
      "count": {
       "type": "number"
      },
      "venue": {
       "type": "string"
      },
      "source": {
       "type": "string",
       "const": "x402stock"
      },
      "candles": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "start",
         "end",
         "open",
         "high",
         "low",
         "close",
         "volume",
         "trades"
        ],
        "properties": {
         "end": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "low": {
     
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "coin": "BTC",
  "as_of": "2026-06-04T00:00:00.000Z",
  "count": 1,
  "venue": "hyperliquid",
  "source": "x402stock",
  "candles": [
   {
    "end": "2026-06-01T00:59:59.999Z",
    "low": 71218,
    "high": 71589,
    "open": 71413,
    "close": 71411,
    "start": "2026-06-01T00:00:00.000Z",
    "trades": 17583,
    "volume": 3376.8
   }
  ],
  "interval": "1h"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402stock-on-chain-perps-candlestick-data-0bd0d4ca/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)
