Getting Started with SnapTrade
This guide will help you connect a brokerage account, retrieve account data, and, where enabled, place a trade. Start by choosing the customer model that matches who will use the integration.
For definitions used throughout this guide, see Terminology. For more detail about the two customer models, see SnapTrade Personal vs Commercial and Authentication Methods.
The interactive Getting Started Demo currently demonstrates the Commercial flow.
Choose a Customer Model
Personal users can share their connected brokerage data with OAuth-enabled apps or access it directly with a Personal API key. Commercial integrations either use an API key to manage brokerage accounts for their end users or register an OAuth app that end users authorize to access the accounts they manage in SnapTrade Personal.
| Personal | Commercial | |
|---|---|---|
| Use when | You are accessing your own brokerage accounts | Your application manages brokerage accounts for its end users |
| Access methods | OAuth for sharing data, or a Personal API key for direct access | An OAuth app, or a Commercial API key |
| User identity | Your signed-in SnapTrade account identifies you | OAuth: each app user's access token. API key: each app user has a SnapTrade userId and userSecret |
| User registration | Not required | OAuth: not required. API key: required before connecting a brokerage |
| Trading | Available through Personal API keys where enabled; OAuth trading is in beta | Available through Commercial API keys where enabled; OAuth trading is in beta |
| Webhooks | Available for Personal API keys | Available |
SnapTrade SDKs
We recommend using a SnapTrade SDK. If you call the API directly, follow Request Signatures to sign each request.
Personal Quickstart
Use this path when you are connecting and managing your own brokerage accounts.
1. Create a Personal Account
- Create a Personal account in the SnapTrade Dashboard.
- Verify your email.
2. Choose How to Access Your Data
Most Personal users connect their brokerage accounts in the SnapTrade Dashboard and share that data with apps through OAuth. You can also create a Personal API key when you want to access your data programmatically.
Share Your Data Through OAuth
- Connect and manage your brokerage accounts in the SnapTrade Dashboard.
- In an OAuth-enabled app or AI assistant, choose SnapTrade as a data source.
- Sign in to SnapTrade and approve the access the app requests.
The app receives a scoped OAuth token instead of your Personal API credentials. Do not give an app your consumerKey. OAuth supports reading account data and managing connections. Trading through OAuth is in beta: an app that requests the trade permission can place, modify, and cancel orders in accounts where your brokerage connection supports trading.
To share data with an AI assistant, see the SnapTrade MCP Server. Developers building an app that receives shared data should see Build an OAuth App.
Access Your Data With a Personal API Key
- Enable two-factor authentication in the SnapTrade Dashboard.
- Create your Personal API key from the API Key page.
- Store the
clientIdandconsumerKeysecurely.
Your Personal API key represents you. Do not register a separate SnapTrade user, and do not send a userId or userSecret in Personal API requests.
3. Connect a Brokerage With Your API Key
If you already connected your brokerage account in the Dashboard, you can skip this step. To add another connection programmatically:
- Open and select Personal API Key authentication.
- Enter your Personal
clientIdandconsumerKey. LeaveuserIdanduserSecretunset. - If you intend to trade, set
connectionTypetotrade-if-available. The defaultreadconnection type supports data access only. - Send the request and open the returned Connection Portal URL.
- Complete the Connection Portal flow for your brokerage.
A connection represents a linked set of brokerage credentials. Completing the portal flow makes the brokerage accounts under that connection available through SnapTrade.
For more ways to open and configure the portal, see Methods to Integrate the Connection Portal into Your Application.
4. Retrieve Accounts and Positions
- Call using Personal API Key authentication to list your accounts.
- Choose the
accountIdfor the account you want to inspect. - Call with that
accountId.
You can also retrieve balances with and orders with .
5. Place an Equity Trade
Personal users can trade their own accounts when trading is enabled for the API key, brokerage, connection, and account.
- Build the order using the account ID and the brokerage ticker in the
symbolfield. - Validate the order details and confirm them before submission.
- Call to submit the order to the brokerage.
Use Personal API Key authentication throughout and continue to omit userId and userSecret.
For order types, brokerage support, and other asset classes, see Trading with SnapTrade.
Personal Next Steps
- Learn more about retrieving Account Data.
- Learn how to manage and repair Connections.
- Configure Webhooks.
- Access your data through AI assistants with the SnapTrade MCP Server.
Commercial Quickstart
Use this path when you are building an application for your own end users. Choose how your app accesses their brokerage data:
| OAuth app | Commercial API key | |
|---|---|---|
| End users | Sign in with their SnapTrade account | Your app registers a SnapTrade user for each one |
| Brokerage connections | Already connected in SnapTrade; users grant your app access | Your app builds the connection flow with the Connection Portal |
| Broker access | All brokers supported by SnapTrade Personal, available immediately | Some brokers require separate approval before launch; see the Broker Access Guide |
| Per-user credentials | Tokens issued when the user approves access | A userId and userSecret your app stores for each user |
| Request authentication | Standard Bearer token | Each request signed with your consumerKey |
| Trading | In beta, with the trade scope | Available where enabled |
| Pricing | Free during the limited-time OAuth preview | Per-user pricing; see Billing |
Option 1: Build With OAuth
With OAuth, users bring the brokerage accounts they already manage in SnapTrade, and a single connection can be shared with every app they use. Your app does not register SnapTrade users, store userSecret values, sign requests, or embed the Connection Portal.
1. Register an OAuth App
- Create a Commercial account in the SnapTrade Dashboard.
- Select OAuth Apps in the left sidebar, create a Test app, and add your redirect URIs. Production redirects must use HTTPS; local testing can use a loopback address such as
http://127.0.0.1. - Save the
client_idandclient_secreton a secure backend. The secret is shown only once. - When you are ready for production, complete the Production Access Application and register a Production app.
Test OAuth apps are limited to 5 users. To test the consent flow, use a SnapTrade Personal account with at least one brokerage connection.
2. Send the User Through Authorization
- Read the authorization server metadata from
https://api.snaptrade.com/.well-known/oauth-authorization-serverto find the authorization, token, and revocation endpoints. - Generate a fresh
stateand PKCEcode_verifierfor the attempt, and derive anS256code_challenge. - Redirect the user to the authorization endpoint with
response_type=code, yourclient_id,redirect_uri,state,code_challenge,code_challenge_method=S256, andscope=read. Addtradeif your app places orders andwebhookif it needs event notifications.
The user signs in to SnapTrade, reviews the requested access, and approves or denies your app.
3. Exchange the Code for Tokens
- In your callback, reject the response if
statedoes not match, and handle anyerrorwithout exchanging a code. - From your backend, exchange the
codeandcode_verifierat the token endpoint using HTTP Basic client authentication. - Store the returned
access_tokenandrefresh_tokenencrypted and associated with the signed-in user.
Access tokens are valid for 10 hours. Refresh tokens rotate: each successful refresh returns a new refresh token that replaces the old one.
4. Retrieve Accounts and Positions
Send the access token as a Bearer token. Do not include clientId, consumerKey, userId, userSecret, timestamp, or Signature on OAuth requests.
GET https://api.snaptrade.com/accounts Authorization: Bearer ACCESS_TOKEN Accept: application/json
- Call to list the accounts the user shared.
- Choose the
accountIdfor the account you want to inspect. - Call with the
accountId.
You can also retrieve balances with and orders with . Users add, repair, and remove brokerage connections in the SnapTrade Dashboard.
5. Place an Equity Trade
OAuth trading is in beta. Your app can trade when the user granted the trade scope and their brokerage connection supports trading.
- Build the order using the account ID and the brokerage ticker in the
symbolfield. - Show the user the order details and have them confirm it.
- Call with the Bearer token to submit the order to the brokerage.
Users who authorized your app without trade must go through the authorization flow again to grant it.
For token refresh, revocation, OpenID Connect sign-in, webhooks, and a production checklist, see Build an OAuth App.
Option 2: Build With a Commercial API Key
Use a Commercial API key when your app needs to create and manage SnapTrade users and their brokerage connections itself.
1. Create a Commercial API Key
- Create a Commercial account in the SnapTrade Dashboard.
- Verify your email.
- Enable two-factor authentication.
- Create a test API key from the API Key page.
- When you are ready for production, complete the required approval and billing steps in the Dashboard and create a production key.
- Store the
clientIdandconsumerKeyon a secure backend.
For plan limits and production requirements, see Billing.
2. Register a SnapTrade User
A Commercial integration creates one SnapTrade user for each end user in the application.
- Call with a stable, immutable
userIdfrom your system. Avoid using an email address. - Store the returned
userSecretsecurely. SnapTrade returns it only when the user is registered.
The userId and userSecret identify this app user in subsequent user-scoped requests.
3. Connect a Brokerage
- Call using Commercial API Key authentication.
- Provide the app user's
userIdanduserSecret. - If the user intends to trade, set
connectionTypetotrade-if-available. The defaultreadconnection type supports data access only. - Open the returned Connection Portal URL and send the end user through the portal flow.
After the user completes the flow, the connection and its brokerage accounts are available through SnapTrade.
For more ways to open and configure the portal, see Methods to Integrate the Connection Portal into Your Application.
4. Retrieve Accounts and Positions
- Call with the user's
userIdanduserSecret. - Choose the
accountIdfor the account you want to inspect. - Call with the
accountId,userId, anduserSecret.
You can also retrieve balances with and orders with .
5. Place an Equity Trade
Commercial integrations can trade when trading is enabled for the API key, brokerage, connection, and account.
- Build the order using the account ID and the brokerage ticker in the
symbolfield. - Validate the order details in your application and have the end user confirm them.
- Call to submit the order to the brokerage.
Include the user's userId and userSecret in each user-scoped request.
For order types, brokerage support, and other asset classes, see Trading with SnapTrade.
Commercial Next Steps
- Complete your OAuth integration with Build an OAuth App.
- Configure Webhooks.
- Finish integrating the Connection Portal.
- Prepare your integration for production with Launching Your Application.
- Review Commercial pricing and limits in Billing.
For troubleshooting, see the FAQ. If you still need help, contact us through Discord.