# OneSource Deepstate OHLCV Candles

> OneSource Deepstate OHLCV Candles 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-14).

Fetches OHLCV (open, high, low, close, volume) candlestick data for a specified trading book/market at a given timeframe

## Facts

- Endpoint: GET https://api.onesource.io/deepstate/v1/candles/:book
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onesource-deepstate-ohlcv-candles-50180eeb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ISZucb6J_alq8XVX9Ye8L

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-50180eeb
```

Example prompt: Can you pull the 1-hour OHLCV candles for the ETH-USDC book from OneSource Deepstate, covering the last 7 days?

## When to prefer this

Use this endpoint when you need structured OHLCV candlestick data for a specific market book on the OneSource Deepstate platform, especially for DeFi/DEX markets that may not appear on centralized exchange APIs. Prefer this over generic market data providers when you need raw on-chain price data with trade counts, market session context, and token contract metadata bundled alongside candles. Ideal for agents doing technical analysis, backtesting, or real-time signal detection on decentralized markets.

## Known failure modes

- Invalid or unknown book identifier returns an error or empty response
- Missing required 'tf' (timeframe) query parameter causes a 400 error
- Invalid timeframe value outside the allowed enum causes a 400 error
- Invalid 'from' or 'to' timestamp format may cause parsing errors
- No candles available for the requested time range returns an empty candles array
- Payment failure or insufficient USDC balance (x402) prevents the request from completing

## How this service works

Deepstate, the on-chain order-book exchange on Robinhood Chain. OHLCV candles for a market.

## Output

Returns an array of OHLCV candlesticks for the specified market book and timeframe, each containing timestamp, open/high/low/close prices (as raw strings), trade count, volume in both base and quote tokens, market session label, and open_bucket flag. Also includes metadata about the book (book_id, book_slug, book_label) and token details (symbol, address, decimals) for both base and quote tokens.

## 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)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onesource-deepstate-ohlcv-candles-50180eeb/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)
