Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
adwulfran committed Jan 28, 2022
1 parent 295892e commit 341b723
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ The following markets are available at the moment :

## Installing

Download rtf binaries : https://github.com/Real-time-finance/finance-websocket-API/releases
Unix, macos and windows binaries available.

## Usage example

Use market name and stock symbol to receive datas. In this example we get quotations from Netflix (nasdaq) :
```shell
./rtf add --market="NASDAQ" --stock="NFLX"
```
npm install ws
Another example to get quotations from Goldman Sachs (nyse) :
```shell
./rtf add --market="NYSE" --stock="GS"
```

## Usage example
## Output 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)
```javascript
const WebSocket = require('ws');
const ws = new WebSocket("wss://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);
});
```
{
price: 386.70,
volume: 665805,
time: 1643359743,
symbol: 'NFLX',
market: 'NASDAQ'
}
```

# Available for stocks and forex
Expand Down

0 comments on commit 341b723

Please sign in to comment.