Skip to content

Real-time-finance/finance-websocket-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Real Time Finance : a Financial WebSocket public API

Real Time Finance is a simple websocket public API to get real-time stock prices. The following markets are available at the moment :

  • Forex
  • US and European stocks companies (around 10K stocks)

Get started

Installing

npm install ws

Usage example

Use stock symbol to receive datas. In this example we use EURUSD (forex), GBPUSD (forex), AAPL (apple - nasdaq), MSFT (microsoft - nasdaq) and MC.PA (lvmh - cac40)

const WebSocket = require('ws');
const ws = new WebSocket("wss:https://api.realtimefinance.io", {
  rejectUnauthorized: false // use only if you are behind a firewall
});

const message = {
  event: "subscribe",
  data: ['EURUSD','GBPUSD','AAPL','MSFT','MC.PA']
};
ws.on("open", function open() {
  ws.send(JSON.stringify(message));
});

ws.on("message", function incoming(data) {
  console.log(data);
});

Available for stocks and forex

Here after you can find JSON list with symbols :

Further infos: https://realtimefinance.io