RealMarketAPI
🚀
Docs/Getting Started

Getting Started

Authentication, best practices, timeframes, and supported symbols.

Overview

The Real Market API provides real-time and historical OHLCV (Open, High, Low, Close, Volume) data for Forex, Metals, Crypto, Commodities, and Indices. You can access data via:

REST Base URL

https://api.realmarketapi.com

WebSocket Base URL

wss://api.realmarketapi.com

Authentication

?apiKey=YOUR_KEY
Available endpoints
EndpointTypeDescription
/api/v1/priceREST GETLatest completed OHLCV candle
/api/v1/historyREST GETPaginated historical candles with date range (up to 10 years on Business & Enterprise)
/api/v1/candleREST GETRecent candles, most-recent first
/api/v1/symbolREST GETAll symbols accessible with your key
/api/v1/healthREST GETAPI health status (no auth required)
/priceWebSocketLive candle push stream (Pro/Business)

Authentication

Every request (REST and WebSocket) must include your apiKey as a query parameter. Generate and manage your keys from the dashboard.

🔐
Keep your API key secret. Never expose it in front-end JavaScript that is served publicly, in public repositories, or in client-side code. For browser-based apps, proxy requests through your own back-end server.
Query parameter
NameTypeDescription
apiKey*stringYour secret API key. Pass on every REST and WebSocket request.

Authentication examples

auth.sh
curl "https://api.realmarketapi.com/api/v1/price?apiKey=rm_live_XXXXXXXX&symbolCode=XAUUSD&timeFrame=M1"

Best Practices

Choosing between WebSocket and REST is the most impactful architectural decision for your integration. Use the guide below to pick the right transport for each use case.

Prefer WebSocket for all live price data

A single persistent WebSocket connection delivers every new candle the moment it closes — with zero polling overhead and zero extra rate-limit consumption. If you are polling /api/v1/price on a timer, switch to WebSocket.

WebSocket vs REST — decision guide
Use caseWebSocket ✓REST ✓
Live price ticker / chart✅ Ideal — server pushes every candle⚠️ Works, but wastes quota on polling
Trading signal engine✅ Near-zero latency per candle⚠️ Latency gap between polls
Real-time bid/ask spread✅ Updated with every frame❌ Not suitable
Historical back-fill on startup❌ Not designed for bulk history✅ Use /history with pagination
One-off price snapshot⚠️ Overhead to open a connection✅ Single GET is simpler
Backtesting / research queries❌ Not applicable✅ Use /history with date ranges
Available symbols lookup❌ Not applicable✅ Use GET /api/v1/symbol

❌ Anti-patterns to avoid

  • Polling /api/v1/price on a short timerEvery poll burns a request from your quota and adds HTTP round-trip latency vs a push model.
  • Opening a new WebSocket per requestConnect once per symbol/timeframe pair and keep the connection alive. Repeated open/close cycles exhaust rate limits.
  • No reconnect logic in productionNetworks drop. Always implement exponential back-off reconnection (see WebSocket docs).
  • Using WebSocket to fetch historical dataWebSocket streams live candles only. Use /api/v1/history for past data, then switch to WS for live updates.

✅ Recommended integration pattern

  1. 1.On app start, call /api/v1/history to back-fill the initial candle series.
  2. 2.Open a WebSocket connection per symbol+timeframe pair. Keep connections persistent.
  3. 3.Append each incoming WebSocket frame to your local candle series.
  4. 4.Implement exponential back-off reconnection for transient network failures.
  5. 5.Reserve /api/v1/price only for one-off snapshots or server-side cron jobs.

Timeframes

Pass one of the following values in the timeFrame query parameter. The value is case-sensitive — always uppercase.

M1

1 Minute

Ultra-short-term scalping & HFT

M5

5 Minutes

Short-term scalping & intraday signals

M15

15 Minutes

Intraday trend confirmation & entries

H1

1 Hour

Session-level trend & momentum

H4

4 Hours

Swing setups with reduced noise

D1

1 Day

Higher-timeframe trend & macro direction

Symbol Codes

Pass one of the following values in the symbolCode parameter. All codes are uppercase.

Showing 27 of 27 symbols

Metals2 symbols
XAUUSDGold / US Dollar
XAGUSDSilver / US Dollar
Forex7 symbols
EURUSDEuro / US Dollar
GBPUSDBritish Pound / US Dollar
USDJPYUS Dollar / Yen
GBPJPYBritish Pound / Yen
USDVNDUS Dollar / Vietnamese Dong
AUDUSDAustralian Dollar / US Dollar
USDCADUS Dollar / Canadian Dollar
Crypto3 symbols
BTCUSDBitcoin / US Dollar
ETHUSDEthereum / US Dollar
XRPUSDXRP / US Dollar
Commodities4 symbols
USOILUS Crude Oil (WTI)
UKOILBrent Crude Oil
XNGUSDNatural Gas / US Dollar
XPTUSDPlatinum / US Dollar
Indices2 symbols
US500S&P 500 Index
US30Dow Jones 30 Index
Stocks9 symbols
AAPLApple Inc.
TSLATesla Inc.
NFLXNetflix Inc.
MSFTMicrosoft Corporation
AMZNAmazon.com Inc.
AMDAdvanced Micro Devices Inc.
NVDANVIDIA Corporation
GOOGLAlphabet Inc. (Google)
METAMeta Platforms Inc.
▶️

See all available symbols

Use the Playground to query /api/v1/symbol and see every symbol your API key can access in real-time.

Open Playground