Request Founder AccessApplications are open for a limited group of Founder Members

Price Data API

Price Data API

GET https://darwintiq.com/api/price-data

Returns OHLCV price data, optionally enriched with Support/Resistance (SupRes) per bar.
Use it in two modes:

  1. Range mode — a list of bars from begin onward (sorted ASC or DESC).
  2. Latest mode — only the most recent bar.

Auth required: See Authentication


Query Parameters

ParameterTypeRequiredAllowed ValuesDefaultDescription
symbolstringyesEURUSD, GBPUSD, XAUUSD, USDJPY, AUDUSD, AUDNZD, GDAXI, SP500Instrument symbol (case-insensitive; DAX normalized to GDAXI, SPX500 to SP500).
timeframestringnoM1 (others TBA)M1Bar timeframe.
beginstringnoYYYY-MM-DD HH:MM:SSLower bound for range mode. Align to your first bar’s opentime for perfect sync.
sortstringnoASC | DESCASCSort order for range mode.
latestnumberno1If 1, returns only the most recent bar (ignores begin/sort).
attach_supresnumberno1If 1, attaches the SupRes snapshot to each returned bar as supres.

Headers

HeaderRequiredExampleNotes
AuthorizationyesBearer sk_live_abc123...Your API token (per account).

Range mode: omit latest (optionally provide begin).
Latest mode: set latest=1.


Data Model

Chart Point (Bar)

type ChartPoint = {
  opentime: string;  // "YYYY-MM-DD HH:mm:ss"
  open: number|string;
  high: number|string;
  low: number|string;
  close: number|string;
  volume?: number|string;
  above?: number|string; 
  below?: number|string;  // (if present in source)
  supres?: SupResSnapshot | null; // only when attach_supres=1
};

SupRes Snapshot (optional per bar)

type SupResLevel = { idx: number; type: "R" | "S"; price: number; touches: number };
type SupResMTFLevel = SupResLevel & { tf: string };
type SupResLine = { t1: string; y1: number; t2: string; y2: number };

type SupResSnapshot = {
  meta?: Record<string, unknown>;
  cur?: SupResLevel[];
  mtf?: SupResMTFLevel[];
  reg?: { mid: SupResLine; up: SupResLine; dn: SupResLine } | null;
  swing?: { top: SupResLine | null; bot: SupResLine | null } | null;
} | null;

Responses

Range Mode

{
  "status": "success",
  "symbol": "EURUSD",
  "timeframe": "M1",
  "begin": "2025-02-26 18:00:00",
  "sort": "ASC",
  "count": 3,
  "candles": [
    {
      "opentime": "2025-02-26 18:00:00",
      "open": 1.07810,
      "high": 1.07890,
      "low": 1.07795,
      "close": 1.07860,
      "volume": 1234.5,
      "supres": null
    },
    {
      "opentime": "2025-02-26 18:01:00",
      "open": 1.07861,
      "high": 1.07910,
      "low": 1.07820,
      "close": 1.07895,
      "volume": 1130.0,
      "supres": {
        "cur":  [ { "idx": 119, "type": "R", "price": 1.07895, "touches": 3 } ],
        "mtf":  [ { "tf": "M5", "idx": 23, "type": "S", "price": 1.07810, "touches": 2 } ],
        "reg":  {
          "mid": { "t1": "2025-02-26 18:00:00", "y1": 1.0782, "t2": "2025-02-26 18:01:00", "y2": 1.0786 },
          "up":  { "t1": "2025-02-26 18:00:00", "y1": 1.0790, "t2": "2025-02-26 18:01:00", "y2": 1.0794 },
          "dn":  { "t1": "2025-02-26 18:00:00", "y1": 1.0774, "t2": "2025-02-26 18:01:00", "y2": 1.0778 }
        },
        "swing": {
          "top": { "t1": "2025-02-26 18:00:00", "y1": 1.0792, "t2": "2025-02-26 18:01:00", "y2": 1.0796 },
          "bot": { "t1": "2025-02-26 18:00:00", "y1": 1.0772, "t2": "2025-02-26 18:01:00", "y2": 1.0776 }
        }
      }
    },
    {
      "opentime": "2025-02-26 18:02:00",
      "open": 1.07896,
      "high": 1.07930,
      "low": 1.07840,
      "close": 1.07910,
      "volume": 1010.0,
      "supres": null
    }
  ]
}

Latest Mode

{
  "status": "success",
  "symbol": "EURUSD",
  "timeframe": "M1",
  "latest": true,
  "candle": {
    "opentime": "2025-02-26 18:24:00",
    "open": 1.07875,
    "high": 1.07905,
    "low": 1.07860,
    "close": 1.07898,
    "volume": 980.0,
    "supres": null
  }
}

Examples

Range (for playback)

curl "https://darwintiq.com/api/chart-data?symbol=eurusd&timeframe=M1&begin=2025-02-26%2018:00:00&sort=ASC" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Latest only

curl "https://darwintiq.com/api/chart-data?symbol=eurusd&latest=1" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

With SupRes attached to each bar

curl "https://darwintiq.com/api/chart-data?symbol=eurusd&begin=2025-02-26%2018:00:00&attach_supres=1" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Status Codes

CodeMeaning
200OK
400Missing or invalid parameters
401Missing token
403Invalid token / unauthorized
429Rate limit exceeded (per user & symbol)
500Internal error / upstream failure

Implementation Notes

  • For best playback alignment, pass begin equal to your first bar’s opentime and use sort=ASC.
  • timeframe is currently M1; aggregated TFs may be enabled later without breaking this contract.
  • Timestamps are strings in "YYYY-MM-DD HH:mm:ss" (server UTC or your DB timezone).
  • When plotting lines (regression/swing), ensure strictly increasing times; de-duplicate identical timestamps before rendering.
  • If you proxy through your own Next.js route, forward the bearer token and consider per-user/per-symbol rate-limits as shown in the sample route.ts.