asarchami/dotfiles/market-data

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Alpaca Market Data API for historical and real-time market data. Covers stocks, crypto, options, and news — both REST (historical bars/quotes/trades) and WebSocket (real-time streaming). Includes subscription plans, rate limits, and authentication patterns for Trading API and Broker API users.

Install

npx vskill@latest install asarchami/dotfiles/market-data

SKILL.md

Persona: You are a quantitative developer building data pipelines. You treat market data as the foundation for trading decisions and backtesting. You think in terms of data completeness, latency, and alignment across timeframes.

Thinking mode: Use ultrathink for historical data pagination, WebSocket reconnection logic, and data alignment across multiple symbols. Shallow reasoning produces gaps and misaligned time series.

Base URLs

EnvironmentURL
Livehttps://data.alpaca.markets
Sandbox (Broker API)https://data.sandbox.alpaca.markets

Authentication

Trading API users (legacy auth):

go
req.Header.Set("APCA-API-KEY-ID", apiKeyID)
req.Header.Set("APCA-API-SECRET-KEY", apiSecret)

Broker API users (OAuth2 Client Credentials):

go
req.Header.Set("Authorization", "Bearer {TOKEN}")

Historical crypto data does not require authentication.

Subscription Plans

Trading API
FeatureBasic (free)Algo Trader Plus ($99/mo)
Stocks coverageIEX onlyAll US exchanges
WebSocket symbols30Unlimited
Historical windowSince 2016Since 2016
Historical limitLast 15 minNo restriction
API calls200/min10,000/min
Options coverageIndicative feedOPRA feed
Broker API
PlanRPMStream connectionsStream symbolsPrice
Standard1,0005unlimitedincluded
StandardPlus30003,0005unlimited$500/mo
StandardPlus50005,0005unlimited$1,000/mo
StandardPlus1000010,00010unlimited$2,000/mo

Historical API (REST)

Stock Data
GET /v2/stocks/{symbol}/bars
GET /v2/stocks/{symbol}/quotes
GET /v2/stocks/{symbol}/trades
GET /v2/stocks/bars (multi-symbol)

Query parameters: timeframe (1Min, 5Min, 15Min, 1Hour, 1Day), start, end, limit (max 10,000), adjustment (raw, split, dividend), feed (iex, sip).

go
func (c *Client) Bars(ctx context.Context, symbol string, start, end time.Time, interval string) ([]exchange.Bar, error) {
u, _ := url.JoinPath(c.dataBaseURL, "/v2/stocks", symbol, "bars")
req, _ := http.NewRequestWithContext(ctx, http.MethodGet, u, nil)
q := req.URL.Query()
q.Set("timeframe", interval)
q.Set("start", start.Format(time.RFC3339))
q.Set("end", end.Format(time.RFC3339))
req.URL.RawQuery = q.Encode()
c.setAuthHeaders(req)
resp, err := c.doWithRetry(req)
// ... parse response
}

Pagination: When response contains next_page_token, repeat the request with page_token={token} until no token returned.

Crypto Data
GET /v2/crypto/{symbol}/bars
GET /v2/crypto/{symbol}/quotes
GET /v2/crypto/{symbol}/trades

Same parameters as stocks. Crypto data does not require authentication for historical endpoints. Timeframes: 1Min, 5Min, 15Min, 1Hour, 1Day.

Options Data
GET /v2/options/{symbol}/bars
GET /v2/options/{symbol}/quotes
GET /v2/options/{symbol}/snapshots

Option symbols use the OCC format (e.g., AAPL250620C00150000). Requires options data subscription.

News Data
GET /v1beta1/news

Parameters: symbols, start, end, limit, sort, include_content.

WebSocket Streams

wss://stream.data.alpaca.markets/v2/{feed}

Feeds:

  • iex — IEX data only (free)
  • sip — SIP data (all exchanges, paid)
Authentication Message
json
{"action": "auth", "key": "{KEY}", "secret": "{SECRET}"}
Stock Channels
ChannelDescription
TTrades
QQuotes
AMMinute bars (aggregated)
ASecond bars (aggregated)
Crypto Channels
ChannelDescription
T.{symbol}Trades
Q.{symbol}Quotes
AM.{symbol}Minute bars
Options Channels
ChannelDescription
O.{symbol}Options trades
OQ.{symbol}Options quotes
News Channel
ChannelDescription
newsReal-time news headlines
Subscription Message
json
{"action": "subscribe", "trades": ["AAPL", "SPY"], "quotes": ["TSLA"]}
Reconnection
  • WebSocket sends : you are reading too slowly, dropped N messages as SSE-style comment when client falls behind
  • On disconnect: reconnect and re-auth, then resubscribe to channels
  • Missed data can be backfilled via Historical API

Rate Limits

PlanHistorical API limit
Trading API Basic200 RPM
Trading API Algo Trader+10,000 RPM
Broker API Standard1,000 RPM
Broker API higher tiers3,000–10,000 RPM

429 responses include Retry-After header.

Existing Codebase Patterns

This project fetches market data in internal/bars/service.go using the Alpaca client from internal/exchange/alpaca/alpaca.go. Key pattern:

go
bars, err := s.barReader.Bars(ctx, sym.Symbol, start, now, "5m")

The exchange interface (internal/exchange/exchange.go) defines:

go
type Exchange interface {
Bars(ctx context.Context, symbol string, start, end time.Time, interval string) ([]Bar, error)
SubmitOrder(ctx context.Context, order Order) (string, error)
Account(ctx context.Context) (Account, error)
}

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/asarchami/dotfiles/market-data/badge)](https://verified-skill.com/skills/asarchami/dotfiles/market-data)

Something wrong with this skill or its page? Tell us.