Get candle history
GET/v1/market-data/accounts/:account_id/candles
Returns historical candles for the selected instrument and timeframe.
Note: Candle history is available for:
- ask
- bid
- both ask and bid
Rules:
- 'from' is required
- use either:
- from + count
- or from + to
- 'from' must be earlier than
to - 'count' is bidirectional and its absolute value must not exceed the configured candle limit
- if 'to' is used, the requested range must not exceed the configured candle limit
- retrieve the current limit from
GET /v1/configuration/accounts/{account_id}/limits - returned candles are sorted in ascending time order, from older to newer
Time range semantics:
fromis inclusivetois exclusive- A candle is included if its open time is greater than or equal to
fromand strictly less thanto - Example: for H1 candles,
from=12:00,to=13:00returns the candle with open time12:00, not a separate13:00candle.
Historical data availability depends on timeframe:
- S1 → 1 day
- S5 → 5 days
- S15 → 15 days
- M1, M3 → 1 year
- M5, M10 → 2 years
- M15, M30 → 3 years
- H1+ → full available history
Possible public error codes include:
REQUEST_INVALID_PARAMETERSREQUEST_INVALID_TIMEFRAMEREQUEST_INVALID_TIME_RANGEREQUEST_INVALID_COUNTREQUEST_INVALID_PRICE_TYPEMARKET_INSTRUMENT_NOT_FOUNDMARKET_NO_QUOTES
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 429
- 500
- 503
Candle history returned successfully
Bad Request.
Possible public error codes include:
REQUEST_INVALIDREQUEST_INVALID_PARAMETERSREQUEST_INVALID_PRICEREQUEST_INVALID_TIMEFRAMEREQUEST_INVALID_TIME_RANGEREQUEST_INVALID_COUNTREQUEST_INVALID_LIMITREQUEST_INVALID_CURSORREQUEST_INVALID_PRICE_TYPEREQUEST_INVALID_FILTER_COMBINATIONREQUEST_UNSUPPORTED_MEDIA_TYPE
Authentication failed.
Possible public error codes include:
AUTH_INVALID_API_KEYAUTH_INVALID_SIGNATURE
Operation is not permitted for the authenticated API key, account, source IP, or operation scope.
Possible public error codes include:
AUTH_PERMISSION_DENIEDACCOUNT_DISABLEDACCOUNT_CLOSE_ONLY
Account not found
Public API endpoint quota exceeded.
REQUEST_RATE_LIMIT is non-retryable automatically. Clients should use
GET /v1/configuration/accounts/{account_id}/limits and local request accounting
to calculate remaining quota before sending more requests.
Internal Server Error
The server encountered an unexpected condition that prevented it from fulfilling the request.
Service temporarily unavailable.
Possible public error codes include:
SYSTEM_TEMPORARY_UNAVAILABLEMARKET_NO_QUOTES