Spot market data

Get Spot candles

Changed on

Returns OHLCV candlestick data for a Spot market as an array of objects, each with the full field names startTime, open, high, low, close, and volume (values are strings). If you need the TradingView UDF format instead (parallel o/h/l/c/v arrays of numbers), use GET /v1/spot/history (Get Price History). Supply market (candles) or symbol (history), resolution, to, and either from or countback. Resolutions: 1, 5, 15, 60, 240, 1D, 1W; D/W aliases are accepted. to is inclusive.

get/v1/spot/candles

Request

  • Base URL
    https://api.ondoperps.xyz
  • URL
    https://api.ondoperps.xyz/v1/spot/candles
  • Auth
    • HTTP bearer
    • or API key in header ONDO-KEY-ID

Query parameters

marketstring required
Example:SPY-USDC

Perps trading market

resolutionstring required
Example:1

Bar resolution. If the string has no "D", "W", or "M" suffix it is interpreted as minutes (e.g. 1, 5, 15, 30, 60, 240). Use suffixes for daily (e.g. 1D), weekly (1W), or monthly (1M).

frominteger
Example:1684814400

Unix seconds, not milliseconds.

tointeger required
Example:1684900800

Unix seconds, not milliseconds.

countbackinteger

Positive bar count ending at to; supply either from or countback.

Response

Array of OHLCV candles

successboolean required

Whether the request was successful

errorstring

Error message, present only on failure

error_codestring

Semantic error code. See each endpoint's error responses for the specific codes it can return.

deprecatedstring

Deprecation notice, if applicable

Example response

{
  "success": true,
  "result": [
    {
      "startTime": "2024-01-04T16:00:00Z",
      "open": "150.25",
      "high": "152.10",
      "low": "149.80",
      "close": "151.45",
      "volume": "1234.56"
    }
  ]
}

Changes