A few weeks ago I was paying $50/month for a stock research tool. Yahoo Finance Premium, if you're curious.
Then I discovered that the exact same data — actually BETTER data — is available for free through government APIs.
Here are the 3 APIs that replaced my paid subscription:
1. SEC EDGAR API — Company Financials ($0)
Every US public company files financial reports with the SEC. Revenue, profit, assets, debt — it's all there.
No API key needed. Just add a User-Agent header.
import requests
headers = {"User-Agent": "MyApp (email@example.com)"}
cik = "0001318605" # Tesla
url = f"https://data.sec.gov/api/xbrl/companyfacts/CIK{cik}.json"
data = requests.get(url, headers=headers).json()
revenue = data["facts"]["us-gaap"]["Revenues"]["units"]["USD"]
for r in revenue[-3:]:
if r["form"] == "10-K":
print(f"{r["fy"]}: ${r["val"]:,.0f}")
2. FRED API — Economic Indicators ($0)
816,000+ time series from the Federal Reserve. Inflation, GDP, unemployment, interest rates.
Free API key, takes 30 seconds.
api_key = "your_free_key"
url = f"https://api.stlouisfed.org/fred/series/observations?series_id=CPIAUCSL&api_key={api_key}&file_type=json"
data = requests.get(url).json()
for obs in data["observations"][-3:]:
print(f"{obs["date"]}: CPI = {obs["value"]}")
3. Treasury.gov API — Government Debt Data ($0)
Real-time US national debt, treasury auctions, interest rates on government bonds.
No API key needed.
url = "https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny?sort=-record_date&page[size]=5"
data = requests.get(url).json()
for record in data["data"]:
debt = float(record["tot_pub_debt_out_amt"])
print(f"{record["record_date"]}: ${debt/1e12:.2f} trillion")
The Math
| What I had | Cost | What I have now | Cost |
|---|---|---|---|
| Yahoo Finance Premium | $50/mo | SEC EDGAR + FRED + Treasury | $0 |
| 1 data source | - | 816,000+ datasets | - |
| Pre-built charts only | - | Full programmatic access | - |
| US stocks only | - | Every public company + macro | - |
$600/year saved. And honestly, the free APIs give me MORE data.
The catch?
You need to know a little Python. But if you're reading Dev.to, you probably do.
Has anyone else replaced a paid tool with a free API?
I'm curious what other "paid tool → free API" swaps people have made. Drop yours in the comments.
I'm writing a series on free APIs that replace paid tools. Follow for more.
Top comments (0)