BLOG

Behind the numbers.

Code examples, market analysis, and data quality deep-dives.

Which Trading Day of the Month Pays Best? Turn-of-the-Month Analysis in Python
Can You Use Yahoo Finance Data Commercially?
How Many Independent Bets Does a Nine-Sector Portfolio Give You? Eigenvalue Analysis in Python
Which Volatility Forecast Wins One Month Ahead? HAR vs EWMA in Python
How Concentrated Are Institutional Equity Portfolios? Form 13F Concentration Analysis in Python
Do Stocks Earn Their Returns Overnight or Intraday? Return Decomposition in Python
When Do Corporate Insiders Actually Trade? Form 4 Timing Analysis in Python
Data Requirements for Backtesting a Trading Strategy
What Is Survivorship Bias in Backtesting?
Do High Dividend Yields Come From Bigger Payouts or Falling Prices? Yield Decomposition in Python
Do Stocks Fall Harder Than They Rise? Downside Beta vs Upside Beta in Python
Does Volatility Targeting Improve Sharpe Ratios? Seven-Asset Backtest in Python
Free Stock Market Data APIs: What You Actually Get
How to Give an LLM Financial Data With an MCP Server
Does Post-Earnings Announcement Drift Survive Real Filing Dates? PEAD Event Study in Python
Do Insider Buying Clusters Predict Returns? Signal Testing in Python
Does the S&P 500 Index Effect Still Exist? Event Study in Python
Are Companies Leaving the S&P 500 Faster Than They Used To? Index Survival Analysis in Python
Does Gross Profitability Predict Stock Returns? Quintile Factor Test in Python
What Growth Rate Is the Market Pricing In? Reverse DCF in Python
Does a Strong Balance Sheet Cushion Drawdowns? Leverage and Downside Risk in Python
Does Ticker Recycling Corrupt a Mean-Reversion Backtest? Entity-Resolved Z-Scores in Python
How Much of a Growth Screen's Backtested Edge Is Survivorship Bias? Point-in-Time Index Testing in Python
Why Do Leveraged ETFs Decay? Measuring Volatility Drag in Python
Are Consumer Staples Margins Shrinking Under Inflation? Gross Margin Trend Analysis in Python
Do Weak Jobs Reports Predict Market Drawdowns? NFP Surprise Event Study in Python
Is the Rotation From Tech to Industrials Backed by Earnings? Relative EPS Growth Analysis in Python
Is the Semiconductor Rally Broadening Beyond NVIDIA? Return Dispersion Analysis in Python
Which Stocks Benefit Most When Oil Prices Fall? Oil Beta Screening in Python
Do Bond Returns Predict Stock Returns? Granger Causality Test in Python
Which Stocks Actually Drive Portfolio Returns? Shapley Value Attribution in Python
Does "Sell in May" Still Work? Calendar Anomaly Backtest in Python
How to Build Complete Price History Through Ticker Changes? Entity Resolution in Python
Are KO and PEP Cointegrated? Pairs Trading Signal Construction in Python
Which Commodities Have the Strongest Momentum? Rotation Backtest in Python
Which Commodity ETFs Have the Worst Tail Risk? Expected Shortfall in Python
Are Gold Miners Leveraged Gold Bets? Rolling Beta Analysis in Python
Does the Base-Metals-to-Gold Ratio Lead Cyclical Stocks? Signal Test in Python
Can Risk Parity Tame Commodity Volatility? Portfolio Optimization in Python
Are Power Stocks Becoming an AI Infrastructure Trade? Momentum Screening in Python
Which AI Chip Stocks Have Margin Momentum? Profitability Trend Analysis in Python
Which AI Stocks Are Cheapest Relative to Growth? Growth-Adjusted Valuation in Python
Does AI Stock Leadership Persist? Momentum Backtest in Python
Which AI Stocks Have the Cleanest Balance Sheets? Net Cash Screening in Python
Can Risk Parity Reduce Mega-Cap Drawdowns? Portfolio Optimization in Python
Which Growth Stocks Are Self-Funding? Cash-Flow Quality Screening in Python
Which Sectors Struggle When the Dollar Rallies? Sector Rotation Analysis in Python
Do Cheap Stocks Hold Up When Bonds Sell Off? Valuation Rotation in Python
Does the Nasdaq 100 Have Better Growth Quality Than the Dow? Index Constituent Analysis in Python
Do Healthcare Cash-Flow Margins Predict Returns? Signal Evaluation in Python
Which Dividend Stocks Survive a Cash-Flow Stress Test? Dividend Screening in Python
Does Heavy Insider Selling Predict Weak Returns? Insider Flow Test in Python
Can Quality Screens Reduce Small-Cap Balance-Sheet Risk? Russell 2000 Test in Python
Which Retailers Have Positive Operating Leverage? Margin Screening in Python
Is MSTR a Leveraged Bitcoin Proxy? Rolling Beta Analysis in Python
Is Micron's Memory Cycle Recovering? Inventory and Margin Forecasting in Python
Which Sectors Work When Bonds Rally? Rate-Sensitive Rotation in Python
Do One-Month Price Extremes Reverse? Signal Evaluation in Python
Do Low-Volatility S&P 500 Stocks Reduce Drawdowns? Factor Test in Python
Is AI Capex Paying Back Fast Enough? Revenue Hurdle Forecasting in Python
Could Shorter AI Asset Lives Hit Earnings? Depreciation Stress Test in Python
How Much AI Capex Risk Can a Portfolio Remove? Constrained Optimization in Python
Is the AI Capex Trade Crowded? Rolling Volatility and Sector Rotation in Python
Did the AI Boom Come From Existing S&P 500 Members? Point-in-Time Momentum Test in Python
Is AI Revenue Circular? Customer-Vendor Capex Loop Analysis in Python
Is the AI Trade Connected to Private Credit? Rolling Correlation Network in Python
Is Apollo More Balance-Sheet Sensitive Than Peers? Leverage Screen in Python
Are AI Earnings Supported by Cash Flow? Accrual and Capex Screen in Python
Can Defensive Stocks Hedge AI Drawdowns? Basket Regime Test in Python
How Fast Does the Market Price In Fed Decisions? FOMC Event Study in Python
How Much Are Options Sellers Overpaid? The Variance Risk Premium in Python
Which Companies Have the Worst Earnings Quality? Sloan Accrual Screen with Geographic Revenue Data in Python
Does the Oil-to-Gold Ratio Signal Recessions? XLE/GLD Backtest in Python
Is AI Spending Crowding Out Free Cash Flow? Capex Sustainability Across the Mag 7 in Python
Does a Long Energy / Short Bonds Portfolio Capture Inflation Surprises? Factor Construction in Python
Can a Hidden Markov Model Detect Oil Market Regimes? HMM Analysis in Python
Do Grain Prices Predict Food Inflation? Granger Causality Test in Python
Does the Corporate Credit Spread Predict Stock Market Crashes? BAA-AAA Spread Analysis in Python
Do Oil Stocks Hedge Inflation? Rolling Beta Analysis in Python
Which Stocks Are Most Rate-Sensitive? Equity Duration via Bond Beta in Python
Which Companies Have the Highest Accrual Ratios? Earnings Quality Screening in Python
Is Alpha Persistent or Decaying? Rolling Sharpe Ratio Analysis in Python
Are Markets Trending or Mean-Reverting? Hurst Exponent Analysis in Python
Is Consumer Discretionary vs Staples a Leading Indicator? XLY/XLP Ratio Analysis in Python
Does Heavy Capex Predict Future Stock Returns? Capital Expenditure Analysis in Python
How to Estimate Cost of Equity Using CAPM in Python
Is Volatility Predictable? Testing for Volatility Clustering in Python
Which Industrials Are Overleveraged? Net Debt to EBITDA Screening in Python
GM Before and After Bankruptcy: Why Entity Resolution Matters for Financial Data
What Is Adjusted Beta? Merrill Lynch Beta Shrinkage in Python
How Good Is a Stock Pick? Information Ratio and Tracking Error in Python
Do Stock Returns Follow a Normal Distribution? Testing for Fat Tails in Python
Which Large Caps Have the Highest Free Cash Flow Yield? FCF Screening in Python
Which Sectors Won Over 5 Years? Sector Rotation Analysis in Python
How to Forecast Stock Volatility with GARCH Models in Python
Are Stock Prices Mean-Reverting? Augmented Dickey-Fuller Test in Python
How to Calculate CAPM Alpha and Beta with Regression in Python
How to Compare Sector Sharpe Ratios and Sortino Ratios in Python
DELL: Why Stitching Historical Price Data Together Is Wrong
How to Analyze Drawdown and Recovery for Bank Stocks in Python
How to Screen SaaS Stocks by Revenue Growth and Cash Flow in Python
How to Screen REITs by Dividend Yield and Valuation in Python
How Correlated Are the Magnificent 7? Intra-Group Correlation in Python
AAPL vs XOM: Do Individual Stocks Have Seasonal Patterns?
How to Rank Large-Cap Stocks by Momentum in Python
How to Build a Multi-Endpoint Financial Dashboard in Python
How to Compare Volatility Across Energy Stocks in Python
How to Screen Healthcare Stocks by Valuation in Python
How to Build a Sector Correlation Matrix for Portfolio Diversification in Python
How to Find Oversold and Overbought Stocks Using Z-Scores in Python
How to Measure Earnings Quality: Cash Flow vs Net Income in Python
How to Build a Multi-Factor Stock Screen in Python (Value + Momentum + Quality)
How to Build a Simple DCF Model for Any Stock in Python
How to Screen Tech Stocks by Revenue Growth in Python
How to Screen Stocks by Balance Sheet Health in Python
Is "Sell in May" Real? SPY Monthly Seasonality Over 10 Years
How to Compare Sector Performance YTD Using Python
How to Screen Dividend Stocks by Yield and Quality in Python
How to Calculate Max Drawdown and Recovery Time for Any Stock in Python
How to Compare Profitability Across Mega-Cap Tech Stocks in Python
Why Ticker Symbols Are Unreliable: The Recycling Problem Every Quant Should Know
How to Calculate and Compare Stock Volatility in Python
How to Screen Blue-Chip Stocks by P/E Ratio in Python
How to Track Companies Through Ticker Changes, Bankruptcies, and Renames in Python
S&P 500 Turnover: How Much the Index Has Changed Since 2010
How to Calculate Stock Beta and Correlation in Python
← All articles

