[DEPRECATED] Fugle API client library for JavaScript
This package is deprecated. Please use @fugle/realtime instead.
$ npm install --save fugleAdd a <script> to your index.html:
<script src="/node_modules/fugle/dist/fugle.min.js"></script>Import the module to your *.js file:
const Fugle = require('fugle')The library support for REST API and WebSocket.
const fugle = new Fugle({ apiToken: 'demo' })
fugle
.api('/intraday/quote', { symbolId: '2884' })
.then(res => console.log(res.data))Intraday odd lot trading:
fugle
.api('/intraday/quote', { symbolId: '2884', oddLot: true })
.then(res => console.log(res.data))const fugle = new Fugle({ apiToken: 'demo' })
fugle
.ws('/intraday/quote', { symbolId: '2884' })
.onmessage = message => console.log(message.data)