Compare the best free stock market APIs: Alpha Vantage, Finnhub, Twelve Data, Polygon.io, Yahoo Finance. Real-time quotes, historical data, and technical indicators.
Real-time stock market data powers everything from trading bots and portfolio trackers to financial dashboards and investment research tools. But institutional-grade market data feeds cost thousands of dollars per month. In 2026, a free stock market API gives developers access to stock prices, historical data, and financial metrics through simple REST endpoints.
This guide covers the best free stock API and financial data API options for developers, with working code examples for fetching real-time quotes, historical prices, and company fundamentals.
Fetch real-time stock prices and financial data instantly — no API key needed for the playground.
Open Stock Data PlaygroundA stock market API is a web service that provides programmatic access to financial market data through HTTP endpoints. Instead of scraping websites or purchasing expensive Bloomberg terminals, developers make API calls to retrieve structured JSON data about stocks, ETFs, indices, and other financial instruments.
A comprehensive stock price API typically provides several categories of data:
The fintech and trading tool market continues to grow rapidly. Whether you are building a personal project or a commercial product, a financial data API is the foundation:
The DevProToolkit API Hub includes financial data endpoints for stocks, ETFs, and market indices. The free tier provides real-time quotes, historical data, and company fundamentals with generous rate limits.
A popular free stock API with 25 requests per day on the free tier. Provides real-time and historical data for stocks, forex, and crypto. The daily request limit is the main drawback — production applications need the $50/month premium plan.
No official API exists, but several open-source libraries scrape Yahoo Finance data. This approach is fragile — Yahoo frequently changes their page structure, breaking scrapers. Not recommended for production applications.
Offers a free tier with 5 API calls per minute and delayed data. Real-time data requires the $29/month starter plan. Excellent data quality and coverage, but the free tier is very restrictive.
Provides a free tier with 60 API calls per minute. Covers US stocks, forex, and crypto. Good documentation but limited historical data on the free plan.
# Get a real-time stock quote
curl "https://api.commandsector.in/api/stocks/quote/AAPL" \
-H "X-API-Key: YOUR_API_KEY"
Response:
{
"symbol": "AAPL",
"name": "Apple Inc.",
"price": 247.83,
"change": 3.21,
"change_percent": 1.31,
"volume": 48293100,
"market_cap": 3820000000000,
"pe_ratio": 32.4,
"52_week_high": 260.10,
"52_week_low": 164.08,
"timestamp": "2026-02-21T16:00:00Z"
}
# Get current price for Tesla
curl "https://api.commandsector.in/api/stocks/quote/TSLA" \
-H "X-API-Key: YOUR_API_KEY"
# Get 30 days of historical data for Microsoft
curl "https://api.commandsector.in/api/stocks/history/MSFT?range=30d&interval=daily" \
-H "X-API-Key: YOUR_API_KEY"
# Get financial fundamentals for Amazon
curl "https://api.commandsector.in/api/stocks/fundamentals/AMZN" \
-H "X-API-Key: YOUR_API_KEY"
# Get top gainers and losers
curl "https://api.commandsector.in/api/stocks/movers?type=gainers&limit=10" \
-H "X-API-Key: YOUR_API_KEY"
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.commandsector.in/api"
def get_stock_quote(symbol):
"""Fetch real-time stock quote."""
response = requests.get(
f"{BASE_URL}/stocks/quote/{symbol}",
headers={"X-API-Key": API_KEY}
)
response.raise_for_status()
return response.json()
def get_historical_prices(symbol, range="90d", interval="daily"):
"""Fetch historical OHLCV price data."""
response = requests.get(
f"{BASE_URL}/stocks/history/{symbol}",
headers={"X-API-Key": API_KEY},
params={"range": range, "interval": interval}
)
response.raise_for_status()
return response.json()
# Build a simple stock watchlist
watchlist = ["AAPL", "GOOGL", "MSFT", "AMZN", "NVDA"]
print(f"{'Symbol':<8} {'Price':>10} {'Change':>10} {'% Change':>10}")
print("-" * 40)
for symbol in watchlist:
quote = get_stock_quote(symbol)
print(f"{quote['symbol']:<8} ${quote['price']:>9.2f} "
f"{'+'if quote['change']>0 else ''}{quote['change']:>9.2f} "
f"{'+'if quote['change_percent']>0 else ''}{quote['change_percent']:>8.2f}%")
# Fetch historical data for charting
history = get_historical_prices("AAPL", range="1y", interval="daily")
for day in history["prices"][-5:]: # Last 5 days
print(f"{day['date']}: Open={day['open']}, Close={day['close']}, Volume={day['volume']}")
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://api.commandsector.in/api';
async function getStockQuote(symbol) {
const response = await fetch(`${BASE_URL}/stocks/quote/${symbol}`, {
headers: { 'X-API-Key': API_KEY }
});
if (!response.ok) throw new Error(`Failed to fetch quote for ${symbol}`);
return response.json();
}
async function getHistoricalPrices(symbol, range = '90d') {
const response = await fetch(
`${BASE_URL}/stocks/history/${symbol}?range=${range}&interval=daily`,
{ headers: { 'X-API-Key': API_KEY } }
);
return response.json();
}
// Real-time portfolio tracker
async function getPortfolioValue(holdings) {
let totalValue = 0;
let totalGain = 0;
for (const { symbol, shares, costBasis } of holdings) {
const quote = await getStockQuote(symbol);
const currentValue = quote.price * shares;
const gain = currentValue - (costBasis * shares);
totalValue += currentValue;
totalGain += gain;
console.log(`${symbol}: ${shares} shares @ $${quote.price} = $${currentValue.toFixed(2)} (${gain >= 0 ? '+' : ''}$${gain.toFixed(2)})`);
}
console.log(`\nTotal Portfolio: $${totalValue.toFixed(2)} (${totalGain >= 0 ? '+' : ''}$${totalGain.toFixed(2)})`);
return { totalValue, totalGain };
}
// Example portfolio
const myPortfolio = [
{ symbol: 'AAPL', shares: 50, costBasis: 175.00 },
{ symbol: 'GOOGL', shares: 20, costBasis: 140.00 },
{ symbol: 'NVDA', shares: 30, costBasis: 450.00 }
];
getPortfolioValue(myPortfolio);
Current market price, bid/ask spread, daily volume, and percentage change. Updated every few seconds during market hours. Essential for portfolio trackers and trading applications that need current pricing.
Open, High, Low, Close, and Volume data at daily, weekly, or monthly intervals. Going back 20+ years for major US stocks. Used for charting, technical analysis, and backtesting trading strategies.
Revenue, net income, EPS (earnings per share), P/E ratio, price-to-book ratio, dividend yield, market capitalization, and sector classification. Updated quarterly based on SEC filings. Powers stock screeners and fundamental analysis tools.
S&P 500, NASDAQ Composite, Dow Jones Industrial Average, Russell 2000, and international indices. Track overall market direction and sector performance.
Minute-by-minute or 5-minute interval prices for the current trading day. Used by day traders and high-frequency charting applications. Available for US-listed stocks and major ETFs.
Get real-time stock quotes, historical prices, and company fundamentals. No credit card required.
Get Free API Key| Feature | DevProToolkit | Alpha Vantage | Polygon.io | Finnhub |
|---|---|---|---|---|
| Free Tier Limits | 10K req/mo | 25 req/day | 5 req/min | 60 req/min |
| Real-Time Data | Yes | Yes | Delayed (free) | Yes |
| Historical Data | 20+ years | 20+ years | 2 years (free) | 1 year (free) |
| Fundamentals | Yes | Yes | Yes | Yes |
| No Credit Card | Yes | Yes | Yes | Yes |
Yes. DevProToolkit provides real-time stock quotes on its free tier, including current price, daily change, volume, and market cap. Finnhub also offers real-time US stock data for free. Alpha Vantage provides real-time data but limits free users to 25 requests per day.
For most developers, DevProToolkit offers the best balance of features, rate limits, and ease of use. It provides real-time quotes, historical data, and fundamentals in a single API with no credit card requirement. Alpha Vantage is a good alternative but has very low daily request limits on the free tier.
Yes. DevProToolkit provides 20+ years of daily OHLCV data for US stocks on the free tier. This is sufficient for backtesting most trading strategies and building long-term performance charts.
Coverage varies by provider. DevProToolkit covers US markets comprehensively and includes major international exchanges. For deep international coverage, some providers require paid plans.
Free APIs are excellent for backtesting strategies and paper trading. For live trading with real money, consider the rate limits and data latency of your chosen API. The DevProToolkit free tier supports up to 10,000 requests per month, which is sufficient for strategies that trade on daily or hourly signals.
All modern stock APIs return data in JSON format. Responses typically include ticker symbol, price fields, timestamps, and metadata. Some APIs also offer CSV downloads for historical data, which is convenient for importing into spreadsheets or pandas DataFrames.
Get your free API key and start making requests in minutes.
curl "http://147.224.212.116/api/..." \
-H "X-API-Key: YOUR_API_KEY"
Get a free API key with 100 requests/day. No credit card required.
Get Free API Key