StockAPIS for Traders & Investors
Automate market analysis, screen for setups, and run systematic strategies with real-time prices, order books, news, and sentiment from 80+ exchanges, brokers, and data providers.
Why Traders Choose StockAPIS
Whether you trade discretionary swing setups or run fully systematic strategies, data is your edge. StockAPIS gives you institutional-grade market intelligence — prices, OHLCV, order books, news, and on-chain signals — through one consistent API across crypto exchanges, stock exchanges, brokers, and data APIs.
Key Benefits
- Unified Market Data: Stream prices and OHLCV from Binance, Coinbase, NYSE, and Polygon through one interface
- Strategy Analytics: Compute returns, volatility, and risk metrics across an entire watchlist in seconds
- Portfolio Monitoring: Mark positions to live prices instead of waiting for end-of-day statements
- Signal Discovery: Combine news and social signals with price action
- Real-Time Alerts: Get notified the moment a symbol breaks your trigger conditions
Common Challenges and Solutions
Screening the Whole Market Fast
The Problem: By the time a breakout shows up on your charts, the move is often half-done. Manually scanning hundreds of symbols every day is impossible.
The Solution: Automated screening across exchanges with real-time OHLCV.
from stockapis import StockAPIS
api = StockAPIS(api_key='your_api_key')
# Screen for momentum breakouts across a universe
def find_breakouts(symbols, exchange='binance'):
candidates = []
for symbol in symbols:
candles = api.platforms.binance.get_ohlcv(
symbol=symbol,
interval='1d',
limit=60
)
last = candles[-1]
high_20 = max(c.high for c in candles[-21:-1])
avg_vol = sum(c.volume for c in candles[-21:-1]) / 20
# New 20-day high on above-average volume
if last.close > high_20 and last.volume > avg_vol * 1.5:
candidates.append({
'symbol': symbol,
'close': last.close,
'breakout_pct': (last.close / high_20 - 1) * 100,
'vol_ratio': last.volume / avg_vol
})
return sorted(candidates, key=lambda x: x['vol_ratio'], reverse=True)
breakouts = find_breakouts(['BTCUSDT', 'ETHUSDT', 'SOLUSDT', 'AVAXUSDT'])
for b in breakouts[:5]:
print(f"{b['symbol']}")
print(f" Close: {b['close']:,} | Breakout: {b['breakout_pct']:.1f}%")
print(f" Volume: {b['vol_ratio']:.1f}x average")Measuring Strategy Performance
The Problem: Gut feel isn’t a backtest. You can’t size positions without knowing volatility, drawdown, and risk-adjusted return.
The Solution: Automated performance metrics from historical OHLCV.
def strategy_metrics(symbol, interval='1d', limit=365):
candles = api.platforms.binance.get_ohlcv(
symbol=symbol,
interval=interval,
limit=limit
)
closes = [c.close for c in candles]
# Daily returns
returns = [(closes[i] / closes[i - 1]) - 1 for i in range(1, len(closes))]
avg_return = sum(returns) / len(returns)
variance = sum((r - avg_return) ** 2 for r in returns) / len(returns)
volatility = variance ** 0.5
# Annualized metrics (252 trading periods)
ann_return = avg_return * 252
ann_vol = volatility * (252 ** 0.5)
sharpe = ann_return / ann_vol if ann_vol else 0
# Max drawdown
peak = closes[0]
max_dd = 0
for price in closes:
peak = max(peak, price)
max_dd = max(max_dd, (peak - price) / peak)
return {
'symbol': symbol,
'ann_return': ann_return * 100,
'ann_vol': ann_vol * 100,
'sharpe': sharpe,
'max_drawdown': max_dd * 100
}
m = strategy_metrics('BTCUSDT')
print(f"Annual Return: {m['ann_return']:.1f}%")
print(f"Volatility: {m['ann_vol']:.1f}%")
print(f"Sharpe: {m['sharpe']:.2f}")
print(f"Max Drawdown: {m['max_drawdown']:.1f}%")Portfolio Monitoring
The Problem: You hold positions across multiple exchanges and brokers. You don’t know your true mark-to-market exposure until you log into each one.
The Solution: Automated, real-time portfolio valuation.
# Define positions: symbol, quantity, average entry
portfolio = [
{'symbol': 'BTCUSDT', 'qty': 0.75, 'entry': 41200},
{'symbol': 'ETHUSDT', 'qty': 8.0, 'entry': 2350},
{'symbol': 'SOLUSDT', 'qty': 120, 'entry': 96},
]
total_value = 0
total_cost = 0
for pos in portfolio:
quote = api.platforms.binance.get_ticker(symbol=pos['symbol'])
price = quote.last_price
market_value = price * pos['qty']
cost_basis = pos['entry'] * pos['qty']
pnl = market_value - cost_basis
total_value += market_value
total_cost += cost_basis
print(f"{pos['symbol']}")
print(f" Price: {price:,} | Value: ${market_value:,.0f}")
print(f" Unrealized P&L: ${pnl:+,.0f}")
print(f"\nPortfolio Value: ${total_value:,.0f}")
print(f"Total Unrealized P&L: ${total_value - total_cost:+,.0f}")News & Sentiment Overlay
The Problem: Price tells you what happened, not why. Reacting to a Bloomberg headline or a sentiment shift minutes late can cost the whole edge.
The Solution: Merge real-time news and social sentiment with price action.
# Pull recent news and social sentiment for a symbol
symbols = ['BTC', 'ETH', 'SOL']
for symbol in symbols:
news = api.platforms.bloomberg.get_news(query=symbol, limit=20)
social = api.platforms.stocktwits.get_sentiment(symbol=symbol)
bullish = sum(1 for n in news if n.sentiment == 'positive')
bearish = sum(1 for n in news if n.sentiment == 'negative')
print(f"\n{symbol}")
print(f" Headlines (24h): {len(news)}")
print(f" News tilt: {bullish} bullish / {bearish} bearish")
print(f" Social sentiment: {social.bullish_pct:.0f}% bullish")
print(f" Message volume: {social.message_count} ({social.change_pct:+.0f}%)")Use Case Examples
Discretionary Swing Trader
Screen hundreds of symbols nightly, surface the cleanest breakouts and pullbacks, and overlay news catalysts before placing manual orders.
Systematic / Quant Trader
Pull years of OHLCV across exchanges, backtest signals, and run live strategies that react to order-book and price changes in real time.
Long-Term Investor
Mark a multi-asset portfolio to live prices, track allocation drift, and rebalance on fundamentals and macro data instead of headlines.
Arbitrage Trader
Compare order books and last prices across Binance, Coinbase, and Kraken to spot cross-exchange spreads.
On-Chain Trader
Combine crypto data signals — flows, wallet activity, and exchange reserves — with price action to anticipate moves.
Quick Start
from stockapis import StockAPIS
api = StockAPIS(api_key='your_api_key')
# Pull a live quote and recent OHLCV
quote = api.platforms.binance.get_ticker(symbol='BTCUSDT')
print(f"BTC/USDT last: {quote.last_price:,} ({quote.change_pct:+.2f}% 24h)")
candles = api.platforms.binance.get_ohlcv(symbol='BTCUSDT', interval='1h', limit=24)
session_high = max(c.high for c in candles)
session_low = min(c.low for c in candles)
print(f"24h range: {session_low:,} - {session_high:,}")For detailed API documentation, see our API Reference. Ready to build? Explore the platforms, view pricing, or contact our team.