Connecting Broker Accounts
Link your broker account via OAuth for secure order routing
Overview
SnipeRoute connects to your broker account using OAuth 2.0 for secure, non-custodial order routing. You authorize SnipeRoute to place orders on your behalf without sharing passwords or giving withdrawal permissions.
OAuth ensures that SnipeRoute can only place orders — it cannot withdraw funds, transfer assets, or modify account settings.
Supported Brokers
Commission-free trading with API-first architecture
Global markets and advanced order types
Traditional brokerage with API access
Testing environment for development
OAuth Connection Flow
Log in to SnipeRoute Dashboard
Go to app.sniperoute.io (opens in a new tab) and log in.
Navigate to Broker Settings
Click Settings → Brokers in the sidebar.
Select Broker
Click Connect next to your broker (e.g., Alpaca).
Authorize on Broker's Website
You'll be redirected to your broker's OAuth page. Log in and authorize Trading permissions.
Redirected Back to SnipeRoute
After authorization, you'll be redirected back to SnipeRoute. Your broker is now connected!
Copy Broker Connection ID
Copy the broker_id shown in the dashboard. You'll use this when creating Trade Intents.
Connecting Alpaca
Prerequisites
- Alpaca account (sign up here (opens in a new tab))
- Funded account (or paper trading account for testing)
Step-by-Step
-
Go to SnipeRoute Dashboard
https://app.sniperoute.io/settings/brokers -
Click "Connect Alpaca"
- You'll be redirected to Alpaca's OAuth page
-
Log in to Alpaca
- Enter your Alpaca credentials
-
Authorize Trading Permissions
- Review the permissions:
- Place orders
- View account information
- View positions
- Withdraw funds
- Modify account settings
- Click Authorize
- Review the permissions:
-
Copy Broker ID
broker_id: "alpaca_abc123"
Test Connection
import asyncio
from sniperoute import SnipeRouteClient
from sniperoute.models import TradeIntentRequest, OrderSide, OrderType
from decimal import Decimal
async def test_alpaca():
client = SnipeRouteClient()
intent = TradeIntentRequest(
intent_id="alpaca_test_001",
symbol="AAPL",
side=OrderSide.BUY,
quantity=Decimal("1"),
order_type=OrderType.MARKET,
broker_id="alpaca_abc123" # Your Alpaca connection ID
)
response = await client.create_intent(intent)
print(f"Connected to Alpaca! Order status: {response.status}")
asyncio.run(test_alpaca())Connecting Interactive Brokers (IBKR)
Prerequisites
- IBKR account with API access enabled
- Funded account
Step-by-Step
-
Enable API Access in IBKR
- Log in to IBKR Account Management
- Go to Settings → API → Settings
- Enable API Access
- Note your username and account ID
-
Go to SnipeRoute Dashboard
https://app.sniperoute.io/settings/brokers -
Click "Connect IBKR"
- You'll be redirected to IBKR's OAuth page
-
Authorize SnipeRoute
- Log in with your IBKR credentials
- Authorize trading permissions
- Click Approve
-
Copy Broker ID
broker_id: "ibkr_xyz789"
Connecting Charles Schwab
Prerequisites
- Schwab account with API access
- Funded account
Step-by-Step
-
Go to SnipeRoute Dashboard
https://app.sniperoute.io/settings/brokers -
Click "Connect Schwab"
- You'll be redirected to Schwab's OAuth page
-
Log in to Schwab
- Enter your Schwab credentials
-
Authorize Trading Permissions
- Review permissions and click Approve
-
Copy Broker ID
broker_id: "schwab_def456"
Using Mock Broker (Testing)
For development and testing, use the built-in Mock Broker:
intent = TradeIntentRequest(
intent_id="test_001",
symbol="AAPL",
side=OrderSide.BUY,
quantity=Decimal("10"),
order_type=OrderType.MARKET,
broker_id="mock" # No OAuth required
)Mock Broker Features:
- Instant fills at simulated prices
- No real money involved
- No broker connection required
- Perfect for testing and development
Managing Broker Connections
View Connected Brokers
Go to Settings → Brokers to see all connected accounts:
| Broker | Connection ID | Status | Last Used |
|---|---|---|---|
| Alpaca | alpaca_abc123 | Connected | 2 hours ago |
| IBKR | ibkr_xyz789 | Connected | 1 day ago |
Disconnect a Broker
Go to Settings → Brokers
Navigate to the broker management page.
Click Disconnect
Click Disconnect next to the broker you want to remove.
Confirm
Confirm that you want to revoke access.
After disconnecting, any new Trade Intents using that broker_id will fail with a 401 Unauthorized error.
Reconnect a Broker
If your OAuth token expires or is revoked:
- Go to Settings → Brokers
- Click Reconnect next to the broker
- Authorize again via OAuth
Security Best Practices
Use Read-Only API Keys for Account Monitoring
If you want to monitor your account without trading, use read-only API keys directly from your broker (not SnipeRoute).
Rotate OAuth Tokens Regularly
Disconnect and reconnect your broker every 90 days to rotate OAuth tokens.
Monitor Connected Apps in Broker Settings
Regularly check your broker's "Connected Apps" page to ensure only authorized apps have access.
Revoke Access Immediately if Compromised
If you suspect your SnipeRoute account is compromised, immediately:
- Revoke OAuth access in your broker settings
- Change your SnipeRoute password
- Rotate your API keys
Troubleshooting
OAuth Redirect Failed
Problem: You're not redirected back to SnipeRoute after authorization.
Solution:
- Check that you're using the correct redirect URL
- Ensure cookies are enabled
- Try a different browser
401 Unauthorized When Creating Intent
Problem: SnipeRoute cannot access your broker account.
Solution:
- Go to Settings → Brokers and check connection status
- Click Reconnect to refresh OAuth token
- Ensure your broker account is active
Broker Not Listed
Problem: Your broker is not in the list of supported brokers.
Solution:
- Contact support@sniperoute.io to request support for your broker
- Check the roadmap for planned broker integrations
Broker-Specific Limitations
Alpaca
- Market Hours: 9:30 AM - 4:00 PM ET (extended hours supported)
- Order Types: Market, Limit, Stop, Stop-Limit
- Minimum Order: $1 notional value
Interactive Brokers
- Market Hours: Varies by exchange
- Order Types: Market, Limit, Stop, Stop-Limit, Trailing Stop
- Minimum Order: No minimum
Charles Schwab
- Market Hours: 9:30 AM - 4:00 PM ET (extended hours limited)
- Order Types: Market, Limit, Stop, Stop-Limit
- Minimum Order: No minimum