Developer Portal

OHLCV BarsGET

Returns historical OHLCV bars for the specified symbol and timeframe

View as Markdown
GET
/history/bars

Authorization

AuthorizationRequiredBearer <token>

JWT token obtained from the login endpoint

In: header

Query Parameters

sidRequiredstring

Symbol ID to fetch bars for

timeframeRequiredstring

Bar timeframe/resolution

Value in: "1M" | "2M" | "3M" | "5M" | "15M" | "30M" | "1H" | "4H" | "12H" | "D" | "W" | "M"
frominteger

Start timestamp (Unix time in seconds). Either 'from' or 'count' must be provided.

Format: "int64"
toRequiredinteger

End timestamp (Unix time in seconds)

Format: "int64"
countinteger

Maximum number of bars to return. Either 'from' or 'count' must be provided.

Minimum: 1Format: "int64"
curl -X GET "http://localhost:8081/api/v1/history/bars?sid=EURUSD&timeframe=1H&from=1609459200&to=1640995200&count=100" \
  -H "Authorization: Bearer <token>"

Successfully retrieved bars

{
  "bars": [
    {
      "open": 1.1234,
      "high": 1.1256,
      "low": 1.122,
      "close": 1.1245,
      "volume": 1000,
      "datetime": "2023-01-01T12:00:00Z"
    }
  ]
}