Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
stock-info
Advanced tools
The Stock Info library retrieves current stock information from Yahoo Finance API.
Using npm:
npm install --save stock-info
import si from "stock-info";
// or
const si = require("stock-info");
Retrieves information about a single stock symbol
A string that represents a stock symbol
A Promise that resolves to a stock objects
const si = require("stock-info");
si.getSingleStockInfo("GOOG").then(console.log);
//Prints the stock object to console
Retrieves information about a list of stock symbols
Note: This function will be removed in a future version. Just make your own list of promises using getSingleStockInfo
.
An array of strings where each element is a stock symbol.
A Promise that resolves to an array of stock objects
const si = require("stock-info");
const stocks = ["AMZN", "NFLIX"];
si.getStocksInfo(stocks).then(console.log);
//Prints an array of stock objects to console
The stock object has the following interface:
interface Stock {
maxAge: number;
preMarketChangePercent: NumberWrapper;
preMarketChange: NumberWrapper;
preMarketTime: number;
preMarketPrice: NumberWrapper;
preMarketSource: string;
postMarketChange: UnknownEmptyObject;
postMarketPrice: UnknownEmptyObject;
regularMarketChangePercent: NumberWrapper;
regularMarketChange: NumberWrapper;
regularMarketTime: number;
priceHint: NumberWrapperLongFormat;
regularMarketPrice: NumberWrapper;
regularMarketDayHigh: NumberWrapper;
regularMarketDayLow: NumberWrapper;
regularMarketVolume: NumberWrapperLongFormat;
averageDailyVolume10Day: UnknownEmptyObject;
averageDailyVolume3Month: UnknownEmptyObject;
regularMarketPreviousClose: NumberWrapper;
regularMarketSource: string;
regularMarketOpen: NumberWrapper;
strikePrice: UnknownEmptyObject;
openInterest: UnknownEmptyObject;
exchange: string;
exchangeName: string;
exchangeDataDelayedBy: number;
marketState: string;
quoteType: string;
symbol: string;
underlyingSymbol: null;
shortName: string;
longName: string;
currency: string;
quoteSourceName: string;
currencySymbol: string;
fromCurrency: null;
toCurrency: null;
lastMarket: null;
volume24Hr: UnknownEmptyObject;
volumeAllCurrencies: UnknownEmptyObject;
circulatingSupply: UnknownEmptyObject;
marketCap: NumberWrapperLongFormat;
}
interface UnknownEmptyObject {}
interface NumberWrapperLongFormat {
raw: number;
fmt: string;
longFmt: string;
}
2.0.0 (2023-05-08)
raw
and fmt
FAQs
Module to retrieve stock information from Yahoo Finance API
The npm package stock-info receives a total of 30 weekly downloads. As such, stock-info popularity was classified as not popular.
We found that stock-info demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.