Can You Use Yahoo Finance Data Commercially?

No. Yahoo’s Terms of Service, read on 29 July 2026, state: “Unless otherwise expressly stated, you may not access or reuse the Services, or any portion thereof, for any commercial purpose.” They separately prohibit collecting data “using any automated means, devices, programs, algorithms or methodologies, including but not limited to robots, spiders, scrapers, data mining tools, or data gathering or extraction tools, for any purpose without our express, prior permission”. A script that pulls prices from Yahoo and a report that bills a client for the resulting chart both sit inside those sentences. The library sitting in the middle does not change them.

Every source draws this line somewhere, and the position of the line rarely matches what people assume from the price. What follows is a reading of published terms as of 29 July 2026, not legal advice; the pages move, and only counsel can tell you where your particular use falls.

What do Yahoo’s terms actually say?

Three clauses matter. The commercial-purpose bar quoted above is the broad one. Below it sits a distribution clause: “Unless you have explicit written permission, you must not reproduce, modify, rent, lease, sell, trade, distribute, transmit, broadcast, publicly perform, create derivative works based on, or exploit for any commercial purposes, any portion or use of, or access to, the Services (including content, advertisements, APIs, and software)”. The third one is aimed squarely at data products, prohibiting use of any material or content to “create any database, archive, mobile application, data feed, widget or any other aggregated data source that competes with or constitutes a material substitute for the Services ...”.

