# OneSource Deepstate OHLCV Candles API

> OneSource Deepstate OHLCV Candles API is a paid API for AI agents from api.onesource.io, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-13).

Returns OHLCV candlestick data for a Deepstate on-chain order book at a specified timeframe and optional date range

## Facts

- Endpoint: GET https://api.onesource.io/deepstate/v1/candles/%7Bbook%7D
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onesource-deepstate-ohlcv-candles-api-ac3abb78
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xOP6rd5GB8jDt8zed4nYL

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 onesource-deepstate-ohlcv-candles-api-ac3abb78
```

Example prompt: Pull the 1-hour OHLCV candles for the NVDA-USDG book on Deepstate from September 1 to September 3, 2026 — I want open, high, low, close, and volume for each candle.

## When to prefer this

Use this endpoint when you need structured OHLCV candlestick data for Deepstate on-chain order books (including tokenized assets like stocks paired with stablecoins). It is the right choice for charting, backtesting, or market analysis on Deepstate markets specifically, and supports flexible timeframes from 1-minute to weekly. Prefer it over generic DEX data APIs when you need Deepstate-specific book metadata (base/quote token addresses, market session labels) and consistent raw price formatting.

## Known failure modes

- Missing required 'book' path parameter returns an error or 404
- Missing required 'tf' query parameter returns a validation error
- Invalid timeframe enum value (e.g. '2h') returns a 400 bad request
- Unknown or invalid book slug/address returns empty candles array or 404
- Date range with no trading activity returns empty candles array
- Payment not provided or insufficient results in 402 Payment Required
- Network or RPC timeout returns 503 or gateway error

## How this service works

Two data families for AI agents: live Ethereum mainnet, Sepolia testnet, and Robinhood Chain RPC reads, plus Deepstate on-chain market data (order books, trades, candles, and analytics). Pay per call or use batch/session mode: USDC on Base via x402, or pathUSD/USDC.e on Tempo via MPP. No API key required to start; a flat-rate monthly subscription is also available.

## Output

A JSON object containing the book identifier, book slug, label, base and quote token metadata (symbol, address, decimals), the requested timeframe, and an array of candle objects each with timestamp, open/high/low/close raw prices, base and quote volume, trade count, whether it opened a new bucket, and the market session label.

## 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"
    },
    "pathParams": {
     "type": "object",
     "required": [
      "book"
     ],
     "properties": {
      "book": {
       "type": "string"
      }
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "tf"
     ],
     "properties": {
      "tf": {
       "enum": [
        "1m",
        "5m",
        "15m",
        "30m",
        "1h",
        "4h",
        "1d",
        "1w"
       ],
       "type": "string"
      },
      "to": {
       "type": "string"
      },
      "from": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "tf": {
       "type": "string"
      },
      "book_id": {
       "type": "string"
      },
      "candles": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "t": {
          "type": "string"
         },
         "trades": {
          "type": "integer"
         },
         "low_raw": {
          "type": "string"
         },
         "high_raw": {
          "type": "string"
         },
         "open_raw": {
          "type": "string"
         },
         "close_raw": {
          "type": "string"
         },
         "open_bucket": {
          "type": "boolean"
         },
         "market_session": {
          "type": "string"
         },
         "volume_base_raw": {
          "type": "string"
         },
         "volume_quote_raw": {
          "type": "string"
         }
        }
       }
      },
      "book_slug": {
       "type": "string"
      },
      "base_token": {
       "type": "object",
       "properties": {
        "symbol": {
         "type": "string"
        },
        "address": {
         "type": "string"
        },
        "decimals": {
         "type": "integer"
        }
       }
      },
      "book_label": {
       "type": "string"
      },
      "quote_token": {
       "type": "object",
    
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "tf": "1h",
  "book_id": "0xdf941c235503a5d2e67aee5dea00f2965f99421c0d034bd77f924c05c66bf399",
  "candles": [
   {
    "t": "2026-09-02T14:00:00Z",
    "trades": 14,
    "low_raw": "215.70112004",
    "high_raw": "220.47999716",
    "open_raw": "216.43128523",
    "close_raw": "216.47999901",
    "open_bucket": false,
    "market_session": "regular",
    "volume_base_raw": "1904773188220000000000",
    "volume_quote_raw": "412330119842"
   }
  ],
  "book_slug": "NVDA-USDG",
  "base_token": {
   "symbol": "NVDA",
   "address": "0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",
   "decimals": 18
  },
  "book_label": "NVDA/USDG",
  "quote_token": {
   "symbol": "USDG",
   "address": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
   "decimals": 6
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onesource-deepstate-ohlcv-candles-api-ac3abb78/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.onesource.io](https://www.zero.xyz/host/api.onesource.io/llms.txt)
