Skip to content

SnapTrade CLI Reference

Command-line tool for managing brokerage accounts, viewing positions, and executing trades via SnapTrade API.

Installation

npm install -g @snaptrade/snaptrade-cli

First-Time Setup

snaptrade status
# Prompts for Client ID and Consumer Key on first run
# Credentials are stored locally for subsequent commands

Global Options

Option Description
--useLastAccount Skip account selection prompt, use previously selected account
--verbose Enable detailed output
-V, --version Show version number

Commands

Status & Configuration

# Check API credentials and connection status
snaptrade status

# Manage CLI profiles (for multiple API keys)
snaptrade profiles list
snaptrade profiles use <name>
snaptrade profiles delete <name>

Broker Connections

# List all supported brokers
snaptrade brokers

# Connect a new broker (opens browser for OAuth)
snaptrade connect
snaptrade connect --broker ETRADE    # Skip broker selection

# List existing connections
snaptrade connections

# Reconnect a disabled connection
snaptrade reconnect <connectionId>

# Remove a broker connection
snaptrade disconnect <connectionId>

Accounts & Positions

# List all connected accounts with balances
snaptrade accounts

# View positions for an account (prompts for selection)
snaptrade positions

# View positions across ALL accounts
snaptrade positions --all

# Skip account prompt using last selected
snaptrade --useLastAccount positions

Orders

# List recent orders (last 24 hours)
snaptrade recent-orders

# List all orders for an account
snaptrade orders

Market Data

# Get quotes (single or multiple symbols)
snaptrade quote AAPL
snaptrade quote AAPL,INTC,GOOG

# List available instruments from a broker
snaptrade instruments

Trading (requires trading-enabled API key)

# Equity order
snaptrade trade equity --ticker AAPL --action BUY --orderType Limit --limitPrice 150

# Options order (multi-leg supported)
snaptrade trade option

# Cancel an order
snaptrade cancel-order --orderId <id>

Trade options: | Option | Values | Default | |--------|--------|---------| | --ticker | Symbol (e.g., AAPL) | Required | | --action | BUY, SELL | Required | | --orderType | Market, Limit, Stop, StopLimit | Market | | --limitPrice | Price for limit orders | - | | --stopPrice | Price for stop orders | - | | --tif | Day, GTC | Day | | --tradingSession | REGULAR, EXTENDED | REGULAR |

MCP Server

# Start local MCP (Model Context Protocol) server
snaptrade mcp

Supported Brokers

Broker Slug Trading
E*Trade ETRADE Yes
Alpaca Paper ALPACA-PAPER Yes
Robinhood ROBINHOOD No
Schwab SCHWAB No
Vanguard VANGUARD No
Coinbase COINBASE Yes
Kraken KRAKEN Yes
Interactive Brokers INTERACTIVE-BROKERS-FLEX No
Webull WEBULL Yes
tastytrade TASTYTRADE Yes

Run snaptrade brokers for the full list.

Example Workflows

Daily Portfolio Check

# Quick check across all accounts
snaptrade --useLastAccount positions --all

Connect New Broker

snaptrade connect --broker ETRADE
# Browser opens for OAuth authentication
# After auth, account appears in `snaptrade accounts`

Get Quotes for Watchlist

snaptrade --useLastAccount quote AAPL,MSFT,GOOG,AMZN,NVDA

Profile Management

Use profiles to manage multiple SnapTrade API keys (e.g., prod vs test):

# Create/switch to a profile
snaptrade profiles use prod
snaptrade profiles use test

# List profiles (* indicates active)
snaptrade profiles list
# default
# * prod

# Delete a profile
snaptrade profiles delete test

Notes

  • Data is cached and refreshed once daily unless you have real-time API access
  • Trading requires a trading-enabled API key (free keys are read-only)
  • Fidelity is not supported by SnapTrade
  • Interactive prompts can be skipped with --useLastAccount for scripting

Resources