ワンクリックで
alpaca-market-data
// Check stock prices, crypto quotes, option chains, and market history via Alpaca.
// Check stock prices, crypto quotes, option chains, and market history via Alpaca.
Gmail, Calendar, Chat, Classroom, Drive, Docs, Slides, Sheets, Contacts, Tasks, People, Groups, Keep — all via gog CLI.
Create, edit, delete, and search calendar events in Apple Calendar on macOS. Use for "add a meeting", "what's on my calendar", or "move my 3pm".
Add, edit, complete, and list reminders on macOS via remindctl. Use for "remind me to…", "show my todos", or "mark X done".
Track live flight status, delays, gates, and position. Use for "track AA100", "is my flight on time?", or "where is BA123 right now?".
Fetch airport weather (METAR, TAF, PIREPs) for flight planning and briefings. Use for "weather at KJFK", "TAF for EGLL", or pre-flight weather checks.
Deploy to Cloudflare Workers, tunnels, DNS and Pages.
| name | alpaca-market-data |
| description | Check stock prices, crypto quotes, option chains, and market history via Alpaca. |
| metadata | {"homepage":"https://docs.alpaca.markets/docs/alpaca-api-platform","dependencies":{"curl":{"description":"HTTP client","check":"which curl"},"jq":{"description":"JSON processor","check":"which jq"},"wscat":{"description":"WebSocket client","check":"which wscat","install":"npm i -g wscat"}}} |
Use Alpaca’s Market Data APIs to retrieve historical and real-time data for:
Basic (Free)
Algo Trader Plus ($99/mo)
Reference: https://docs.alpaca.markets/docs/about-market-data-api
Use this when APCA_API_KEY_ID / APCA_API_SECRET_KEY are missing and Rocie is allowed to create/log in to Alpaca via the browser.
Alpaca maintains separate API keys for paper trading vs live trading. If the user wants paper trading, switch to Paper first; if live, switch to Live first, then generate keys for that environment. ([Alpaca API Docs][3])
Open the Alpaca dashboard (after login).
In the right sidebar, find API Keys.
Click Generate New Keys.
Copy both values:
APCA_API_KEY_IDAPCA_API_SECRET_KEYImportant: if you navigate away and later need the secret again, you must regenerate keys (the secret isn’t always retrievable after first display).
Store keys in the environment (prefer process env / secrets manager rather than plaintext files):
APCA_API_KEY_ID=...APCA_API_SECRET_KEY=...Confirm Rocie generated keys while the dashboard was in Paper Trading, and remind that paper keys differ from live keys.
REST base: https://data.alpaca.markets
WebSocket base: wss://stream.data.alpaca.markets/{version}/{feed}
wss://stream.data.alpaca.markets/v2/test (symbol FAKEPACA)
Reference: https://docs.alpaca.markets/docs/streaming-market-dataGET /v2/stocks/barsGET /v2/stocks/quotes/latestGET /v2/stocks/trades/latestGET /v2/stocks/snapshotsMarket data (options snapshots/chain):
GET /v1beta1/options/snapshots/{underlying_symbol}GET /v1beta1/options/snapshotsGET /v1beta1/options/quotes/latestContracts reference (search/list contracts; host depends on live vs paper):
GET https://paper-api.alpaca.markets/v2/options/contracts
Reference: https://docs.alpaca.markets/reference/get-options-contractsGET /v1beta3/crypto/{loc}/latest/orderbooks
Reference: https://docs.alpaca.markets/reference/cryptolatestorderbooks-1Most endpoints require these headers:
APCA-API-KEY-ID: $APCA_API_KEY_IDAPCA-API-SECRET-KEY: $APCA_API_SECRET_KEYStock latest quote (single symbol):
curl -s "https://data.alpaca.markets/v2/stocks/AAPL/quotes/latest" -H "APCA-API-KEY-ID: $APCA_API_KEY_ID" -H "APCA-API-SECRET-KEY: $APCA_API_SECRET_KEY" | jq .
Stock historical bars (multi-symbol):
curl -s "https://data.alpaca.markets/v2/stocks/bars?symbols=AAPL,MSFT&timeframe=1Day&limit=10" -H "APCA-API-KEY-ID: $APCA_API_KEY_ID" -H "APCA-API-SECRET-KEY: $APCA_API_SECRET_KEY" | jq .
Options chain (by underlying):
curl -s "https://data.alpaca.markets/v1beta1/options/snapshots/SPY" -H "APCA-API-KEY-ID: $APCA_API_KEY_ID" -H "APCA-API-SECRET-KEY: $APCA_API_SECRET_KEY" | jq .
Crypto latest orderbooks (location per docs; common: us):
curl -s "https://data.alpaca.markets/v1beta3/crypto/us/latest/orderbooks?symbols=BTC/USD,ETH/USD" -H "APCA-API-KEY-ID: $APCA_API_KEY_ID" -H "APCA-API-SECRET-KEY: $APCA_API_SECRET_KEY" | jq .
wscat -c "wss://stream.data.alpaca.markets/v2/test"
# send:
# {"action":"subscribe","trades":["FAKEPACA"]}