US ETF REST API documentation
Authenticate with an API key and call Data Captain endpoints for the ETF universe, batch prices, market status, screener, rankings, heatmap, backtesting, and portfolio tools. Official TypeScript and Python SDKs included below.
Official SDKs
Use the official client libraries instead of hand-rolling HTTP calls. Same API key, typed methods for screener, rankings, heatmap, backtest, and portfolio endpoints.
JavaScript / TypeScript
npm · datacaptain@0.1.0
npm install datacaptainimport { DataCaptain } from "datacaptain";
const dc = new DataCaptain({ apiKey: process.env.DATACAPTAIN_API_KEY });
const rankings = await dc.etf.rankings({ category: "return", period: "1y" });Python
PyPI · datacaptain@0.1.0
pip install datacaptainfrom datacaptain import DataCaptain dc = DataCaptain(api_key="YOUR_API_KEY") rankings = dc.etf_screener(return_min=10, period="1y")
Full SDK docs with install + examples →
Packages: npm · PyPI. Source in packages/datacaptain and packages/datacaptain-python.
Authentication
Include your API key in the x-api-key header for all requests.
x-api-key: YOUR_API_KEYETF Endpoints
/v1/etf/list?limit=48&category=technology&sort=return&sortDir=descFreecache: 60sPaginated US ETF universe with filters, sorting, enrichment (issuer, category, expense, AUM), and optional stats. Returns { data, total, limit, offset, stats? }.
/v1/etf/:symbolFreecache: 60sETF research profile — price, metrics, performance periods, OHLCV history, dividends, similar ETFs, AI summary, and risk block.
/v1/etf/heatmap?basket=broad&period=1yFreecache: 60sETF performance heatmap cells by return % for a preset basket or custom symbols.
/v1/etf/heatmap/basketsFreecache: 60sList heatmap basket presets — { baskets: [{ id, label, symbols }] }.
/v1/etf/screener?returnMin=10&expenseMax=0.2&period=1y&sort=returnFreecache: 60sScreen ETFs by return, yield, volatility, expense, AUM, Sharpe, issuer/category flags. Free plan: top 10.
/v1/etf/rankings?metric=return&period=1y&limit=20Freecache: 60sETF leaderboards by return, yield, volatility, CAGR, Sharpe, expense, AUM, or drawdown. Free plan: top 10.
/v1/stocks/prices?symbols=SPY,QQQ,VOOFreecache: 60sBatch ETF prices — latest close for up to 50 tickers. Cached 60s.
/v1/stocks/:symbol/history?startDate=2020-01-01&endDate=2024-12-31Freecache: 60sHistorical OHLCV bars for charts and research. Free plan.
Market
/v1/market/statusFreecache: 30sUS market session status from NYSE calendar (holidays + early closes). Regular 09:30–16:00 ET.
Backtesting & Portfolio
/v1/backtest/buy-and-holdPaidMulti-strategy ETF backtest (also accepts GET). Returns equity curve, tradeEvents, dividendEvents, OHLCV prices, drawdownCurve, Sharpe/Sortino, and more. Paid plan.
/v1/backtest/comparePaidCompare multiple ETFs with the same strategy settings. Returns winner, ranked list, and per-symbol results. Paid plan.
/v1/portfolio/rebalancePaidCompare current holdings to target weights and get buy/sell suggestions. Paid plan. Also accepts GET with JSON query strings.
Developer
/v1/developer/usageFreeUsage stats — plan, requests today, remaining, daily limit, series, endpoint analytics.
WebSocket (Real-Time)
Real-time ETF price streaming (when enabled). Subscribe to ETF symbols for periodic updates.
Subscribe:
{"action":"subscribe","symbols":["SPY","QQQ"]}