Skip to content
RealMarketAPI

real time stock screener websocket api

Build a Real-Time Stock and Forex Screener with WebSocket API

Screen stocks, Forex pairs, and crypto simultaneously using WebSocket multi-symbol streams and server-side filter logic.

Summary

Maintain a live-updating screener that filters symbols by price movement or volatility thresholds using persistent WebSocket connections.

Runnable example

WebSocket screener with move threshold. Replace YOUR_KEY with your API key.

WebSocket screener with move threshold
const ws = new WebSocket(
  "wss://api.realmarketapi.com/price?symbolCode=AAPL&timeFrame=M1&apiKey=YOUR_KEY"
);

const THRESHOLD = 0.5; // % move
ws.onmessage = (e) => {
  const { ClosePrice, OpenPrice, SymbolCode } = JSON.parse(e.data);
  const pct = ((ClosePrice - OpenPrice) / OpenPrice) * 100;
  if (Math.abs(pct) >= THRESHOLD) {
    console.log(`Screener hit: ${SymbolCode} moved ${pct.toFixed(2)}%`);
  }
};

Production notes

  • 01Open one WebSocket connection per symbol to avoid cross-symbol message interleaving.
  • 02Apply screener filters server-side before pushing results to clients to reduce payload size.
  • 03Debounce screener re-evaluation to one pass per completed candle, not every tick.

How it works, step by step

Where each step happens, from the price data to the people using what you build.

How you can make money from it

Common business models for this kind of product. Commercial use is allowed on every RealMarketAPI plan, including Free.

  • Premium screener

    Keep basic filters free and sell advanced filters, more symbols and saved screens.

  • Signals newsletter

    Sell the screener's daily findings and your commentary as a newsletter.

  • Embedded screener for sites

    License the screener as a component to trading blogs and education platforms.

  • Sell insights, not the feed

    Charge for your screens, rankings and analysis. Reselling the raw price feed itself is not allowed.

You can build and sell products on any plan; what you cannot do is resell or redistribute the raw price feed itself (see the terms). Building for other developers? The affiliate program pays 25% recurring commission on the paid plans you refer.

Run this example with your own key

Create a free account, then try the request in the playground before wiring it into production.