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

stock-info

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stock-info

Node.js module to retrieve stock information from Yahoo Finance API

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

stock-info

The ** Stock Info ** library is exported as a CommonJS module. It retrieves current stock information from Yahoo Finance API.

[TOC]

Installation

Using npm:

$ npm install --save stock-info

Usage

getSingleStockInfo

Retrieves information about a single stock symbol

Input

A string that represents a stock symbol

Output

A Promise that resolves to a stock objects

Example
const si = require('stock-info');
si.getSingleStockInfo('GOOG').then(stock => console.log);
//Outputs the result

getStocksInfo

Retrieves information about a list of stock symbols

Input

An array of strings where each element is a stock symbol.

Output

A Promise that resolves to an array of stock objects

Example
const si = require('stock-info');
const stocks = ['AMZN', 'NFLIX'];
si.getStocksInfo(stocks).then(stocks => console.log);
//Outputs the result

Stock Object

The stock object has the following shape:

{ language: 'en-US', quoteType: 'EQUITY', quoteSourceName: 'Nasdaq Real Time Price', currency: 'USD', regularMarketPrice: 1065.545, regularMarketTime: 1527603620, regularMarketChange: -10.11499, regularMarketOpen: 1064.89, regularMarketDayHigh: 1072.99, regularMarketDayLow: 1065, regularMarketVolume: 322473, trailingPE: 59.210102, epsTrailingTwelveMonths: 17.996, epsForward: 47.32, market: 'us_market', bidSize: 8, askSize: 13, messageBoardId: 'finmb_29096', fullExchangeName: 'NasdaqGS', longName: 'Alphabet Inc.', financialCurrency: 'USD', sharesOutstanding: 348952000, bookValue: 219.496, fiftyDayAverage: 1056.5917, fiftyDayAverageChange: 8.953369, fiftyDayAverageChangePercent: 0.008473821, twoHundredDayAverage: 1071.8778, twoHundredDayAverageChange: -6.3327637, twoHundredDayAverageChangePercent: -0.0059081023, marketCap: 741920931840, forwardPE: 22.517859, priceToBook: 4.854508, sourceInterval: 15, exchangeTimezoneName: 'America/New_York', exchangeTimezoneShortName: 'EDT', gmtOffSetMilliseconds: -14400000, exchangeDataDelayedBy: 0, marketState: 'REGULAR', exchange: 'NMS', priceHint: 2, shortName: 'Alphabet Inc.', regularMarketChangePercent: -0.94035196, regularMarketDayRange: '1065.0 - 1072.99', regularMarketPreviousClose: 1075.66, bid: 1068.35, ask: 1069, averageDailyVolume3Month: 1849285, averageDailyVolume10Day: 957300, fiftyTwoWeekLowChange: 170.75507, fiftyTwoWeekLowChangePercent: 0.19083257, fiftyTwoWeekRange: '894.79 - 1186.89', fiftyTwoWeekHighChange: -121.34497, fiftyTwoWeekHighChangePercent: -0.10223775, fiftyTwoWeekLow: 894.79, fiftyTwoWeekHigh: 1186.89, esgPopulated: false, tradeable: true, symbol: 'GOOG' }

Keywords

FAQs

Package last updated on 29 May 2018

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