Polygon.io API Review: Professional Market Data
Polygon.io is a professional-grade financial data API that provides real-time and historical data for stocks, options, forex, and crypto. It is used by major fintech companies like Robinhood. Polygon offers REST APIs for historical data and WebSocket connections for real-time streaming. The data quality and reliability is a significant step up from free alternatives.
Pricing
- ✓ 5 API calls/minute
- ✓ 2 years historical
- ✓ End-of-day data
- ✓ No real-time
- ✓ Limited endpoints
- ✓ Unlimited API calls
- ✓ 5+ years historical
- ✓ 15-min delayed
- ✓ Stocks + options
- ✓ WebSocket access
- ✓ Unlimited API calls
- ✓ Full historical
- ✓ Real-time data
- ✓ All asset classes
- ✓ WebSocket streaming
- ✓ Everything in Developer
- ✓ Snapshot endpoints
- ✓ Bulk downloads
- ✓ Priority support
Pros
- + Professional-grade data quality
- + Real-time WebSocket streaming
- + Comprehensive options data
- + Well-documented REST API with client libraries
- + Used by major fintech companies (proven reliability)
Cons
- - Free tier is very limited
- - Real-time data requires $79/month minimum
- - Learning curve for WebSocket integration
- - US markets only (no international)
- - Options data only on paid plans
Who Is It For?
Polygon.io is for developers building serious fintech applications, trading bots, or data-driven products. If you need reliable, real-time US market data with WebSocket support, Polygon is the best value for money. Not for beginners or hobby projects where yfinance suffices.
Code Example
import requests
import pandas as pd
from datetime import datetime, timedelta
API_KEY = "YOUR_POLYGON_KEY"
BASE_URL = "https://api.polygon.io"
# Get daily bars
def get_bars(symbol: str, days: int = 30) -> pd.DataFrame:
end = datetime.now()
start = end - timedelta(days=days)
url = f"{BASE_URL}/v2/aggs/ticker/{symbol}/range/1/day/{start.strftime('%Y-%m-%d')}/{end.strftime('%Y-%m-%d')}"
params = {"apiKey": API_KEY, "adjusted": "true", "sort": "asc"}
r = requests.get(url, params=params)
results = r.json().get("results", [])
df = pd.DataFrame(results)
df["date"] = pd.to_datetime(df["t"], unit="ms")
df = df.rename(columns={"o": "open", "h": "high", "l": "low", "c": "close", "v": "volume"})
return df[["date", "open", "high", "low", "close", "volume"]]
# Get ticker details
def get_ticker_details(symbol: str) -> dict:
url = f"{BASE_URL}/v3/reference/tickers/{symbol}"
r = requests.get(url, params={"apiKey": API_KEY})
return r.json().get("results", {})
# WebSocket streaming (requires paid plan)
# import websocket
# ws = websocket.WebSocketApp(
# f"wss://socket.polygon.io/stocks",
# on_open=lambda ws: ws.send('{"action":"auth","params":"' + API_KEY + '"}'),
# on_message=lambda ws, msg: print(msg)
# )
# ws.run_forever()
bars = get_bars("AAPL", 30)
print(bars.tail())Alternatives
Recommended Reading
Algorithmic Trading with Python →As an Amazon Associate we may earn from qualifying purchases.