Free stock market data API sources for AI agents: what we actually used
Updated on
Educational only, not investment advice.
This is a short list of free stock market data API sources for AI agents. It covers only the sources our own research notes ran on, what each one gave the agent, and where each one fell short. Sources we have not run are listed separately with their own description, not ours.
What we used in our own research notes
Between 2026-10-20 and 2026-10-21 an AI research agent (Claude Code) produced five research notes for this site using free data only. The table lists which free source each note used and what it pulled. Each row comes from the note's own method box and source list.
| Research note | SEC EDGAR / XBRL | FRED | Prices | Other |
|---|---|---|---|---|
| Microsoft DCF model | 10-K filings for historicals, balance sheet and shares; the 8-K EX-99.1 press release for working capital lines | 10-year Treasury yield (DGS10) as the risk-free rate; CPI-U (CPIAUCSL) | Yahoo Finance chart data (unofficial): MSFT price and weekly MSFT and SPY history for beta | Consensus and call guidance from the web, tagged [WEB], used only as cross-checks |
| Manhattan Associates comparable companies | 10-K, 10-Q, DEF 14A peer group and 8-K filings; LTM figures from XBRL companyfacts | None used | Yahoo Finance chart data (unofficial) | No web-sourced figures |
| NVIDIA Q2 FY2027 earnings review | 8-K EX-99.1 and EX-99.2; 10-Q XBRL tags cross-checked against the release | None used | Yahoo Finance chart data (unofficial) | One consensus source from the web, tagged [WEB] |
| SpaceX Q3 2026 earnings review | 8-K EX-99.1 earnings release | None used | Yahoo Finance chart data (unofficial) | Call remarks and consensus from news coverage, tagged [WEB] |
| Best S&P 500 stock each year backtest | None used | None used | Yahoo Finance split- and dividend-adjusted prices (unofficial) | Year-end S&P 500 membership from the open fja05680/sp500 dataset on GitHub |
Three things stood out across the runs.
- SEC data did most of the work. Every company note took its reported figures from SEC filings or XBRL. The Microsoft and Manhattan Associates notes each had a separate checking pass that compared 17 figures with the original SEC filings (and FRED, for Microsoft).
- FRED appeared in one note. Only the Microsoft DCF used it, for the discount rate and an inflation check. The Manhattan Associates and NVIDIA notes say outright that no FRED series were used.
- The price source had gaps. The backtest found that about 125 former S&P 500 members that were acquired or delisted had no Yahoo history, so the note relies only on each year's top-ranked stock.
SEC EDGAR and XBRL
SEC EDGAR is the free source for what US-listed companies report. SEC says anyone can access and download EDGAR information for free, and its data.sec.gov APIs "do not require any authentication or API keys" (EDGAR APIs). The JSON APIs cover a company's filing history (submissions) and its XBRL financial data (companyconcept, companyfacts and frames).
Two rules matter before an agent calls it. Automated tools should declare a User-Agent with a name and contact email, and requests should stay inside SEC's fair-access guideline (Accessing EDGAR Data).
We cover the endpoints, a working Python script and the User-Agent setup in SEC EDGAR API in Python. For pulling the text of a 10-K (Risk Factors and MD&A) for an agent to read, see Read a 10-K with AI.
What our runs learned about it: XBRL tags do not cover everything. In the Manhattan Associates note, the tool found no debt XBRL tag for some companies and treated debt as zero, which the note flags as unverified. In the Microsoft note, the free tools did not normalize "other current assets" and some current-liability lines, so the agent took them from the press release attached to the 8-K.
FRED
FRED is the Federal Reserve Bank of St. Louis's economic data service. Its API lets programs retrieve economic data series, such as observations for a series, series search and release dates (FRED API).
It needs a key. FRED's documentation says "All web service requests require an API key to identify requests," and you have to sign in to a FRED account to request one (FRED API Keys).
Read the terms before you ship anything on it. Two lines from the FRED API Terms of Use matter most for an agent project:
- Some series belong to third parties: "Data series available through the FRED® API, may be owned by third parties and subject to copyright restrictions."
- An application must carry this notice: "This product uses the FRED® API but is not endorsed or certified by the Federal Reserve Bank of St. Louis."
How we used it: the Microsoft DCF took its risk-free rate from the 10-year Treasury yield series DGS10 and its inflation reference from CPI-U (CPIAUCSL). The note shows the observation date it used and how much the result moves with that rate.
Yahoo Finance (unofficial)
Yahoo Finance prices are the one source here without an official API. Our notes used Yahoo's chart data, which is the data behind its website's price charts. We did not find any official documentation or service terms for using that endpoint as an API, so treat it as something that can change or stop working without notice.
What our notes took from it: the latest close for each company (Microsoft, Manhattan Associates and its peers, NVIDIA, SpaceX), weekly price history for Microsoft's beta, and split- and dividend-adjusted daily and monthly prices for the S&P 500 backtest. Every note labels the price as "Yahoo Finance chart data (unofficial)" with the close date and the retrieval date.
What it could not give: history for many acquired or delisted companies. In the backtest, about 125 former index members had no Yahoo history, which is why the note publishes only the #1 stock for each year.
The backtest's index membership came from a different free source, the open fja05680/sp500 dataset, which describes itself as "Current and Historical Lists of S&P 500 components since 1996." It is a data file in a GitHub repository, not an API.
Other free sources we have not tested
These come up often in "free stock API" lists. None of them were used in our research notes. Each line below is the provider's own description, not our result.
- Alpha Vantage. It describes over 130 endpoints across stocks, ETFs, options, fundamentals, forex and crypto, commodities, economic indicators and technical indicators, and its documented calls take an API key (Alpha Vantage documentation). Its documentation marks some endpoints as premium. Not tested yet.
- Twelve Data. It describes real-time and historical stock data with a free Basic plan that includes US stocks, called with an API key (Twelve Data stock API). Check its plan page for the free-tier limits. Not tested yet.
What free data can't give you
Our notes ran into the same gaps each time.
- Consensus estimates and forward multiples. The Manhattan Associates note says free SEC and Yahoo data has no forward (NTM/FY+1) multiples and no consensus estimates, so none were provided. The NVIDIA and SpaceX notes took consensus from news coverage and tagged it as web-sourced. The NVIDIA note also says ratings and price targets were not available in free data.
- Everything in the full filing. XBRL holds the tagged numbers. Footnotes, segment detail and customer concentration sit in the filing text. Several notes say which parts of the 10-Q they did not read.
- Clean history for delisted companies. See the Yahoo section above.
- Real-time quotes. Our notes used closing and historical prices only. Real-time data is outside what we tested.
For how we check an AI agent's research output, see How we test.
FAQ
Is there a free stock market data API that needs no key?
SEC's data.sec.gov APIs need no authentication or API key, and our research notes used them for filings and XBRL financials. FRED requires an API key. The Yahoo Finance chart data our notes used is unofficial, and we found no published terms for using it as an API.
Can free data give me analyst consensus estimates?
Not in our runs. Our research notes found no consensus estimates or forward multiples in free SEC and Yahoo data. The notes that show consensus took it from news coverage and tagged it as web-sourced.
Is this investment advice?
No. This page describes data sources and how our research notes used them. It does not recommend buying or selling any security.
Related on bests.one
- SEC EDGAR API in Python: free financial data for AI agents
- Read a 10-K with AI using the SEC EDGAR API
- Microsoft DCF model built by an AI agent
- How we test
- Can AI pick stocks? How we grade an AI analyst
Sources: EDGAR Application Programming Interfaces (APIs), Accessing EDGAR Data, FRED API Keys, FRED API Terms of Use, fja05680/sp500 on GitHub, Alpha Vantage API documentation, Twelve Data stock API. Checked on 2026-10-27.