alpaca-market-data

Fetches historical and real-time stock, crypto, options, and news data via the Alpaca Market Data API.

1|2|Updated Nov 25, 2017
One-click install
npx skills add https://github.com/asarchami/dotfiles --skill alpaca-market-data-asarchami
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: alpaca-market-data
Source: https://github.com/asarchami/dotfiles/tree/main/dot_config/opencode/skills/alpaca/market-data
Command: npx skills add https://github.com/asarchami/dotfiles --skill alpaca-market-data-asarchami

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building trading systems requires reliable access to market data across asset classes, but handling authentication variants, subscription tiers, pagination, and WebSocket reconnection logic is error-prone. This Skill provides the complete Alpaca Market Data API reference so you can fetch historical bars, quotes, and trades or stream real-time data without gaps or misaligned time series. ## Core Features & Use Cases - Historical REST Data: Retrieve bars, quotes, and trades for stocks, crypto, and options with pagination via next_page_token, timeframe selection, and split/dividend adjustments. - Real-Time WebSocket Streaming: Subscribe to trade, quote, and aggregate bar channels over wss://stream.data.alpaca.markets with auth, resubscription, and backfill patterns for reconnections. - Plan and Rate Limit Guidance: Covers Trading API (Basic vs Algo Trader Plus) and Broker API tiers, including RPM limits, feed choices (IEX vs SIP), and 429 Retry-After handling. - Use Case: A quant developer backfills 5-minute bars for a symbol universe using the paginated /v2/stocks/bars endpoint, then maintains a live WebSocket feed that reconnects and backfills missed data after disconnects. ## Quick Start Ask the assistant to fetch historical 5-minute bars for AAPL from the Alpaca Market Data API and show how to handle pagination and authentication headers.

Frequently Asked Questions about alpaca-market-data

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fetch historical stock bars from the Alpaca API?

Send a GET request to /v2/stocks/{symbol}/bars with timeframe, start, end, and limit parameters. When the response includes next_page_token, repeat the request with page_token set until no token is returned.

How do I stream real-time market data with Alpaca WebSocket?

Connect to wss://stream.data.alpaca.markets/v2/{feed}, send an auth message with your key and secret, then send a subscribe message listing trades or quotes per symbol. On disconnect, reconnect, re-authenticate, resubscribe, and backfill gaps via the Historical API.

Does Alpaca crypto data require an API key?

Historical crypto data endpoints do not require authentication. Real-time crypto streaming and stock data require either Trading API key headers or Broker API OAuth2 Bearer tokens.

What is the difference between IEX and SIP feeds on Alpaca?

The IEX feed is free and covers only IEX exchange data with a 30-symbol WebSocket limit. The SIP feed requires the paid Algo Trader Plus plan and covers all US exchanges with unlimited streaming symbols.

What are the Alpaca Market Data API rate limits?

Trading API Basic allows 200 requests per minute, Algo Trader Plus allows 10,000, and Broker API tiers range from 1,000 to 10,000 RPM. Rate-limited 429 responses include a Retry-After header.