Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fugle/marketdata

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fugle/marketdata

Fugle MarketData API client library for Node.js

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
228
increased by42.5%
Maintainers
0
Weekly downloads
 
Created
Source

Fugle MarketData

NPM version Build Status Coverage Status

Fugle MarketData API client library for Node.js

Installation

$ npm install --save @fugle/marketdata

Importing

// Using Node.js `require()`
const { RestClient, WebSocketClient } = require('@fugle/marketdata');

// Using ES6 imports
import { RestClient, WebSocketClient } from '@fugle/marketdata';

Usage

The library is an isomorphic JavaScript client that supports REST API and WebSocket.

REST API

const client = new RestClient({ apiKey: 'YOUR_API_KEY' });

const stock = client.stock;   // Stock REST API client
const futopt = client.futopt; // Futures & Options REST API client

stock.intraday.quote({ symbol: '2330' })
  .then(data => console.log(data));

WebSocket API

const client = new WebSocketClient({ apiKey: 'YOUR_API_KEY' });

const stock = client.stock;   // Stock WebSocket API client
const futopt = client.futopt; // Futures & Options WebSocket API client

// open the WebSocket connection and authenticate
stock.connect().then(() => {
  // subscribe the channel to receive streaming data
  stock.subscribe({ channel: 'trades', symbol: '2330' });
});

stock.on('message', (message) => {
  const data = JSON.parse(message);
  console.log(data);
});

License

MIT

Keywords

FAQs

Package last updated on 23 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc