Polygon.io API
Real-time and historical market data for stocks, options, forex and crypto.
What it does
Polygon.io provides market data for US stocks, options, indices, forex and crypto: aggregates (OHLC bars), trades and quotes, last trade/quote, reference data (tickers, splits, dividends, financials) and real-time WebSocket streams on paid plans.
Base URL
Authentication
Create a free account and use your key as ?apiKey=YOUR_KEY or Authorization: Bearer YOUR_KEY.
Code examples
curl -s "https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2026-01-02/2026-01-31?apiKey=$POLYGON_KEY"
import requests
r = requests.get(
"https://api.polygon.io/v2/aggs/ticker/MSFT/prev",
params={"apiKey": KEY}, timeout=10)
bar = r.json()["results"][0]
print("prev close", bar["c"], "volume", bar["v"])Rate limits & quotas
Free plan: 5 API calls/minute, end-of-day data only (no real-time), and about 2 years of history. Over the minute limit returns HTTP 429. Paid tiers add real-time, unlimited calls and full history.
Key response fields
| results[].o / h / l / c / v | Open, high, low, close, volume for each bar |
| results[].t | Bar start time, Unix milliseconds |
| resultsCount / status | Number of bars and OK/DELAYED |
| ticker | The symbol the response is for |
| next_url | Cursor for the next page of a large result |
Common errors
| 401 | Missing or invalid key. |
| 403 | Real-time endpoint requested on the free (EOD) plan. |
| 429 | Over 5 calls/minute. |
| 404 / results: [] | No data for that ticker/date range. |
When to use it (and alternatives)
Choose Polygon for high-quality US market data and a clean, consistent schema, if the 5-calls/minute free ceiling fits your batch jobs. For interactive apps needing more calls, Finnhub or Twelve Data are easier on free.
FAQ
Is real-time data available on the free plan?
No. Free is end-of-day only. Quotes are delayed and intraday aggregates reflect the prior session. Real-time requires a paid plan and, for some feeds, exchange agreements.
How do I paginate large aggregate requests?
Follow the next_url field in the response (it already includes your cursor); append your apiKey to it.
What history do I get for free?
About two years of end-of-day aggregates. Deeper history is a paid add-on.
New to APIs?
Short guides for working with this API — and any other.