RealMarketAPI
📖
Docs/Reference

API Reference

OHLCV fields, HTTP error codes, and structured exception codes.

OHLCV Response Fields

All candle objects from /price, /history, /candle, and WebSocket frames share the same JSON shape.

FieldTypeRESTWSDescription
SymbolCodestringMarket symbol identifier, e.g. XAUUSD.
OpenPricenumberPrice at the start of the candle period.
ClosePricenumberPrice at the end of the candle period.
HighPricenumberHighest traded price within the candle.
LowPricenumberLowest traded price within the candle.
BidnumberBest bid price at candle close.
AsknumberBest ask price at candle close.
VolumenumberTraded volume during the candle period.
OpenTimeISO 8601UTC timestamp marking the candle open.

Paginated endpoints (/history, /candle) additionally return:

FieldTypeDescription
DataarrayOrdered list of candle objects.
TotalCountintegerTotal number of candles available.
CurrentPageintegerCurrent page number (1-based). /history only.
TotalPagesintegerTotal pages at current pageSize. /history only.
PageSizeintegerNumber of candles on this page. /history only.

HTTP Error Codes

All errors return a JSON body with a consistent StatusCode, Message, and an Errors[] array with per-field detail.

CodeStatusWhen it happens
400Bad RequestMissing or invalid query parameters.
401UnauthorizedAPI key missing or malformed.
403ForbiddenAPI key does not have access to this symbol or endpoint.
404Not FoundRequested data does not exist.
429Too Many RequestsRate limit exceeded for your plan.
500Internal Server ErrorUnexpected server error — please retry.

Error response shape

error.json
{
  "StatusCode": 400,
  "Message": "Validation failed for query parameters.",
  "Errors": [
    {
      "PropertyName":  "timeFrame",
      "ErrorCode":     "ERR_0007_INVALID_TIME_FRAME",
      "ErrorMessage":  "timeFrame must be one of M1, M5, M15, H1, H4, D1"
    },
    {
      "PropertyName":  "symbolCode",
      "ErrorCode":     "ERR_0008_SYMBOL_NOT_SUPPORTED",
      "ErrorMessage":  "symbolCode BTCUSDT is not supported"
    }
  ],
  "TraceId": "00-7a8ab3af4fce34f3872a28ec7ca8f5e1-886d2e1bc76dc9a4-00"
}
💡
Recommended error-handling pattern: Check StatusCode, then iterate Errors[] and key on ErrorCode (a stable string identifier) rather than ErrorMessage (human text that may change). Use TraceId when reporting issues to support.

Exception Codes

Each error in the Errors[] array contains a structured ErrorCode string. Use these for programmatic error branching.

HTTPError CodeDescription
404ERR_0001_DATA_NOT_FOUNDNo candle data found for the requested symbol and timeframe. The market may be closed or data is unavailable for the given period.
401ERR_0005_INVALID_API_KEYThe provided API key is missing, malformed, revoked, or does not match any active key.
400ERR_0006_INVALID_TIME_RANGEstartTime or endTime is missing, in wrong format, out of chronological order, or exceeds the maximum allowed range for your plan.
400ERR_0007_INVALID_TIME_FRAMEtimeFrame is not one of the supported values: M1, M5, M15, H1, H4, D1.
403ERR_0008_SYMBOL_NOT_SUPPORTEDThe symbolCode is not supported on your plan or does not exist.
403ERR_0009_NOT_SUPPORT_WEBSOCKETYour plan does not include WebSocket access. Upgrade to Pro or Business.
403ERR_0010_NOT_SUPPORT_HISTORICALYour plan does not include historical data. Upgrade your plan to query historical candles.
403ERR_0012_EMAIL_NOT_VERIFIEDYour email has not been verified. Verify from the dashboard before making API requests.