The library handles fetching, parsing, and cleaning of CSV data and returns JSON result that is convenient and easy to work with. Both callback (last parameter) and promises (using Bluebird) styles are supported.
Also check out google-finance.
$ npm install yahoo-finance
var yahooFinance = ;yahooFinance;yahooFinance;
a: Askb: Bidb2: Ask (Realtime)b3: Bid (Realtime)p: Previous Closeo: Open
y: Dividend Yieldd: Dividend Per Sharer1: Dividend Pay Dateq: Ex-Dividend Date
c1: Changec: Change And Percent Changec6: Change (Realtime)k2: Change Percent (Realtime)p2: Change in Percentd1: Last Trade Dated2: Trade Datet1: Last Trade Time
c8: After Hours Change (Realtime)c3: Commissiong: Day’s Lowh: Day’s Highk1: Last Trade (Realtime) With Timel: Last Trade (With Time)l1: Last Trade (Price Only)t8: 1 yr Target Pricem5: Change From 200-day Moving Averagem6: Percent Change From 200-day Moving Averagem7: Change From 50-day Moving Averagem8: Percent Change From 50-day Moving Averagem3: 50-day Moving Averagem4: 200-day Moving Average
w1: Day’s Value Changew4: Day’s Value Change (Realtime)p1: Price Paidm: Day’s Rangem2: Day’s Range (Realtime)g1: Holdings Gain Percentg3: Annualized Gaing4: Holdings Gaing5: Holdings Gain Percent (Realtime)g6: Holdings Gain (Realtime)
k: 52-week Highj: 52-week Lowj5: Change From 52-week Lowk4: Change From 52-week Highj6: Percent Change From 52-week Lowk5: Percebt Change From 52-week Highw: 52-week Range
i: More Infoj1: Market Capitalizationj3: Market Cap (Realtime)f6: Float Sharesn: Namen4: Notess1: Shares Ownedx: Stock Exchangej2: Shares Outstanding
v: Volumea5: Ask Sizeb6: Bid Sizek3: Last Trade Sizea2: Average Daily Volume
e: Earnings Per Sharee7: EPS Estimate Current Yeare8: EPS Estimate Next Yeare9: EPS Estimate Next Quarterb4: Book Valuej4: EBITDAp5: Price per Salesp6: Price per Bookr: PE Ratior2: PE Ratio (Realtime)r5: PEG Ratior6: Price Per EPS Estimate Current Yearr7: Price Per EPS Estimate Next Years7: Short Ratio
t7: Ticker Trendt6: Trade Linksi5: Order Book (Realtime)l2: High Limitl3: Low Limitv1: Holdings Valuev7: Holdings Value (Realtime)s6: Revenuee1: Error Indication (returned for symbol changed or invalid)
Optionally request options (such as a proxy) can be specified by inserting an extra parameter just before the callback:
var httpRequestOptions =proxy: '';yahooFinance;yahooFinance;
See the contributors.
The MIT License (MIT) Copyright (c) 2013-2016 Pilwon Huh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.