All Projects → gadicc → node-yahoo-finance2

gadicc / node-yahoo-finance2

Licence: MIT license
Unofficial API for Yahoo Finance

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to node-yahoo-finance2

yahoo-historical
Downloads historical EOD (end of day) prices from yahoo finance
Stars: ✭ 96 (-38.06%)
Mutual labels:  finance, yahoo, yahoo-finance
yfMongo
MongoDb tool to store stock Yahoo Finance market data in a consistent way
Stars: ✭ 32 (-79.35%)
Mutual labels:  finance, yahoo-finance
stock-market-scraper
Scraps historical stock market data from Yahoo Finance (https://finance.yahoo.com/)
Stars: ✭ 110 (-29.03%)
Mutual labels:  finance, yahoo-finance
AIPortfolio
Use AI to generate a optimized stock portfolio
Stars: ✭ 28 (-81.94%)
Mutual labels:  finance, yahoo
Awesome Quant
A curated list of insanely awesome libraries, packages and resources for Quants (Quantitative Finance)
Stars: ✭ 8,205 (+5193.55%)
Mutual labels:  finance, yahoo-finance
brapi
API ilimitada da Bovespa, moedas e crypto. Ganhe acesso aos dados de qualquer ação, moeda ou criptomoeda
Stars: ✭ 36 (-76.77%)
Mutual labels:  finance, yahoo-finance
Stocksera
Web application that provides alternative data to retail investors
Stars: ✭ 426 (+174.84%)
Mutual labels:  finance, yahoo-finance
SwiftYFinance
The best Yahoo Finance library with the power of Swift
Stars: ✭ 30 (-80.65%)
Mutual labels:  yahoo, yahoo-finance
cap-table-tool
Cap Table and Exit Waterfall Tool, https://foresight.is/cap-table
Stars: ✭ 22 (-85.81%)
Mutual labels:  finance
yoc
command line tool for scraping financial options prices and related data from finance.yahoo.com
Stars: ✭ 23 (-85.16%)
Mutual labels:  yahoo-finance
optlib
A library for financial options pricing written in Python.
Stars: ✭ 166 (+7.1%)
Mutual labels:  finance
techindicators
Python functions and an associated Jupyter notebook for technical analysis of stock price data. Numpy is used for calculating technical indicators. Matplotlib and mpl_finance are used for plotting data.
Stars: ✭ 31 (-80%)
Mutual labels:  finance
pybacen
This library was developed for economic analysis in the Brazilian scenario (Investments, micro and macroeconomic indicators)
Stars: ✭ 40 (-74.19%)
Mutual labels:  finance
futu algo
Futu Algorithmic Trading Solution (Python) 基於富途OpenAPI所開發量化交易程序
Stars: ✭ 143 (-7.74%)
Mutual labels:  finance
MLiFC
Course Material for the machine learning in financial context bootcamp
Stars: ✭ 102 (-34.19%)
Mutual labels:  finance
stockholm
💵 Modern Python library for working with money and monetary amounts. Human friendly and flexible approach for development. 100% test coverage + built-in support for GraphQL and Protocol Buffers transports using current best-practices.
Stars: ✭ 26 (-83.23%)
Mutual labels:  finance
fin
finance
Stars: ✭ 38 (-75.48%)
Mutual labels:  finance
financisto
Financisto - open-source personal finance tracker for Android
Stars: ✭ 116 (-25.16%)
Mutual labels:  finance
knut
knut is an efficient plain text accounting tool with support for multiple currencies and valuation.
Stars: ✭ 40 (-74.19%)
Mutual labels:  finance
ark-invest-api
📈 API for tracking holdings and trades of ARK Invest funds
Stars: ✭ 49 (-68.39%)
Mutual labels:  finance

node-yahoo-finance2

Community API for Yahoo-Finance.

Copyright (c) 2021 by Gadi Cohen and Pilwon Huh. MIT licensed.

npm CircleCI coverage semantic-release TypeScript MIT License

Supports Node 12.0.0 and up (tests are run against 12.0.0).

Stable release - supersedes the ubiquitous node-yahoo-finance v1. NB: The API has changed, see UPGRADING for more information.

Live Demo on CodeSandbox

Unofficial API

This project is neither created nor endorsed by Yahoo Inc. Yahoo does not provide any official API to developers, nor makes any guarantees regarding service availability or API consistency. In practice however, the open source community has kept this project (and it's predecessor) working well since 2013.

Nevertheless, we make no guarantees and you use this package at your own risk. The developers (and obviously Yahoo) cannot be held responsible for any losses you may incur as a result of using this service. Use of this package is considered acknowledgement and acceptance of these terms and of it's license.

Quickstart

CLI (Command line interface)

$ npx yahoo-finance2 search AAPL

# or install it
$ npm install -g yahoo-finance2
$ yahoo-finance search AAPL '{ "someOption": true }'

Importing

// import syntax (recommended)
import yahooFinance from 'yahoo-finance2';

// require syntax (if your code base does not support imports)
const yahooFinance = require('yahoo-finance2').default; // NOTE the .default

const results = await yahooFinance.search('AAPL');
const results = await yahooFinance.search('AAPL', { someOption: true, etc });

Available modules: autoc, chart, historical, quote, quoteSummary (submodules: assetProfile, balanceSheetHistory, balanceSheetHistoryQuarterly, calendarEvents, cashflowStatementHistory, cashflowStatementHistoryQuarterly, defaultKeyStatistics, earnings, earningsHistory, earningsTrend, financialData, fundOwnership, fundPerformance, fundProfile, incomeStatementHistory, incomeStatementHistoryQuarterly, indexTrend, industryTrend, insiderHolders insiderTransactions, institutionOwnership, majorDirectHolders, majorHoldersBreakdown, netSharePurchaseActivity, price, quoteType, recommendationTrend, secFilings, sectorTrend, summaryDetail, summaryProfile, symbol, topHoldings, upgradeDowngradeHistory), search, recommendationsBySymbol, trendingSymbols, options, insights, with more coming soon.

Extras: quoteCombine. Utils: setGlobalConfig.

See the Full Documentation.

Particularly, make sure to read the notes there on ERROR HANDLING. Be aware that if a stock gets delisted, Yahoo removes all related data, including historical (and chart) data from periods before the delisting occurred (i.e. queries that worked before will start failing, and there is no way to retrieve this data again).

Even Quicker Start - Stock Price

const quote = await yahooFinance.quote('AAPL');
const { regularMarketPrice as price, currency } = quote;

NB: CommonJS / ES modules

This package is shipped as both an ES Module and a CommonJS module. Node will automatically load the ES module if:

  • Your package.json contains a { type: module } entry
  • You're running at least Node 12 (maybe with --experimental-module flag).
  • You import the module (require function does not exist in ES modules)

otherwise the traditional CommonJS module will be loaded. No flags are necessary for Node 12.7.0+ and Node 13.2.0+, but for older versions, you need to add the --experimental-module flag).

ES Modules are "relatively" new. They got a big boost in April 2021 when Node 10, which did not support them, reached end-of-life. However, support varies by build tool and configuration, and there are some edge cases which can be tricky. Please open an issue if you run into any trouble.

require (CommonJS)

If you use load the library with require, make sure to add .default:

const yahooFinance = require('yahoo-finance2').default; // NOTE the .default

(Optional) TypeScript Love

Working with yahoo-finance2 is a joy if you're using TypeScript (but you don't have to), with type checking and auto completion:

Types Animation

Try it yourself on our Live CodeSandbox.

Using in the Browser (TL;DR; possible but unsupported)

This project is primarily developed to be used server-side in node. Nevertheless, due to the large number on requests on this issue, we have taken care to ensure the package can be imported in the browser too.

HOWEVER: you'll run into other challenges there that we can't help you with, particularly CORS issues when trying to query Yahoo's servers in the browser from non-Yahoo origins. Since Yahoo is specifically blocking such requests, we will not help you bypass them. (One way around this is to run your own server to proxy your requests, but we won't help you with this).

Contributing

Pull Requests welcome! Read CONTRIBUTING.md and join our list of heroes:

contributor-faces

Special mention goes out to pudgereyem and PythonCreator27 who made significant contributions in the very early days of this project.

Credits

  • Massive thanks to @pilwon for the original node-yahoo-finance and for all our prior collaborations on this and other projects 🙏
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].