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.comWebSocket Base URL
wss://api.realmarketapi.comAuthentication
?apiKey=YOUR_KEY| Endpoint | Type | Description |
|---|---|---|
/api/v1/price | REST GET | Latest completed OHLCV candle |
/api/v1/history | REST GET | Paginated historical candles with date range (up to 10 years on Business & Enterprise) |
/api/v1/candle | REST GET | Recent candles, most-recent first |
/api/v1/symbol | REST GET | All symbols accessible with your key |
/api/v1/health | REST GET | API health status (no auth required) |
/price | WebSocket | Live 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.
| Name | Type | Description |
|---|---|---|
| apiKey* | string | Your secret API key. Pass on every REST and WebSocket request. |
Authentication examples
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.
| Use case | WebSocket â | 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 timer â Every poll burns a request from your quota and adds HTTP round-trip latency vs a push model.
- âąOpening a new WebSocket per request â Connect once per symbol/timeframe pair and keep the connection alive. Repeated open/close cycles exhaust rate limits.
- âąNo reconnect logic in production â Networks drop. Always implement exponential back-off reconnection (see WebSocket docs).
- âąUsing WebSocket to fetch historical data â WebSocket streams live candles only. Use /api/v1/history for past data, then switch to WS for live updates.
â Recommended integration pattern
- 1.
On app start, call /api/v1/history to back-fill the initial candle series. - 2.
Open a WebSocket connection per symbol+timeframe pair. Keep connections persistent. - 3.
Append each incoming WebSocket frame to your local candle series. - 4.
Implement exponential back-off reconnection for transient network failures. - 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.
M11 Minute
Ultra-short-term scalping & HFT
M55 Minutes
Short-term scalping & intraday signals
M1515 Minutes
Intraday trend confirmation & entries
H11 Hour
Session-level trend & momentum
H44 Hours
Swing setups with reduced noise
D11 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
XAUUSDGold / US DollarXAGUSDSilver / US DollarEURUSDEuro / US DollarGBPUSDBritish Pound / US DollarUSDJPYUS Dollar / YenGBPJPYBritish Pound / YenUSDVNDUS Dollar / Vietnamese DongAUDUSDAustralian Dollar / US DollarUSDCADUS Dollar / Canadian DollarBTCUSDBitcoin / US DollarETHUSDEthereum / US DollarXRPUSDXRP / US DollarUSOILUS Crude Oil (WTI)UKOILBrent Crude OilXNGUSDNatural Gas / US DollarXPTUSDPlatinum / US DollarUS500S&P 500 IndexUS30Dow Jones 30 IndexAAPLApple Inc.TSLATesla Inc.NFLXNetflix Inc.MSFTMicrosoft CorporationAMZNAmazon.com Inc.AMDAdvanced Micro Devices Inc.NVDANVIDIA CorporationGOOGLAlphabet 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.