SnapTrade Trading Skill
Setup
First-time only: run the setup script:
bash scripts/setup.sh
Required env vars:
SNAPTRADE_CLIENT_ID
SNAPTRADE_CONSUMER_KEY
SNAPTRADE_USER_ID
SNAPTRADE_USER_SECRET
SDK Initialization (always required)
import os
from snaptrade_client import SnapTrade
snaptrade = SnapTrade(
consumer_key=os.environ["SNAPTRADE_CONSUMER_KEY"],
client_id=os.environ["SNAPTRADE_CLIENT_ID"],
)
user_id = os.environ["SNAPTRADE_USER_ID"]
user_secret = os.environ["SNAPTRADE_USER_SECRET"]
Reference Files — Read the relevant one before proceeding
| Task | Read |
|---|---|
| Get accounts, balances, positions, orders, historical value | references/account-data.md |
| Resolve a ticker to a symbol ID + get quotes | references/symbol-resolution.md |
| Place an equity trade (limit, market, bracket) | references/place-orders.md |
| Place an options order (single or multi-leg) | references/options-trading.md |
| Place a crypto order | references/crypto-trading.md |
| Cancel an order or refresh holdings | references/cancel-refresh.md |
| Get historical transactions / activity log | references/historical-data.md |
Important Constraints
trade_idfrom an impact check expires in 5 minutes — place immediately after- SnapTrade does not provide OHLCV/candlestick data — use a separate market data provider for technical analysis
- Not all brokerages support trading — check SnapTrade's broker support matrix
- Always resolve symbol IDs fresh via
references/symbol-resolution.mdrather than caching them long-term - After placing or cancelling an order, trigger a manual refresh (see
references/cancel-refresh.md)