πŸŽ‰ Our Chrome Extension is here! Get live market prices right in your browser.Install Now
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 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. 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 61 of 61 symbols

Metals2 symbols
XAUUSDGold / US Dollar
XAGUSDSilver / US Dollar
Forex12 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
NZDUSDNew Zealand Dollar / US Dollar
USDHKDUS Dollar / Hong Kong Dollar
USDMXNUS Dollar / Mexican Peso
USDSGDUS Dollar / Singapore Dollar
DXYUS Dollar Index
Crypto9 symbols
BTCUSDBitcoin / US Dollar
ETHUSDEthereum / US Dollar
XRPUSDXRP / US Dollar
BNBUSDBinance Coin / US Dollar
SOLUSDSolana / US Dollar
DOGEUSDDogecoin / US Dollar
CAKEUSDPancakeSwap / US Dollar
ADAUSDCardano / US Dollar
LINKUSDChainlink / US Dollar
Commodities5 symbols
USOILUS Crude Oil (WTI)
UKOILBrent Crude Oil
XNGUSDNatural Gas / US Dollar
XPTUSDPlatinum / US Dollar
XCUUSDCopper / US Dollar
Indices11 symbols
US500S&P 500 Index
US30Dow Jones 30 Index
UK100FTSE 100 Index
DE30DAX 30 Index
FR40CAC 40 Index
USTECUS Tech 100 (Nasdaq)
AUS200Australia 200 Index
IN50India 50 Index (Nifty)
HK50Hang Seng 50 Index
JP225Nikkei 225 Index
STOXX50Euro Stoxx 50 Index
Stocks22 symbols
AAPLApple Inc.
TSLATesla Inc.
NFLXNetflix Inc.
MSFTMicrosoft Corporation
AMZNAmazon.com Inc.
AMDAdvanced Micro Devices Inc.
NVDANVIDIA Corporation
GOOGLAlphabet Inc. (Google)
METAMeta Platforms Inc.
BABoeing Co.
ATVIActivision Blizzard Inc.
AVGOBroadcom Inc.
INTCIntel Corporation
IBMIBM Corporation
ADBEAdobe Inc.
ABTAbbott Laboratories
BABAAlibaba Group
BACBank of America Corp.
EBAYeBay Inc.
EAElectronic Arts Inc.
NKENike Inc.
TMETencent Music Entertainment
▢️

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
Feedback