Skip to content

Alpaca

US equities and crypto market data from Alpaca Markets.

Source ID

"source": "alpaca"

Credentials

"credentials": {
    "api_key": "your-alpaca-api-key",
    "secret_key": "your-alpaca-secret-key"
}

Get your credentials at Alpaca.

Ticker Format

Standard US equity ticker symbols:

Example Instrument
AAPL Apple Inc.
MSFT Microsoft Corp.
SPY S&P 500 ETF
BTC/USD Bitcoin (crypto)
ETH/USD Ethereum (crypto)

Supported Intervals

1m, 5m, 15m, 30m, 1h, 1d, 1w, 1M

Parameters

Parameter Values Default Description
dtype "bars", "trades", "quotes" "bars" Data type
assetclass "equity", "crypto" "equity" Asset class
feed "iex", "sip" "iex" Data feed (SIP requires paid plan)

Rate limits

Alpaca allows 200 API calls per minute. Aurastream handles rate limiting and retries automatically, including exponential backoff. Large ticker lists are batched (50 per request by default).

Examples

US equities (daily)

response = requests.post(URL, headers=HEADERS, json={
    "tickerlist": ["AAPL", "MSFT", "GOOGL", "AMZN"],
    "start": "2025-01-01",
    "end": "2025-06-01",
    "interval": "1d",
    "source": "alpaca",
    "credentials": {
        "api_key": "YOUR_ALPACA_KEY",
        "secret_key": "YOUR_ALPACA_SECRET"
    }
})

Crypto via Alpaca

response = requests.post(URL, headers=HEADERS, json={
    "tickerlist": ["BTC/USD", "ETH/USD"],
    "start": "2025-06-01",
    "end": "2025-06-30",
    "interval": "1h",
    "source": "alpaca",
    "assetclass": "crypto",
    "credentials": {
        "api_key": "YOUR_ALPACA_KEY",
        "secret_key": "YOUR_ALPACA_SECRET"
    }
})