GithubHelp home page GithubHelp logo

lcsouzamenezes / yahoo-node-streamer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markosole/yahoo-node-streamer

0.0 0.0 0.0 41 KB

Yahoo finance NodeJS Price Quote Live Streaming - using websocket to collect recent updates

JavaScript 100.00%

yahoo-node-streamer's Introduction

yahoo-node-streamer - Yahoo Live Quotes

Yahoo finance NodeJS Price Quote Live Streaming - using websocket to collect recent updates

App is establishing connection to Yahoo Websocket with subscribe command and listens for responses in real time. Yahoo is using protobuf to encode data and we are using protobufjs to decode those messages. Crucial file is PricingData.proto which is used as descriptin for protobufjs.

Install

Clone project and cd into project folder, than run:

npm install

Run it

node index.js

Configuration

For example, app will subscribe to AMC and TSLA symbols. Check config and extend the list wit symbols you need:

// Extend this list by adding more symbols ["AMC", "TSLA"]
connection.send('{"subscribe":["AMC", "TSLA"]}')

Received messages - decoded example

App will generate object with all data described in .proto file:

*** Console log output ***

All data set:  {
  id: 'TSLA',
  price: 600.9299926757812,
  time: Long { low: -2101540592, high: 376, unsigned: false },
  currency: '',
  exchange: 'NMS',
  quoteType: 8,
  marketHours: 0,
  changePercent: -1.6947742700576782,
  dayVolume: Long { low: 0, high: 0, unsigned: false },
  dayHigh: 0,
  dayLow: 0,
  change: -10.3599853515625,
  shortName: '',
  expireDate: Long { low: 0, high: 0, unsigned: false },
  openPrice: 0,
  previousClose: 0,
  strikePrice: 0,
  underlyingSymbol: '',
  openInterest: Long { low: 0, high: 0, unsigned: false },
  optionsType: 0,
  miniOption: Long { low: 0, high: 0, unsigned: false },
  lastSize: Long { low: 0, high: 0, unsigned: false },
  bid: 0,
  bidSize: Long { low: 0, high: 0, unsigned: false },
  ask: 0,
  askSize: Long { low: 0, high: 0, unsigned: false },
  priceHint: Long { low: 2, high: 0, unsigned: false },
  vol_24hr: Long { low: 0, high: 0, unsigned: false },
  volAllCurrencies: Long { low: 0, high: 0, unsigned: false },
  fromcurrency: '',
  lastMarket: '',
  circulatingSupply: 0,
  marketcap: 0
}
Decoded message TSLA with price: 600.9299926757812

Extras

Socket.io package will be installed and app can use it to connect with another Socket.IO server where decoded data will be sent. That server can be used to distribute messages generated by this app (decoder worker) and used in different apps: React web app, display data on your website etc.

This feature is disabled by default and can be enabled in:

// Line 18
var useSocket = false;

Remember to configure connection to socket server before enabling it.

Notes

App does not provide any historycal data. It is used for live streaming only. App does not require any subscription to Yahoo services and no accounts are used. Yahoo does not limit or block any connections (at the moment) to their Websocket server.

To do (in progress and BETA at the moment)

Electron Desktop application for controlling subscribers list and UI

Requests

If you have any requests for new features, open issues tab and drop it there.

yahoo-node-streamer's People

Contributors

glaucoheitor avatar markosole avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.