Can You Use yfinance Commercially? I Found Out the Hard Way
Is yfinance data free to use commercially? No — and here's the license research, plus the 50-KPI stock screener I built with AI agents on top of it anyway.
I built my own quant stock screener — AI agents wrote most of the code, I made the architecture and review decisions — because every screener I tried either hid the numbers I wanted behind a subscription or computed them in ways I couldn’t audit. It works. I use it daily. And in the middle of planning how to monetize it, an afternoon of reading license terms killed that plan completely. Both halves of that story are worth your time, but if you’re building on free financial data, the second half might save you months.
Can you legally use yfinance data commercially?
No. The yfinance code is Apache-2.0 — use it freely. The data it fetches is not
yours: the library’s own README says the Yahoo API is “intended for personal use only.”
I read the primary documents so you don’t have to — four of them: the yfinance README and license, Yahoo’s Developer API terms, Yahoo Finance’s help/terms page, and Yahoo’s general Terms of Service. The load-bearing findings:
- Yahoo’s API terms prohibit deriving income from the data — the wording catches subscriptions and ads (“whether for direct commercial or monetary gain or otherwise”).
- Yahoo Finance’s own terms page states, in bold: “You must not redistribute information displayed on or provided by Yahoo Finance.” A free public site is still redistribution — the prohibition isn’t about money.
- The part that ends the discussion: Yahoo doesn’t own most of the data, so it couldn’t license it to you even if it wanted to. The fundamentals, analyst estimates, and ownership data are sublicensed — meaning Yahoo resells data owned by Morningstar, S&P Global, and LSEG, each with their own written-consent requirements sitting upstream.
If you’re checking your own project, the test is three questions: Does the vendor’s license say personal/non-commercial use? Does it prohibit redistribution (money aside)? Is the underlying data sublicensed from a third party with its own terms? For yfinance the answers are yes, yes, and yes — and reading the same documents, I don’t see how any yfinance-based product escapes them. My screener stays a personal instrument; if it ever earns a euro, every byte of market data gets replaced with a commercially licensed feed first. I designed for that swap (the vendor sits behind a single adapter module), but designing for it and pretending it isn’t necessary are different things — plenty of tutorials quietly do the second.
What QuantScreen does: ~50 KPIs across the S&P 500
The tool itself, briefly — it’s the reason the licensing question mattered at all. ~503 tickers, ~50 metrics computed from raw stored inputs rather than scraped pre-computed:
- Valuation — price-to-earnings and its relatives (P/B, P/S, P/FCF, EV/EBITDA, PEG, Graham number): “what am I paying for a unit of this business?”
- Quality & health — returns on equity/assets/capital, margins, liquidity and debt ratios: “is this business any good, and can it pay its bills?”
- Ownership & positioning — insider and institutional ownership, short interest: “who holds this, and who’s betting against it?”
- Price & risk — momentum across horizons, moving-average distance, and risk-adjusted return measures like Sharpe and Sortino (return per unit of risk taken): “how has it moved, and how violently?”
Every metric is filterable, and each one carries a percentile rank computed two ways — against the whole universe and within the stock’s sector. “Cheap for a tech stock” and “cheap, period” are different facts; a screener should know that.
Three rules make me trust it more than tools I’ve paid for:
Missing data is null, never zero. A company with no earnings has no P/E — not a P/E of 0 — so it drops out of “P/E below 15” screens instead of ranking as the cheapest stock alive.
Point-in-time discipline. Every fundamental carries the date I observed it, and observations are never overwritten when vendors restate. Commercial point-in-time datasets exist (Compustat’s and Sharadar’s, for instance) — what an individual can’t realistically do is retroactively reconstruct this history after building on current-values data, because the pre-restatement numbers are gone by the time you go looking. So mine accumulates from day one.
Recompute from raw. When a formula improves, the entire history re-derives from stored inputs, offline. No re-scraping, no trust-me numbers.
The build itself went through spec reviews and adversarial agent review — the process caught, among other things, a moving-average bug that would have silently averaged the wrong number of bars forever. That workflow is its own write-up.
Verdict
- Good: a screener whose every number I can audit and re-derive, and a point-in-time archive quietly compounding in the background.
- Bad: one vendor, end-of-day data, S&P 500 only — arguably the most efficiently-priced, heavily-analyzed universe there is, which limits how much edge screening it can yield. Widening to small caps means more and messier data; deliberately deferred.
- Ugly: the product worked before I understood it could never be sold in this form. The monetization plan died in one afternoon of reading primary sources — which is exactly when that research should have happened: before the build. It’s the cheapest expensive lesson in the whole project, and the reason licensing research now sits at the top of every new project’s checklist.
How the system is architected — one SQLite file between two languages — is covered in its own post.