The SnapTrade Python SDK provides a client library to easily interact with the SnapTrade API, enabling applications to connect brokerage accounts for live positions and trading. It abstracts away direct API calls, handling authentication and data formatting. The library is actively maintained with frequent updates, currently at version 11.0.177, and supports Python versions 3.8 and newer.
pip install snaptrade-python-sdkVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the SnapTrade client, check the API status, and interact with user registration/listing. You will need your SnapTrade `CLIENT_ID` and `CONSUMER_KEY` (obtained from your SnapTrade Dashboard) configured as environment variables. For actual user management and connections, you would register a user with a unique `user_id` from your application, obtain a `user_secret`, and then use these credentials to generate a connection portal URL.
Update your imports from `snaptrade.api_client.SnapTradeAPIClient` to `snaptrade_client.SnapTrade`.
Store `CLIENT_ID`, `CONSUMER_KEY`, and `userSecret` securely (e.g., environment variables, AWS Secrets Manager, Google Secret Manager) and retrieve them at runtime. Do not commit these to version control.
Implement retry logic with exponential backoff for API requests. Design your application to avoid aggressive bursts of requests, especially during data synchronization or high user signup volumes. Contact SnapTrade support if you require higher rate limits.
Always explicitly install `snaptrade-python-sdk` using `pip install snaptrade-python-sdk` and verify that imports reference `snaptrade_client`.
Change the import statement to `from snaptrade_client import SnapTrade`.
Verify that your `SNAPTRADE_CLIENT_ID` and `SNAPTRADE_CONSUMER_KEY` environment variables are correct and match the credentials from your SnapTrade Dashboard. Ensure the `user_secret` (if applicable) is also correct and not compromised. If the issue persists, contact SnapTrade support.
Implement retry logic with exponential backoff. Distribute API calls over time, especially for bulk operations. Consider contacting SnapTrade support for an increased rate limit if your use case demands it.
No dependency data recorded yet.