WebSocket price feed

One WebSocket connection streams ticks for the symbols you subscribe to, as the broker’s MT5 server publishes them.

  • Subscribe and unsubscribe by symbol at any time
  • Each tick carries bid, ask and broker-server time
  • Connection limits per plan, shown below

Subscribe to three symbols

// Server-side: keep the key out of browser code.
const ws = new WebSocket('wss://pricefeedpro.com/ws/v1/stream?api_key=' + process.env.PFP_API_KEY);
ws.onopen = () => ws.send(JSON.stringify({ action: 'subscribe', symbols: ["EURUSD","XAUUSD","BTCUSD"] }));
ws.onmessage = (e) => {
  const msg = JSON.parse(e.data);
  if (msg.type === 'tick') console.log(msg.symbol, msg.bid, msg.ask, msg.time);
};

Plan limits (live from the API)

PlanPrice / monthSymbolsRequests / minWebSocket connections
freeFree3605
basic$29.99206020
pro$99.9910030050
enterprise$299.99Unlimited9,999100

Source: a broker’s live MT5 server. Prices are broker quotes, not an exchange consolidated feed.