Fugle Realtime API client library for Node.js
$ npm install --save @fugle/realtime
The library is an isomorphic JavaScript client that supports HTTP API and WebSocket.
import { HttpClient } from '@fugle/realtime';
const client = new HttpClient({ apiToken: 'demo' });
client.intraday.meta({ symbolId: '2884' })
.then(data => console.log(data));
client.intraday.quote({ symbolId: '2884' })
.then(data => console.log(data));
client.intraday.chart({ symbolId: '2884' })
.then(data => console.log(data));
client.intraday.dealts({ symbolId: '2884', limit: 50 })
.then(data => console.log(data));
client.intraday.volumes({ symbolId: '2884' })
.then(data => console.log(data));
client.historical.candles({ symbolId: '2884', from: '2022-02-07', to: '2022-02-11' })
.then(data => console.log(data));
import { WebSocketClient } from '@fugle/realtime';
const client = new WebSocketClient({ apiToken: 'demo' });
client.intraday.meta({ symbolId: '2884' })
.onmessage = message => console.log(JSON.parse(message.data));
client.intraday.quote({ symbolId: '2884' })
.onmessage = message => console.log(JSON.parse(message.data));
client.intraday.chart({ symbolId: '2884' })
.onmessage = message => console.log(JSON.parse(message.data));