Scan your whole stack
From OX Research Newsroom
Are you using snaptrade-python-sdk?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v13.4.11
snaptrade-python-sdk was last scanned on 25 Nov 2026 at version 13.4.11. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 13.4.11 LATEST | 25 Nov 2026 | No rules fired |
| 13.4.10 | 24 Nov 2026 | No rules fired |
| 13.4.9 | 24 Nov 2026 | No rules fired |
| 13.4.8 | 20 Nov 2026 | Not shown |
| 13.4.7 | 19 Nov 2026 | Not shown |
Findings for v13.4.11. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 13.4.11; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Connect brokerage accounts to your app for live positions and trading.
Two limits apply to requests signed with your clientId. The stricter one
wins, and exceeding either returns 429 Too Many Requests.
clientId and applied across all endpoints. Reported in
X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset.clientId, accountId). All covered operations for one account draw on
the same bucket — reading balances and reading positions share it — and
enforcement does not depend on the HTTP method, so updating an account
consumes the same bucket as reading it. Only enforced for Personal users,
and only for integrations it has been rolled out to — it is not yet in
force for every Personal integration. It also does not apply on every
operation that documents a 429 below. Where it applies it is reported in
X-RateLimit-Account-Limit, X-RateLimit-Account-Remaining and
X-RateLimit-Account-Reset. Do not read the absence of those headers as
proof the limit is off — some configurations omit the rate limit headers
while still enforcing the limit, so header absence tells you nothing
about your allowance.On a 429, X-RateLimit-Remaining: 0 means you hit the customer-level limit
and X-RateLimit-Account-Remaining: 0 means the account-level one. Wait for
the corresponding *-Reset value (seconds) before retrying, or fall back to
exponential backoff with jitter.
Not every 429 is explained by those headers. A separate
per-authenticated-user limit, reported in no X-RateLimit-* header, covers
OAuth-authenticated requests and signed requests in configurations where the
customer-level limit is not in effect — on the operations that use the
default throttles. A few operations override those and are governed by the
customer-level limit alone. The two do not stack: a signed request
governed by the customer-level limit above is not additionally subject to the
per-user one. If a 429 arrives with no header at zero — or with no
X-RateLimit-* headers at all — honour Retry-After and back off. Treat the
remaining counts as a hint, not a guarantee that the next request will
succeed.
Because the customer-level limit applies everywhere, any signed request can return 429.
OAuth-authenticated requests are an exception. They are not subject to
the customer-level limit and do not receive X-RateLimit-Limit,
X-RateLimit-Remaining or X-RateLimit-Reset — do not wait on those headers
or design around a customer-level allowance on this path. The account-level
limit still applies to them on the account-data endpoints above, reported in
the X-RateLimit-Account-* headers. On operations using the default
throttles the per-user limit above applies to them as well, so an OAuth
request can be rejected while the account headers still show capacity; on
the few operations that override those throttles, OAuth callers have no
per-user ceiling at all. Drive retries from Retry-After and exponential
backoff with jitter rather than from the headers.
See https://docs.snaptrade.com/docs/ratelimiting.
snaptrade.account_information.get_account_activitiessnaptrade.account_information.get_account_balance_historysnaptrade.account_information.get_account_balances_v2snaptrade.account_information.get_account_detailssnaptrade.account_information.get_account_ordersnaptrade.account_information.get_account_transactionssnaptrade.account_information.get_all_account_orderssnaptrade.account_information.get_all_account_positionssnaptrade.account_information.get_all_account_recent_orderssnaptrade.account_information.get_user_account_balancesnaptrade.account_information.get_user_account_detailssnaptrade.account_information.get_user_account_order_detailsnaptrade.account_information.get_user_account_orderssnaptrade.account_information.get_user_account_recent_orderssnaptrade.account_information.get_user_account_return_ratessnaptrade.account_information.get_user_holdingssnaptrade.account_information.list_all_user_accountssnaptrade.account_information.list_user_accountssnaptrade.account_information.update_user_accountsnaptrade.api_status.checksnaptrade.authentication.delete_snap_trade_usersnaptrade.authentication.list_snap_trade_userssnaptrade.authentication.login_snap_trade_usersnaptrade.authentication.register_snap_trade_usersnaptrade.authentication.reset_snap_trade_user_secretsnaptrade.connections.delete_connectionsnaptrade.connections.detail_brokerage_authorizationsnaptrade.connections.disable_brokerage_authorizationsnaptrade.connections.list_brokerage_authorization_accountssnaptrade.connections.list_brokerage_authorizationssnaptrade.connections.list_connection_accountssnaptrade.connections.refresh_brokerage_authorizationsnaptrade.connections.return_ratessnaptrade.connections.sync_brokerage_authorization_transactionssnaptrade.experimental_endpoints.add_subscriptionsnaptrade.experimental_endpoints.cancel_subscriptionsnaptrade.experimental_endpoints.get_user_account_order_detail_v2snaptrade.experimental_endpoints.get_user_account_orders_v2snaptrade.experimental_endpoints.get_user_account_recent_orders_v2snaptrade.experimental_endpoints.list_subscriptionssnaptrade.management.get_statssnaptrade.management.get_stats_legacysnaptrade.reference_data.get_partner_infosnaptrade.reference_data.get_stock_exchangessnaptrade.reference_data.get_symbolssnaptrade.reference_data.get_symbols_by_tickersnaptrade.reference_data.list_all_brokerage_authorization_typesnaptrade.reference_data.list_all_brokerage_instrumentssnaptrade.reference_data.list_all_brokeragessnaptrade.reference_data.list_institutionssnaptrade.reference_data.symbol_search_user_accountsnaptrade.trading.cancel_ordersnaptrade.trading.get_cryptocurrency_pair_quotesnaptrade.trading.get_option_impactsnaptrade.trading.get_order_impactsnaptrade.trading.get_user_account_option_quotessnaptrade.trading.get_user_account_quotessnaptrade.trading.place_complex_ordersnaptrade.trading.place_crypto_ordersnaptrade.trading.place_force_ordersnaptrade.trading.place_mleg_ordersnaptrade.trading.place_ordersnaptrade.trading.place_simple_ordersnaptrade.trading.preview_crypto_ordersnaptrade.trading.replace_ordersnaptrade.trading.search_cryptocurrency_pair_instrumentsPython >=3.8
pip install snaptrade-python-sdk==13.4.11
Choose the authentication mode that matches your credentials, then use its client in the reference examples.
Pass auth=None explicitly to call public operations without credentials. The auth argument is required so unauthenticated access is intentional; omitting it is an error. Protected operations require an authenticated client.
from snaptrade_client import SnapTrade
public_client = SnapTrade(auth=None)
Use a Commercial API Key when your app manages users and their connection experience.
from snaptrade_client import SnapTrade, SnapTradeAuth
commercial_api_key_client = SnapTrade(
auth=SnapTradeAuth.commercial_api_key(
consumer_key="CONSUMER_KEY",
client_id="CLIENT_ID",
),
)
Use personal authentication when the API key belongs to a single user and user credentials are not passed per request.
from snaptrade_client import SnapTrade, SnapTradeAuth
personal_api_key_client = SnapTrade(
auth=SnapTradeAuth.personal_api_key(
consumer_key="CONSUMER_KEY",
client_id="CLIENT_ID",
),
)
Supply an existing access token. Your application handles token storage, refresh and callback validation.
from snaptrade_client import SnapTrade, SnapTradeAuth
oauth_client = SnapTrade(
auth=SnapTradeAuth.oauth(
access_token="ACCESS_TOKEN",
),
)
Use a pre-registered public OAuth client enabled for the device grant. Device access is read-only. This helper does not register clients, open a browser, store tokens or refresh them. Run polling in a worker thread in asynchronous apps.
import os
from snaptrade_client import SnapTrade, SnapTradeAuth, SnapTradeOAuthDevice
device = SnapTradeOAuthDevice()
client_id = os.environ["SNAPTRADE_OAUTH_DEVICE_CLIENT_ID"]
authorization = device.start_device_authorization(client_id=client_id)
print(authorization.verification_uri, authorization.user_code)
# Keep authorization.device_code private; do not persist authorization.
tokens = device.wait_for_device_token(client_id=client_id, authorization=authorization)
client = SnapTrade(auth=SnapTradeAuth.oauth(access_token=tokens.access_token))
Polling respects the server interval, backs off on slow_down and timeouts,
and stops on expiry or terminal errors. Pass a threading.Event as cancel to
interrupt polling waits. An in-flight request is bounded by the HTTP timeout
(30 seconds by default) and remaining authorization lifetime. Catch
SnapTradeOAuthDeviceError and inspect .error for denial, expiry or cancellation.
Applications own token storage and refresh, including refresh-token rotation.
Configure confidential-client credentials on your backend. The synchronous helper generates fresh state and S256 PKCE and uses server discovery by default. Run blocking calls in a worker thread in asynchronous apps.
from snaptrade_client import SnapTrade, SnapTradeAuth, SnapTradeOAuth
oauth = SnapTradeOAuth(
client_id=client_id, client_secret=client_secret, redirect_uri=redirect_uri
)
flow = oauth.create_authorization_url(scope="read")
# Save flow in the user's login session, then redirect to flow.url.
# In the callback, handle OAuth errors, validate state, and consume that saved flow.
tokens = oauth.exchange_code(code=code, code_verifier=flow.code_verifier)
client = SnapTrade(auth=SnapTradeAuth.oauth(access_token=tokens.access_token))
# Refresh explicitly and atomically replace the stored response, including the rotated refresh token.
assert tokens.refresh_token is not None
refreshed = oauth.refresh_token(refresh_token=tokens.refresh_token)
refreshed_client = SnapTrade(
auth=SnapTradeAuth.oauth(access_token=refreshed.access_token)
)
Token responses include access_token, refresh_token, expires_in, token_type, scope, and raw. Applications own token storage, callback validation, refresh scheduling and concurrency. A configured secret defaults to client_secret_basic; public clients omit the secret. Browser code must never receive a confidential-client secret.
To revoke a token explicitly, call oauth.revoke_token(token=token, token_type_hint="refresh_token"). The hint is optional ("access_token" or "refresh_token"). Success returns None, including for unknown or already revoked tokens. Revoking a refresh token also invalidates its paired access token; independent token pairs remain valid. The helper discovers revocation_endpoint or uses the constructor's revocation_endpoint override and reuses the configured client authentication. OAuth errors raise RuntimeError with the HTTP status and response body.
# Commercial API key example: registers a SnapTrade user and uses userId/userSecret.
import os
import uuid
from pprint import pprint
from typing import List
from snaptrade_client import SnapTrade, SnapTradeAuth
# 1) Initialize a client with your clientID and consumerKey.
snaptrade = SnapTrade(
auth=SnapTradeAuth.commercial_api_key(
consumer_key=os.environ["SNAPTRADE_CONSUMER_KEY"],
client_id=os.environ["SNAPTRADE_CLIENT_ID"],
)
)
# 2) Check that the client is able to make a request to the API server.
api_response = snaptrade.api_status.check()
pprint(api_response.body)
# 3) Create a new user on SnapTrade
user_id = str(uuid.uuid4())
register_response = snaptrade.authentication.register_snap_trade_user(user_id=user_id)
pprint(register_response.body)
# Note: A user secret is only generated once. It's required to access
# resources for certain endpoints.
user_secret = register_response.body["userSecret"]
# 4) Get a redirect URI. Users will need this to connect
# their brokerage to the SnapTrade server.
redirect_uri = snaptrade.authentication.login_snap_trade_user(
user_id=user_id,
user_secret=user_secret,
)
print(redirect_uri.body)
input("Open the link in your browser. When done logging in, press Enter to continue...")
# 5) Get a list of connections
connections = snaptrade.connections.list(
user_id=user_id,
user_secret=user_secret,
)
pprint(connections.body)
# 6) Get a list of accounts for the first connection, if available
if not isinstance(connections.body, List) or len(connections.body) == 0:
print("No brokerage connections found for the user.")
else:
accounts = snaptrade.connections.list_brokerage_authorization_accounts(
authorization_id=connections.body[0]["id"],
user_id=user_id,
user_secret=user_secret,
)
pprint(accounts.body)
# 6) Deleting a user
deleted_response = snaptrade.authentication.delete_snap_trade_user(user_id=user_id)
pprint(deleted_response.body)
Synchronous API methods accept an optional timeout argument in seconds. Pass
timeout=10.0 for a total timeout, or timeout=(2.0, 10.0) for separate connection
and read timeouts. Omitting timeout preserves the default transport behavior.
Timeouts apply to individual HTTP attempts; retries can increase the overall duration.
async support is available by prepending a to any method.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.