yfinance, the Python library most people actually mean when they say “the Yahoo Finance API”, is direct about its own position. Its documentation carries a legal disclaimer stating that “yfinance is not affiliated, endorsed, or vetted by Yahoo, Inc. It’s an open-source tool that uses Yahoo’s publicly available APIs, and is intended for research and educational purposes.” Readers are told they “should refer to Yahoo!’s terms of use ... for details on your rights to use the actual data downloaded”, and the disclaimer closes with a plain instruction: “Remember - the Yahoo! finance API is intended for personal use only.”

That disclaimer is worth taking at face value. The library is licensed open source; the data flowing through it is not the library’s to license. Installing something with pip grants rights over the code and none at all over what arrives in the DataFrame.

What counts as commercial use?

Most people underestimate the reach of the term, because the intuitive test is whether money changed hands for the data. Vendors use a wider test. Alpha Vantage publishes the clearest version: its terms grant the right to use the platform “for personal, non-commercial use, unless you and Alpha Vantage have agreed otherwise in writing”, then list the conditions under which usage is commercial. Two of them catch people who never sold anything. Usage is commercial if “you are using the Alpha Vantage Platform as or on behalf of a corporation, firm, partnership, trust or any other association and not as an individual”, and also if “you are currently employed or have an active affiliation with a financial planning advisor, insurance company, investment advisor, investment bank, money manager, registered representative, securities broker-dealer, or any owner, partner, affiliate or associated person of the preceding”.

Read the second one twice. An analyst at a registered advisor, running a private research script at home on a personal laptop, is a commercial user under that definition. Employment is the trigger, not revenue.

Four situations, roughly in order of how much trouble they cause:

A personal script on a personal machine, output seen by nobody else, is the case every free tier is written for. A tool used inside an employer already fails the individual-licence test at most vendors, even when the output never leaves the building. A number pasted into a deliverable a client pays for has left the building. A product that displays values to its own users is redistribution, which nearly every agreement treats as a separate grant rather than a bigger version of the same one.

Where does each source draw the line?

Every figure and quotation below was read off the source’s own pages on 29 July 2026.

