Alpaca CLI
alpacahq/cli
Install, configure, and use the Alpaca CLI - a command-line tool for the Alpaca Trading API.
Pull and stream US stock market data from Alpaca — REST snapshots/bars/trades/quotes, historical bars with timeframes and feeds (IEX vs SIP), the assets master list, market clock & calendar, news…
$ npx skills add alpacahq/alpaca-skills --skill alpaca-broker-market-data -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install alpacahq/alpaca-skills alpaca-broker-market-data --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/alpacahq/alpaca-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/broker-api/market-data .claude/skills/alpaca-broker-market-data && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "alpaca-broker-market-data" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/market-data into .claude/skills/alpaca-broker-market-data/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "alpaca-broker-market-data", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/market-dataType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add alpacahq/alpaca-skills --skill alpaca-broker-market-data -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install alpacahq/alpaca-skills alpaca-broker-market-data --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/alpacahq/alpaca-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/broker-api/market-data .agents/skills/alpaca-broker-market-data && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "alpaca-broker-market-data" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/market-data into .agents/skills/alpaca-broker-market-data/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "alpaca-broker-market-data", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add alpacahq/alpaca-skills --skill alpaca-broker-market-data -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install alpacahq/alpaca-skills alpaca-broker-market-data --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/alpacahq/alpaca-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/broker-api/market-data .cursor/skills/alpaca-broker-market-data && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "alpaca-broker-market-data" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/market-data into .cursor/skills/alpaca-broker-market-data/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "alpaca-broker-market-data", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/alpacahq/alpaca-skills.git --path skills/broker-api/market-data--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add alpacahq/alpaca-skills --skill alpaca-broker-market-data -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install alpacahq/alpaca-skills alpaca-broker-market-data --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/alpacahq/alpaca-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/broker-api/market-data .gemini/skills/alpaca-broker-market-data && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "alpaca-broker-market-data" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/market-data into .gemini/skills/alpaca-broker-market-data/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "alpaca-broker-market-data", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install alpacahq/alpaca-skills alpaca-broker-market-dataInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add alpacahq/alpaca-skills --skill alpaca-broker-market-data -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/alpacahq/alpaca-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/broker-api/market-data .github/skills/alpaca-broker-market-data && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "alpaca-broker-market-data" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/market-data into .github/skills/alpaca-broker-market-data/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "alpaca-broker-market-data", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add alpacahq/alpaca-skills --skill alpaca-broker-market-data -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install alpacahq/alpaca-skills alpaca-broker-market-data --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/alpacahq/alpaca-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/broker-api/market-data .opencode/skills/alpaca-broker-market-data && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "alpaca-broker-market-data" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/market-data into .opencode/skills/alpaca-broker-market-data/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "alpaca-broker-market-data", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
alpaca-broker-market-dataPull and stream US stock market data from Alpaca — REST snapshots/bars/trades/quotes, historical bars with timeframes and feeds (IEX vs SIP), the assets master list, market clock & calendar, news…
Alpaca Broker Market Data is an agent skill from alpacahq/alpaca-skills. Pull and stream US stock market data from Alpaca — REST snapshots/bars/trades/quotes, historical bars with timeframes and feeds (IEX vs SIP), the assets master list, market clock & calendar, news, and the real-time WebSocket stream. Use when building charts, quotes, price feeds, or asset metadata on Alpaca in any language.
Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `reference.md`).
It sits in Business, Finance & HR, covering Stock and market analysis and Realtime and WebSockets. It works with Alpaca. The repository describes itself as: Agent skills for Alpaca's Trading API and Broker API: drop-in SKILL.md files for AI coding assistants. The licence is Apache-2.0.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 39111ab. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
docs.alpaca.marketsdata.alpaca.marketsapi.alpaca.marketsFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Alpaca Broker Market Data loads about 2.3k tokens when it runs. Until then it costs about 88 tokens; SKILL.md has 953 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from alpacahq/alpaca-skills at commit 39111ab, republished under its Apache-2.0 licence (© alpacahq). 953 words, ~2,298 tokens.
.claude/skills/alpaca-broker-market-data/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Real-time and historical US equity data. Unlike the Broker endpoints, market data lives on its own host with its own auth, and the real-time feed is WebSocket, not SSE.
Read
alpaca-broker-integrationfirst. Assets/clock/calendar live on the Trading API host; everything else here is the Market Data API host.
https://docs.alpaca.markets/docs/historical-stock-data, https://docs.alpaca.markets/docs/streaming-market-dataalpaca-docs MCP → list-endpoints title "Market Data API"| Surface | Host |
|---|---|
| Market data REST | https://data.alpaca.markets (sandbox data.sandbox.alpaca.markets) |
| Market data WebSocket | wss://stream.data.alpaca.markets/{version}/{feed} |
| Assets / clock / calendar | https://api.alpaca.markets (Trading API) — paper: paper-api.alpaca.markets |
Auth: headers APCA-API-KEY-ID / APCA-API-SECRET-KEY (Broker partners may use Broker Basic auth in broker context).
| Path | Purpose |
|---|---|
GET /v2/stocks/snapshots?symbols=… · GET /v2/stocks/{symbol}/snapshot | Snapshot (latest trade/quote + bars) |
GET /v2/stocks/bars?symbols=… · GET /v2/stocks/{symbol}/bars | Historical OHLCV bars |
GET /v2/stocks/bars/latest · …/{symbol}/bars/latest | Latest bar(s) |
GET /v2/stocks/trades[/latest] · GET /v2/stocks/quotes[/latest] | Historical / latest trades & quotes |
GET /v2/stocks/auctions | Opening/closing auctions |
GET /v2/stocks/meta/conditions/{trade|quote} · /meta/exchanges | Code lookups |
GET /v1beta1/news?symbols=… | News (max limit 50) |
GET /v1beta1/screener/stocks/most-actives · /screener/{stocks|crypto}/movers | Screeners |
GET /v2/assets (Trading API host) · GET /v1/assets (Broker API host) | Asset master / tradability |
GET /v2/clock · GET /v2/calendar (Trading API host) | Market hours |
Clock/calendar/assets paths are host-dependent — verified live against the sandbox:
Path Trading API host ( api.alpaca.markets)Broker API host ( broker-api.*)/v1/clock— 200 /v2/clock200 200 /v1/calendar— 200 /v2/calendar200 404 /v1/assets— 200 /v2/assets200 404 So: on the Trading/Market-Data API host use
/v2/clock,/v2/calendar,/v2/assets. On the Broker API host use/v1/clock,/v1/calendar,/v1/assets(/v1/clockand/v2/clockboth work there;/v2/calendarand/v2/assets404). A Broker-API integration hitting/v1/clockis correct, not stale.
| Param | Notes |
|---|---|
timeframe | [1-59]Min/T, [1-23]Hour/H, 1Day/D, 1Week/W, [1,2,3,4,6,12]Month/M. Case-sensitive. e.g. 1Min, 5Min, 1Hour, 1Day |
start / end | RFC3339 or YYYY-MM-DD, inclusive |
limit | default 1000, max 10000 — counts data points across all symbols, not per symbol |
page_token | pagination cursor (from next_page_token) |
adjustment | raw (default), split, dividend, spin-off, all — comma-combinable |
feed | see §3 |
sort | asc (default) / desc |
asof | YYYY-MM-DD for symbol/name-change mapping; - skips mapping |
Pagination lesson: results are sorted by symbol, then timestamp. A multi-symbol request that hits limit may return only the first symbol(s) — you must follow next_page_token until empty to get them all. Don't assume one page = all symbols.
iex — single exchange (~2.5% of volume). The only feed available without a paid subscription. Good for dev/testing.sip — consolidated, all exchanges (100% volume). Requires a paid data plan.delayed_sip — SIP delayed 15 min (latest/snapshot endpoints).otc, boats (Blue Ocean overnight ATS), overnight (Alpaca-derived, cheaper).Lessons:
iex explicitly if you're on the free tier — some endpoints default to sip, which then 403s without entitlement. (A common surprise: "why is my historical request failing?" → defaulted to SIP.)start/end windows withhold the most recent 15 minutes.Snapshot per symbol: latestTrade, latestQuote, minuteBar, dailyBar, prevDailyBar. Multi-symbol response is a map { "AAPL": {…} }.
t time, o open, h high, l low, c close, v volume, n trade count, vw VWAP.t time, p price, s size, x exchange, c conditions, z tape, i id.bp/bs/bx bid price/size/exchange, ap/as/ax ask price/size/exchange, c conditions, z tape. (price 0 = no active bid/ask.)URL: wss://stream.data.alpaca.markets/{version}/{feed} — e.g. v2/iex, v2/sip, v2/delayed_sip, v1beta1/boats, v1beta1/overnight, or v2/test (always-on, use symbol FAKEPACA).
Connect flow:
[{"T":"success","msg":"connected"}]{"action":"auth","key":"…","secret":"…"} → [{"T":"success","msg":"authenticated"}]{"action":"subscribe","trades":["AAPL"],"quotes":["AMD"],"bars":["*"]} → server echoes full subscription state. * = all symbols. unsubscribe removes.Message types (every message is a JSON array; T discriminates): t trade, q quote, b minute bar, d daily bar, u updated bar, s trading status (halt/resume), l LULD, c correction, x cancel/error, i imbalance; control: success, error, subscription. Subscribing to trades auto-adds corrections + cancelErrors.
WebSocket lessons:
{"code":406,"connection limit exceeded"}. Centralize the stream in one process and fan out to your own clients (don't open a socket per user).404).401 not auth'd, 402 auth failed, 405 symbol limit, 407 slow client, 409 insufficient subscription (feed not entitled), 410 invalid action for feed.u (updated bar) and c/x (corrections/cancels): a streamed bar/trade can be revised after the fact.Use the host-appropriate path (see the table in §1): /v2/... on the Trading API host, /v1/... on the Broker API host.
GET /v2/assets on Trading host · GET /v1/assets and /v1/assets/{symbol} on Broker host) — tradability metadata: tradable, fractionable, marginable, shortable, borrow_status (replaces deprecated easy_to_borrow), status (active/inactive), class (us_equity/us_option/crypto/ipo), exchange, attributes[] (e.g. has_options, overnight_tradable). Filter by status, asset_class, exchange. Cache this — it changes slowly; query it before trading to confirm tradable/fractionable (see alpaca-broker-trading-orders)./v2/clock on Trading host · /v1/clock on Broker host) — is_open, next_open, next_close, timestamp. Use this to gate market-hours logic instead of hardcoding 9:30–16:00 ET./v2/calendar on Trading host · /v1/calendar on Broker host — note there is no /v2/calendar on the Broker host) — per-day open/close (HH:MM), session_open/session_close (HHMM, extended hours), settlement_date. Use the calendar for holidays — a naive "weekdays only" check runs jobs on market holidays (harmless but wasteful) and miscomputes "previous trading day."Market data is the highest-volume, highest-cost surface. Production lesson:
(symbol, timeframe, timestamp) with upsert/skip-duplicate, and serve charts from there — only fetch the gap from Alpaca.next_page_token and watch X-RateLimit-Remaining (see alpaca-broker-rate-limits-resilience).Related skills: tradability before ordering → alpaca-broker-trading-orders; rate limits/pagination → alpaca-broker-rate-limits-resilience; the broker event stream (SSE, different from this WS) → alpaca-broker-sse-events.
© alpacahq, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in skills/broker-api/market-data of alpacahq/alpaca-skills.
Open the folder on GitHubat commit 39111ab
Alpaca Broker Market Data next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Alpaca Broker Market Data this skillalpacahq/alpaca-skills | 154 | — | ~2.3k | Automated safety check: Pass | Apache-2.0 | |
| Alpaca CLIalpacahq/cli | 178 | — | ~2.6k | Automated safety check: Pass | Apache-2.0 | |
| Feedsalsk1992/CloddsBot | 3k | — | ~1.8k | Automated safety check: Pass | MIT | |
| Binance Datatoollostleaf/binance-datatool | 148 | — | ~2.5k | Automated safety check: Notes | BSD-3-Clause | |
| Polymarket2025Emma/vibe-coding-cn | 23k | 1 repos | ~1.6k | Automated safety check: Pass | MIT | |
| Longbridge Market Datahelsome/folio | 271 | 1 repos | ~1.6k | Automated safety check: Pass | MIT |
alpacahq/cli
Install, configure, and use the Alpaca CLI - a command-line tool for the Alpaca Trading API.
alsk1992/CloddsBot
Real-time market data feeds from 8 prediction market platforms
lostleaf/binance-datatool
Manage Binance historical market data from data.binance.vision using the binance-datatool CLI.
2025Emma/vibe-coding-cn
Comprehensive Polymarket skill covering prediction markets, API, trading, market data, and real-time WebSocket data streaming.
helsome/folio
Real-time quotes, K-line charts, order book, trade ticks, intraday capital flow, market sentiment temperature, trading session schedule, security lists, exchange rates, and IPO calendar for…
sickn33/agentic-awesome-skills
Real-time quotes, K-line charts, order book, trade ticks, intraday capital flow, market sentiment temperature, trading session schedule, security lists, exchange rates, and IPO calendar for…
alpacahq/alpaca-skills
Open and manage brokerage accounts via the Alpaca Broker API — account creation, KYC/CIP, identity & disclosures, agreements, document upload (incl.
alpacahq/alpaca-skills
Move money between an Alpaca brokerage account and the EXTERNAL banking world via the Broker API — ACH relationships, wire recipient banks, classic transfers (deposits/withdrawals), the v1beta…
alpacahq/alpaca-skills
Entry point for integrating with the Alpaca Broker API (plus Market Data and Trading APIs) in any programming language.
alpacahq/alpaca-skills
Move cash (JNLC) and securities (JNLS) BETWEEN accounts inside your own Alpaca omnibus via the Broker API — single, batch, and reverse-batch journals, the Idempotency-Key header, journal status…
alpacahq/alpaca-skills
Handle money and numeric precision correctly with the Alpaca API — numbers-as-strings on the wire, decimals vs floats, rounding/truncation before sending amounts, fractional-share precision, and…
alpacahq/alpaca-skills
Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts.
Works with
Categories
Pull and stream US stock market data from Alpaca — REST snapshots/bars/trades/quotes, historical bars with timeframes and feeds (IEX vs SIP), the assets master list, market clock & calendar, news…. Alpaca Broker Market Data is an agent skill from alpacahq/alpaca-skills. Pull and stream US stock market data from Alpaca — REST snapshots/bars/trades/quotes, historical bars with timeframes and feeds (IEX vs SIP), the assets master list, market clock & calendar, news, and the real-time WebSocket stream.
Alpaca Broker Market Data fits situations like: building charts; asset metadata on Alpaca in any language.
Run `npx skills add alpacahq/alpaca-skills --skill alpaca-broker-market-data -a claude-code`. Or copy the skill folder (skills/broker-api/market-data in alpacahq/alpaca-skills) into .claude/skills/alpaca-broker-market-data in your project. Claude Code loads it when a task matches its description.
Run `npx skills add alpacahq/alpaca-skills --skill alpaca-broker-market-data -a codex`. Or copy the skill folder (skills/broker-api/market-data in alpacahq/alpaca-skills) into .agents/skills/alpaca-broker-market-data in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alpacahq/alpaca-skills --skill alpaca-broker-market-data -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/alpaca-broker-market-data, .gemini/skills/alpaca-broker-market-data, .github/skills/alpaca-broker-market-data and .opencode/skills/alpaca-broker-market-data in your project.
SKILL.md names no scripts, command-line tools or credentials: Alpaca Broker Market Data is instructions for the agent only.
SKILL.md names 3 domains. In commands or code: docs.alpaca.markets, data.alpaca.markets and api.alpaca.markets; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Alpaca Broker Market Data is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Alpaca Broker Market Data: Alpaca CLI (alpacahq/cli, 178 stars), Feeds (alsk1992/CloddsBot, 3k stars), Binance Datatool (lostleaf/binance-datatool, 148 stars) and Polymarket (2025Emma/vibe-coding-cn, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
alpacahq (a GitHub organization) maintains it in alpacahq/alpaca-skills, which has 154 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on September 8, 2026.
Source: alpacahq/alpaca-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.