alpaca-broker-market-data

Pull and stream US stock market data from Alpaca REST and WebSocket APIs.

4|Updated Aug 28, 2026
One-click install
npx skills add https://github.com/alan-d-smith/synthetix-alpha --skill alpaca-broker-market-data-alan-d-smith
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: alpaca-broker-market-data
Source: https://github.com/alan-d-smith/synthetix-alpha/tree/main/.agents/skills/alpaca-broker-market-data
Command: npx skills add https://github.com/alan-d-smith/synthetix-alpha --skill alpaca-broker-market-data-alan-d-smith

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Integrating Alpaca's market data surface is error-prone: it spans multiple hosts with different auth, feed entitlements (IEX vs SIP) that silently 403, pagination that splits results by symbol, and a WebSocket protocol with strict connection limits. This Skill encodes the verified endpoints, parameters, object shapes, and production lessons so you build quotes, charts, and price feeds correctly the first time. ## Core Features & Use Cases - REST Market Data: Snapshots, historical bars with timeframes and adjustments, latest trades/quotes, auctions, news, and screeners on the data host. - Real-Time Streaming: WebSocket connect/auth/subscribe flow, message types (trades, quotes, bars, corrections), and error-code handling for the live feed. - Assets, Clock & Calendar: Host-correct paths for tradability metadata, market hours, and holiday calendars on Trading vs Broker API hosts. - Use Case: Build a charting feature that backfills daily bars for a symbol list, caches them in your own store, and streams live minute bars over a single shared WebSocket connection. ## Quick Start Use the alpaca-broker-market-data skill to fetch the last 30 days of 1Day bars for AAPL from the IEX feed and then subscribe to real-time trades over the WebSocket stream.

Frequently Asked Questions about alpaca-broker-market-data

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

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

Call GET /v2/stocks/bars on https://data.alpaca.markets with symbols, timeframe (e.g. 1Min, 1Day), start/end dates, and your APCA-API-KEY-ID and APCA-API-SECRET-KEY headers. Follow next_page_token until empty, since results are sorted by symbol then timestamp and one page may not cover all symbols.

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

Connect to wss://stream.data.alpaca.markets/v2/{feed}, authenticate within 10 seconds with an auth action containing your key and secret, then send a subscribe action listing trades, quotes, or bars. Messages arrive as batched JSON arrays discriminated by the T field.

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

IEX is a single exchange covering about 2.5% of volume and is the only feed available without a paid subscription. SIP is the consolidated feed across all exchanges and requires a paid data plan; requesting it without entitlement returns a 403.

Why does my Alpaca historical data request return a 403 error?▼

The request likely defaulted to the SIP feed, which requires a paid data plan. Pass feed=iex explicitly on the free tier, and note that without real-time access the most recent 15 minutes of data are withheld from start/end windows.

Why does my second Alpaca WebSocket connection fail?▼

Most Alpaca plans allow only one concurrent WebSocket connection per API key; a second connection returns error code 406, connection limit exceeded. Centralize the stream in one process and fan out data to your own clients instead of opening a socket per user.

How do I check market hours and holidays with the Alpaca API?▼

Use GET /v2/clock for is_open, next_open, and next_close, and GET /v2/calendar for per-day open/close times on the Trading API host. On the Broker API host use /v1/clock and /v1/calendar, since /v2/calendar returns 404 there.