been using both for 2 years.
polygon primary, alpha vantage backup.
time for honest comparison.
my setup #
polygon.io:
real-time stocks/options data.
historical tick data.
$99/month starter plan.
alpha vantage:
backup for when polygon down.
free tier (5 requests/min).
premium $49/month if needed.
also using:
thetadata for options greeks ($60/month).
coinbase/kraken APIs for crypto (free).
API comparison - python ease of use #
polygon.io:
pros:
- clean REST API.
- official python library.
- websocket streaming (real-time).
- tick-level historical data.
cons:
- rate limits on free/starter tier.
- options data needs higher plan ($200+/month).
- occasional API downtime (rare).
alpha vantage:
pros:
- simple REST API.
- free tier available.
- good for beginners.
- reliable uptime.
cons:
- 5 requests/min free tier (brutal).
- no tick data (only OHLCV).
- no real-time streaming.
- limited historical depth.
verdict:
polygon for serious algo trading.
alpha vantage for hobby/learning.
i use polygon 95%, alpha vantage 5% backup.
python code examples #
polygon.io (official library):
from polygon import RESTClient
import pandas as pd
from datetime import datetime, timedelta
# initialize client
client = RESTClient(api_key="YOUR_API_KEY")
# get real-time quote
def get_realtime_quote(symbol):
"""
Get current bid/ask for symbol
"""
quote = client.get_last_quote(symbol)
return {
'bid': quote.bid_price,
'ask': quote.ask_price,
'bid_size': quote.bid_size,
'ask_size': quote.ask_size,
'timestamp': quote.sip_timestamp
}
# get historical bars (minute/hour/day)
def get_historical_bars(symbol, start_date, end_date, timespan='minute', multiplier=1):
"""
Get OHLCV bars for backtest
Args:
symbol: ticker (e.g. 'SPY')
start_date: 'YYYY-MM-DD'
end_date: 'YYYY-MM-DD'
timespan: 'minute', 'hour', 'day'
multiplier: 1, 5, 15, etc.
"""
aggs = client.get_aggs(
ticker=symbol,
multiplier=multiplier,
timespan=timespan,
from_=start_date,
to=end_date,
limit=50000
)
# convert to pandas
data = []
for agg in aggs:
data.append({
'timestamp': pd.to_datetime(agg.timestamp, unit='ms'),
'open': agg.open,
'high': agg.high,
'low': agg.low,
'close': agg.close,
'volume': agg.volume,
'vwap': agg.vwap
})
df = pd.DataFrame(data)
df.set_index('timestamp', inplace=True)
return df
# get options chain
def get_options_chain(underlying, expiration_date):
"""
Get options contracts for underlying
Note: requires higher-tier plan ($200+/month)
"""
contracts = client.list_options_contracts(
underlying_ticker=underlying,
expiration_date=expiration_date,
contract_type='call', # or 'put'
limit=1000
)
chain = []
for contract in contracts:
chain.append({
'ticker': contract.ticker,
'strike': contract.strike_price,
'expiration': contract.expiration_date,
'type': contract.contract_type
})
return pd.DataFrame(chain)
# websocket streaming (real-time ticks)
from polygon import WebSocketClient
from polygon.websocket.models import Market
def on_message(msgs):
"""
Handle real-time trade messages
"""
for msg in msgs:
if msg.event_type == 'T': # trade
print(f"Trade: {msg.symbol} ${msg.price} x {msg.size}")
# create websocket client
ws_client = WebSocketClient(
api_key="YOUR_API_KEY",
market=Market.Stocks,
on_message=on_message
)
# subscribe to SPY trades
ws_client.subscribe("T.SPY")
# run (blocks until stopped)
ws_client.run()
alpha vantage (requests library):
import requests
import pandas as pd
import time
class AlphaVantageClient:
def __init__(self, api_key):
self.api_key = api_key
self.base_url = 'https://www.alphavantage.co/query'
# rate limiting (5 req/min free tier)
self.last_request_time = 0
self.min_request_interval = 12 # seconds
def _rate_limit(self):
"""
Enforce 5 requests/min rate limit
"""
elapsed = time.time() - self.last_request_time
if elapsed < self.min_request_interval:
time.sleep(self.min_request_interval - elapsed)
self.last_request_time = time.time()
def get_quote(self, symbol):
"""
Get current price quote
"""
self._rate_limit()
params = {
'function': 'GLOBAL_QUOTE',
'symbol': symbol,
'apikey': self.api_key
}
response = requests.get(self.base_url, params=params)
data = response.json()
quote = data.get('Global Quote', {})
return {
'price': float(quote.get('05. price', 0)),
'volume': int(quote.get('06. volume', 0)),
'change_percent': quote.get('10. change percent', '0%')
}
def get_daily_bars(self, symbol, outputsize='compact'):
"""
Get daily OHLCV data
Args:
symbol: ticker
outputsize: 'compact' (100 days) or 'full' (20+ years)
"""
self._rate_limit()
params = {
'function': 'TIME_SERIES_DAILY',
'symbol': symbol,
'outputsize': outputsize,
'apikey': self.api_key
}
response = requests.get(self.base_url, params=params)
data = response.json()
time_series = data.get('Time Series (Daily)', {})
# convert to pandas
rows = []
for date_str, values in time_series.items():
rows.append({
'date': pd.to_datetime(date_str),
'open': float(values['1. open']),
'high': float(values['2. high']),
'low': float(values['3. low']),
'close': float(values['4. close']),
'volume': int(values['5. volume'])
})
df = pd.DataFrame(rows)
df.set_index('date', inplace=True)
df.sort_index(inplace=True)
return df
def get_intraday_bars(self, symbol, interval='5min'):
"""
Get intraday OHLCV data (last 30 days)
Args:
interval: '1min', '5min', '15min', '30min', '60min'
"""
self._rate_limit()
params = {
'function': 'TIME_SERIES_INTRADAY',
'symbol': symbol,
'interval': interval,
'outputsize': 'full',
'apikey': self.api_key
}
response = requests.get(self.base_url, params=params)
data = response.json()
key = f'Time Series ({interval})'
time_series = data.get(key, {})
rows = []
for datetime_str, values in time_series.items():
rows.append({
'datetime': pd.to_datetime(datetime_str),
'open': float(values['1. open']),
'high': float(values['2. high']),
'low': float(values['3. low']),
'close': float(values['4. close']),
'volume': int(values['5. volume'])
})
df = pd.DataFrame(rows)
df.set_index('datetime', inplace=True)
df.sort_index(inplace=True)
return df
# usage
av_client = AlphaVantageClient(api_key="YOUR_API_KEY")
# get quote (rate limited)
quote = av_client.get_quote('SPY')
print(f"SPY: ${quote['price']}, volume {quote['volume']}")
# get historical data
daily = av_client.get_daily_bars('SPY', outputsize='full')
print(f"Downloaded {len(daily)} days of data")
# get intraday (last 30 days only)
intraday = av_client.get_intraday_bars('SPY', interval='5min')
print(f"Downloaded {len(intraday)} 5-min bars")
verdict:
polygon: cleaner API, official library, real-time streaming.
alpha vantage: simpler but rate limits brutal.
polygon wins for python algo trading.
cost comparison #
polygon.io:
starter: $99/month (real-time stocks, historical).
developer: $200/month (adds options data).
advanced: $600+/month (tick data, all assets).
my cost: $99/month starter.
alpha vantage:
free: 5 requests/min, 500 requests/day.
premium: $49/month (75 requests/min).
my cost: $0 (use free tier as backup only).
annual costs:
polygon: $1,188/year.
alpha vantage: $0/year (backup only).
total: $1,188/year for primary data feed.
worth every dollar for real-time access.
reliability comparison #
measured over 18 months (sep 2023 - mar 2025):
polygon.io:
uptime: 99.2%
outages: 4 (each <2 hours).
API errors: occasional 429 rate limit (my fault, too many requests).
alpha vantage:
uptime: 99.8%
outages: 1 (lasted 30 minutes).
API errors: none (slow rate = stable).
alpha vantage more reliable but limited features.
polygon occasional issues but better capabilities.
what reddit/nexusfi traders say #
been reading r/algotrading for 2 years.
polygon vs alpha vantage comes up constantly.
consensus:
- polygon for serious trading (real-time needed).
- alpha vantage for learning/hobbyist (free tier great starter).
- thetadata for options greeks specifically.
nexusfi traders discuss data feeds in reviews section.
similar consensus: pay for polygon if serious, use alpha vantage for learning.
final verdict #
use polygon.io if:
- need real-time data (intraday algos).
- trade options (need chains/greeks).
- backtest with tick data.
- can afford $99+/month.
use alpha vantage if:
- learning algo trading (hobbyist).
- only need daily/hourly bars.
- budget constrained (free tier).
- don’t need real-time.
me: polygon primary, alpha vantage backup.
polygon $99/month for real-time stocks.
thetadata $60/month for options greeks.
alpha vantage free tier when polygon down (rare).
total data costs: $159/month = $1,908/year.
cost of doing business.
tonight (march 7, 1:28am) #
2 years using both data feeds.
polygon: $99/month, real-time, websockets, tick data, 99.2% uptime.
alpha vantage: free tier backup, daily/hourly only, 5 req/min, 99.8% uptime.
python: polygon official library cleaner, alpha vantage needs requests.
verdict: polygon for serious trading, alpha vantage for learning.
reddit/nexusfi consensus matches my experience.
annual data costs $1,908 (polygon $1,188 + thetadata $720).
1:28am friday. data feed comparison complete. 2 years experience both. polygon: $99/month starter, real-time stocks/historical, websocket streaming, tick data, 99.2% uptime, 4 outages <2hrs each. alpha vantage: free tier backup, 5 req/min rate limit, daily/hourly only, 99.8% uptime. python: polygon official library vs alpha vantage requests (polygon cleaner). verdict: polygon serious trading ($99/month), alpha vantage learning/backup (free). reddit r/algotrading + nexusfi consensus matches. total data costs $1,908/year (polygon + thetadata options greeks).
-AK