Getting Started with StockAPIS
StockAPIS gives you real-time and historical market data from 80+ crypto exchanges, stock markets, brokers, data providers and news sources through one unified REST API — this guide gets you from zero to your first request in about 5 minutes.
This guide walks you through making your first API call and pulling market data from Binance, Coinbase, NYSE, Bloomberg and other sources on a single normalized schema.
Prerequisites
Before you begin, you will need:
- StockAPIS account — sign up free (no credit card required)
- Development environment — Python 3.7+, Node.js 14+, or any HTTP client
- Basic knowledge — familiarity with REST APIs and JSON
Time required: ~5 minutes.
Step 1: Create Account and Get API Key
Create your account
- Visit stockapis.com/signup
- Enter your email and create a password
- Verify your email address
- A free trial starts automatically
Generate an API key
- Log in to your dashboard
- Open the API Keys section
- Click Generate New Key
- Copy your API key (keep it secret)
Your API key is like a password — never share it publicly or commit it to version control. Store it in an environment variable:
export STOCKAPIS_API_KEY="your_api_key_here"Step 2: Install the SDK (optional)
# Python
pip install stockapis
# JavaScript
npm install stockapisOr call the REST API directly with any HTTP client.
Step 3: Make Your First Request
Python
from stockapis import StockAPIS
client = StockAPIS(api_key="your_api_key")
# Real-time ticker for a Binance pair
btc = client.binance.get_market_data(symbol="BTCUSDT")
print(f"Symbol: {btc['symbol']}")
print(f"Price: ${btc['lastPrice']}")
print(f"24h vol: {btc['volume']}")
print(f"24h chg: {btc['priceChangePercent']}%")JavaScript
const { StockAPIS } = require('stockapis');
const client = new StockAPIS({ apiKey: 'your_api_key' });
client.binance.getMarketData({ symbol: 'BTCUSDT' })
.then(t => {
console.log(`Price: $${t.lastPrice}`);
console.log(`24h change: ${t.priceChangePercent}%`);
})
.catch(err => console.error('Error:', err));REST
curl -X GET \
'https://api.stockapis.com/v1/binance/ticker?symbol=BTCUSDT' \
-H 'Authorization: Bearer YOUR_API_KEY'Response
{
"symbol": "BTCUSDT",
"lastPrice": "45000.00",
"priceChangePercent": "2.85",
"bidPrice": "44999.50",
"askPrice": "45000.50",
"highPrice": "45200.00",
"lowPrice": "43600.00",
"volume": "1250.5",
"quoteVolume": "56272500.00",
"openTime": 1640995200000,
"closeTime": 1641081600000
}Step 4: Pull More Market Data
Order book and trades
# Live order book (top 100 levels)
book = client.binance.get_order_book(symbol="BTCUSDT", limit=100)
print(book["bids"][0], book["asks"][0])
# Recent trades
trades = client.binance.get_recent_trades(symbol="BTCUSDT", limit=50)Historical candles (OHLCV)
candles = client.binance.get_klines(
symbol="BTCUSDT",
interval="1h",
limit=100,
)
for c in candles[:3]:
print(c["openTime"], c["open"], c["high"], c["low"], c["close"], c["volume"])Because every source is normalized to the same schema, the same calls work across exchanges — swap client.binance for client.coinbase or client.kraken.
Error Handling
from stockapis import StockAPIS, APIError
client = StockAPIS(api_key="your_api_key")
try:
btc = client.binance.get_market_data(symbol="BTCUSDT")
print(btc["lastPrice"])
except APIError as e:
if e.status_code == 404:
print("Symbol not found")
elif e.status_code == 429:
print("Rate limit exceeded")
else:
print(f"API error: {e}")Rate Limits
| Plan | Requests / minute |
|---|---|
| Starter | 100 |
| Professional | 500 |
| Enterprise | 2000 |
Check your current usage in the dashboard.
Supported Sources
StockAPIS covers 80+ financial data sources, grouped by asset type:
- Crypto exchanges — Binance, Coinbase, Kraken, Bybit, OKX and 25+ more
- Crypto data & on-chain — CoinGecko, Glassnode, Messari, Kaiko
- Stock exchanges — NYSE, CME Group
- Brokers — Interactive Brokers, Robinhood, Webull, Charles Schwab
- Financial data APIs — Polygon, Finnhub, Twelve Data, Yahoo Finance, FRED
- Financial news — Bloomberg, Reuters, CNBC, MarketWatch
- Social & signals — StockTwits, Reddit, Twitter/X
Browse all platforms.
Next Steps
- All platforms — every source StockAPIS covers
- Solutions — market data feeds, trading signals, quant research
- Pricing — plans and limits
- Contact — talk to the team
Get Started Now
- Sign up for a free trial at stockapis.com/signup
- Generate your API key
- Make your first request (Step 3 above)
- Build your application
Ready to pull market data at scale? Start your free trial at stockapis.com/signup.