Source What the published terms say Route to commercial use
Yahoo Finance (including via yfinance) “Unless otherwise expressly stated, you may not access or reuse the Services, or any portion thereof, for any commercial purpose”; automated collection requires “express, prior permission” None published
SEC EDGAR, data.sec.gov REST APIs “These APIs do not require any authentication or API keys to access”; the same page separately documents filer and user API tokens. Access still needs a User-Agent declaring contact details, and a generic one is answered with HTTP 403 No licence fee, no key; filings are the public record
Alpha Vantage Licence granted “for personal, non-commercial use, unless you and Alpha Vantage have agreed otherwise in writing”, with employment at a financial firm listed as a commercial trigger Written agreement, by email to premium@alphavantage.co
Twelve Data Licence “solely for Internal Use”, defined as “use solely for Customer’s internal business purposes and not for redistribution or external commercial purposes”; free-tier users may not “use Free Tier data for commercial purposes” Subscription tier, Redistribution Rights Add-On, or separate agreement via sales@twelvedata.com
Massive (polygon.io redirects here) Self-serve stocks plans from $0 to $199 per month are each marked “Individual use”, and the $199 Stocks Advanced plan carries “Non-pros only” as well; the $1,999 per month Stocks Business plan is marked “Business use” Published and self-serve at the Business tier
xfinlink Free and Pro are an individual licence; Business is a company-wide internal licence; Redistribution permits display of values to end users of your own products Published and self-serve: $149 per month internal, $399 per month redistribution

Sources in row order: the Yahoo Terms of Service; the SEC’s EDGAR API page; the Alpha Vantage terms of service; the Twelve Data terms; massive.com/pricing and massive.com/business, reached because polygon.io returns a redirect to massive.com; the xfinlink terms and pricing page.

Note what the free rows have in common. Every free tier in that table, including xfinlink’s, is an individual licence. Free access and commercial rights are separate products everywhere, and a generous request budget says nothing about the second one. The guide to free stock market data APIs covers what the request limits themselves are worth.

What does a commercial licence cost?

Two of these vendors make you ask. Alpha Vantage routes commercial use to an email address, and Twelve Data routes redistribution to a sales conversation and a separate agreement. Neither approach is unreasonable, and both mean the answer to “what will this cost” arrives days after the question, which is awkward when the decision is whether to start building at all.

Massive publishes its number, and the number is self-serve: $1,999 per month for Stocks Business, checkout on the page, no call required. For a firm that needs real-time trades and quotes across US exchanges, that is a fair price for a tier that includes exchange coverage a cheaper plan cannot carry.

The distinction that saves money is internal versus external. A quant team using data to make decisions is not doing the same thing as a dashboard showing the same numbers to paying users, and paying redistribution rates for internal analysis is a common and expensive mistake. xfinlink prices those as two steps: $149 per month for a company-wide internal licence, covering employees and contractors of the subscribing entity, and $399 per month to display values to end users of your own products. Both sit on the pricing page with the per-endpoint limits in the docs.

Which licence do you actually need?

Work backwards from how far the number travels.

If it dies on your laptop, a free individual tier covers you, and yfinance is genuinely fine for a weekend script or a class exercise. If it reaches a colleague, you need a company licence, and your employer’s industry may have already made you a commercial user before you wrote a line of code. If it reaches someone who pays you, or appears on a screen you do not control, you need redistribution rights in writing.

Then pick the source whose published terms match that answer without a negotiation. A licence you can read and buy on the same afternoon is worth more than a cheaper one that needs a salesperson to quote it.

FAQ

Is yfinance illegal to use?
The library is open source and freely installable. The constraint sits on the data it retrieves, which is governed by Yahoo’s terms rather than the library’s licence, and those terms restrict commercial reuse and automated collection.

Does an internal company tool count as commercial use?
At most vendors, yes. Twelve Data’s standard licence is for “Internal Use” and still requires a paid subscription; Alpha Vantage treats use “as or on behalf of a corporation, firm, partnership, trust or any other association” as commercial. Internal use is a cheaper licence, not a free one.

Are SEC filings free to use commercially?
The SEC states that its data.sec.gov REST APIs “do not require any authentication or API keys to access”, and the filings themselves are the public record. No authentication is not the same as no conditions: requests need a User-Agent declaring contact details, and a generic one is answered with HTTP 403. The work after that is parsing, since raw XBRL arrives as filer-chosen tags, and mapping them to consistent fields across thousands of companies is the part vendors charge for.

What happens if a data source changes its terms?
Nothing warns you. Terms pages are updated without notice to existing users, which is an argument for building against a vendor that has a contract with you and an account to notify, rather than an endpoint you found.

Built with xfinlink — free financial data API for Python. pip install -U xfinlink

Built with xfinlink — free financial data API for Python. pip install -U xfinlink
← All articles