Free stock market and finance APIs
Market data, macroeconomic series and financial utilities without a key, why free equity quotes are always delayed, and what exchange licensing actually forbids.
Finance is the category where the licensing terms matter more than the API design. Nobody gets sued for misusing a weather API. Redistributing exchange data without a market data agreement is a different situation.
The good news is that the genuinely free parts — macroeconomic series, company filings, financial mathematics — are often more useful than the quotes people go looking for.
Short answer
For macroeconomic data, use Econdb — keyless, CORS-enabled and global. For company fundamentals, SEC EDGAR is free, authoritative and needs no key. For real-time equity quotes, nothing free exists, and that is a licensing constraint rather than a gap in the market.
The shortlist
| API | Key needed | CORS | Status |
|---|---|---|---|
| EcondbGlobal macroeconomic data | No | Yes | Live |
| Portfolio OptimizerPortfolio analysis and optimization | No | Yes | Live |
| Goldprice.devCross-validated gold, silver & copper spot, futures & 30-year history | No | Yes | Live |
| BinlistPublic access to a database of IIN/BIN information | No | Yes | Live |
| aikstockdataKOSPI/KOSDAQ/KONEX daily settled closes, DART filings with receipt tim | No | No | Live |
| US Mortgage CalculatorMortgage payment, amortization, affordability and 50-state property ta | No | Yes | Live |
The licensing boundary
This is the part worth understanding before you choose anything.
Exchanges own their order book data and license it. A vendor redistributing it pays, and often passes per-user reporting obligations down to you. The conventional compromise is the 15-minute delay: after that window, data is generally free to redistribute.
Real-time quotes licensed, per-user fees, reporting obligations
15-minute delayed generally free to redistribute
End-of-day closes freely available
Company fundamentals public filings, free
Macroeconomic series public data, freeEcondb — macroeconomic data, keyless
Global macro series — GDP, inflation, unemployment, trade — from national statistics offices, in one interface with no key.
curl -s "https://www.econdb.com/api/series/CPIUS/?format=json"
curl -s "https://www.econdb.com/api/series/?search=unemployment&format=json"const series = await fetch('https://www.econdb.com/api/series/RGDPUS/?format=json')
.then((r) => r.json());
const points = series.data.dates.map((d, i) => ({
date: d,
value: series.data.values[i],
}));Note the parallel-arrays shape — dates in one array, values in another, matched by index. It is compact and it is easy to misalign if you filter one without the other. Zip them into objects immediately, as above, and the problem disappears.
SEC EDGAR — the best free fundamentals source
Every filing by every US public company, free, keyless and authoritative. It is the primary source that commercial fundamentals APIs resell.
curl -s -H "User-Agent: MyApp [email protected]" \
"https://data.sec.gov/api/xbrl/companyconcept/CIK0000320193/us-gaap/Revenues.json"
curl -s -H "User-Agent: MyApp [email protected]" \
"https://data.sec.gov/submissions/CIK0000320193.json"The CIK must be zero-padded to ten digits, which is a small detail that causes a lot of 404s:
const cik = String(rawCik).padStart(10, '0');
const url = `https://data.sec.gov/submissions/CIK${cik}.json`;Portfolio Optimizer — maths, not data
Unusual and genuinely useful: it performs portfolio calculations rather than serving prices. Mean-variance optimisation, risk parity, efficient frontiers — the arithmetic you would otherwise implement yourself and get subtly wrong.
curl -s -X POST "https://api.portfoliooptimizer.io/v1/portfolio/optimization/mean-variance" \
-H "Content-Type: application/json" \
-d '{
"assets": 3,
"assetsReturns": [[0.01,0.02,-0.01],[0.03,0.01,0.02],[0.00,0.01,0.01]]
}'Because it is computation over data you supply, there is no licensing question at all.
The specialists
Goldprice.dev covers gold, silver and copper spot and futures with 30-year history, CORS-enabled and keyless — precious metals are not exchange-restricted the way equities are.
Binlist identifies the issuing bank, card scheme and country from the first six to eight digits of a card number:
curl -s "https://lookup.binlist.net/45717360"{
"scheme": "visa",
"type": "debit",
"bank": { "name": "Jyske Bank" },
"country": { "alpha2": "DK", "name": "Denmark" }
}Useful for showing the right card logo during checkout. Note that a BIN is not sensitive data, but the rest of a card number is — never send a full PAN to a third-party lookup.
aikstockdata covers Korean markets with daily settled closes and DART filings. US Mortgage Calculator does amortisation and affordability with fifty-state property tax data.
Survivorship bias, if you are backtesting
Worth a warning because it invalidates more amateur backtests than any coding error.
Most free historical datasets contain only companies that still exist. Firms that went bankrupt or were delisted are simply absent. A strategy backtested on that data is being tested on a universe selected for having survived, which makes almost any strategy look profitable.
"S&P 500 constituents" as of today <- biased
"S&P 500 constituents" as of each date <- correct, and rarely freeIf a free dataset does not explicitly say it includes delisted securities, assume it does not.
Corporate actions, and why historical prices lie
The trap that invalidates more amateur analysis than any other, and it is invisible unless you know to look for it.
When a company splits its shares, the price halves overnight with no loss of value. When it pays a dividend, the price drops by roughly the dividend on the ex-date. A raw price series records both as sharp falls, and any calculation over that series — a return, a moving average, a volatility figure — is wrong at every one of those points.
The fix is adjusted prices, where historical values are restated to account for splits and dividends so the series is comparable across time. Most APIs offer both and are not always explicit about which field is which. Using the raw close where you meant the adjusted close produces results that look plausible and are quietly incorrect, which is the worst kind of error.
The complication is that adjusted series are recalculated whenever a new corporate action occurs, so the "historical" value for a date in 2019 can legitimately change tomorrow. Anything you cache needs to know this. Anything you reconcile against needs to record which vintage it used.
Ticker symbols compound the problem. They are reused after a delisting, reassigned after a merger and differ between exchanges for the same company. A symbol is a display label, not an identity. Where a provider exposes a stable identifier — a CIK for US filers, an ISIN internationally — store that instead, and treat the ticker the way you would treat a display name.
Survivorship bias, stated plainly
This deserves its own treatment because it is the reason so many backtests look brilliant and perform badly.
Most free historical datasets contain only companies that still exist. Firms that went bankrupt, were acquired or were delisted have simply been removed. So a strategy tested on "the S&P 500" is really being tested on the companies that survived to today, selected with perfect hindsight.
The effect is not subtle. Excluding failures removes precisely the worst outcomes from the sample, which inflates returns and understates risk simultaneously. A strategy that would have lost money badly can test as consistently profitable.
The honest requirement is a point-in-time dataset: one that knows which companies were in the index on each historical date, including those that later disappeared. Those exist, they are expensive, and their price is the clearest possible signal of how much the distinction matters.
If you are working with free data, the right response is not to pretend the problem away but to state it. A backtest caveated as "survivorship-biased, so treat the returns as an upper bound" is honest analysis. The same backtest presented as an expected return is not.
The same caution applies to any "top N" list computed from current membership. Ranking today's largest companies and projecting their past performance backwards measures the selection, not the strategy.
Time, timezones and the trading day
The last category of quiet errors, and the most tedious to debug.
Markets open and close at local times that shift with daylight saving, and the northern and southern hemispheres change on different dates. A hard-coded UTC offset for a market's open will be an hour wrong for several weeks a year. Storing the exchange's timezone identifier and converting properly is the only approach that survives.
Trading days are not calendar days. Weekends have no data, and every exchange observes its own holidays. A loop over dates expecting a value each day will find gaps, and filling those gaps with zero rather than carrying the last value forward turns a flat weekend into a crash in any chart or calculation.
Daily data is also frequently timestamped at midnight rather than at the close, which is fine until you join it against intraday data and everything is shifted by a session. And a "daily close" on one provider can mean the last trade, the official auction price, or a consolidated figure across venues — three different numbers, none of them labelled.
None of this is difficult. All of it is silent when wrong, which is why it is worth handling deliberately at the point where data enters your system rather than discovering it in a result that looks almost right.
Choosing
Macroeconomic series. Econdb.
US company fundamentals and filings. SEC EDGAR, with a real User-Agent.
Portfolio mathematics. Portfolio Optimizer.
Precious metals. Goldprice.dev.
Card BIN lookup at checkout. Binlist.
Delayed equity quotes for a hobby project. Alpha Vantage or Finnhub, both with registered free tiers.
Real-time quotes in a commercial product. A licensed market data vendor, and a conversation with a lawyer.
For crypto, where the licensing picture is completely different, see free cryptocurrency APIs. Browse the finance category for all 119 entries we track.
Common questions
Is there a free stock market API with no key?
For macroeconomic data and financial utilities, yes — Econdb, Portfolio Optimizer and Goldprice.dev all work keylessly. For real-time equity quotes, effectively no, because exchanges license that data and charge for it.
Why is free stock data always 15 minutes delayed?
Because exchanges sell real-time data as a product and license it per user. The 15-minute delay is the conventional point at which it becomes free to redistribute, and it is a licensing boundary rather than a technical one.
Can I use free market data in a commercial app?
Read the exchange licensing terms, not just the API's. Redistributing even delayed quotes to end users can require a market data agreement. Company fundamentals and macroeconomic series are far less restricted.
What is the best free source of company financials?
SEC EDGAR. It is free, keyless, authoritative and covers every US public filer. It requires a descriptive User-Agent header identifying you, which is enforced.
Are free stock APIs good enough for backtesting?
For daily bars on liquid stocks, usually yes. Be careful about survivorship bias — most free datasets exclude delisted companies, which makes historical strategies look far better than they were.
Sources
Written by
SandyI build and run this site on my own: the crawler that assembles the catalogue, the checker that probes every listing, and the writing. Before this I built SaveFromInternet and GrabReels, which meant living with other people’s APIs full time — parsers breaking when a platform shipped a change, rate limits arriving without warning, endpoints disappearing overnight. This directory exists because I got tired of free API lists that had never been checked.