Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

snaptrade-python-sdk

Latest version: v13.4.11

Overview

Last scanned
25 Nov 2026
Published
25 Nov 2026
PyPI package Publisher: dphuang2, konfig, snaptrade
40 Versions
205.6K Downloads

Scan summary

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.

  • Releases: 40 versions; the latest 5 were published within 7 days (19–25 Nov 2026).
  • Findings: No rules fired in version 13.4.11.
  • Downloads: 205,637 downloads.

Versions

40 versions published
Versions and the rules that fired in each
VersionPublishedStatus
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

No rules fired in 13.4.11

Findings

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.

README

The publisher’s own README, as collected from the registry.

Visit SnapTrade

SnapTrade

Connect brokerage accounts to your app for live positions and trading.

Rate limiting

Two limits apply to requests signed with your clientId. The stricter one wins, and exceeding either returns 429 Too Many Requests.

  • Customer-level — 250 requests/minute by default, scoped to your clientId and applied across all endpoints. Reported in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset.
  • Account-level — 10 requests/minute per account, scoped to (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.

PyPI README.md More Info

Table of Contents

  • Requirements
  • Installation
  • Authentication
    • Public operations
    • Commercial API Key Auth authentication
    • Personal API Key Auth authentication
    • OAuth Auth authentication
    • Device login
    • Browser OAuth, explicit refresh and revocation
  • Getting Started
  • Request timeouts
  • Async
  • Reference
    • snaptrade.account_information.get_account_activities
    • snaptrade.account_information.get_account_balance_history
    • snaptrade.account_information.get_account_balances_v2
    • snaptrade.account_information.get_account_details
    • snaptrade.account_information.get_account_order
    • snaptrade.account_information.get_account_transactions
    • snaptrade.account_information.get_all_account_orders
    • snaptrade.account_information.get_all_account_positions
    • snaptrade.account_information.get_all_account_recent_orders
    • snaptrade.account_information.get_user_account_balance
    • snaptrade.account_information.get_user_account_details
    • snaptrade.account_information.get_user_account_order_detail
    • snaptrade.account_information.get_user_account_orders
    • snaptrade.account_information.get_user_account_recent_orders
    • snaptrade.account_information.get_user_account_return_rates
    • snaptrade.account_information.get_user_holdings
    • snaptrade.account_information.list_all_user_accounts
    • snaptrade.account_information.list_user_accounts
    • snaptrade.account_information.update_user_account
    • snaptrade.api_status.check
    • snaptrade.authentication.delete_snap_trade_user
    • snaptrade.authentication.list_snap_trade_users
    • snaptrade.authentication.login_snap_trade_user
    • snaptrade.authentication.register_snap_trade_user
    • snaptrade.authentication.reset_snap_trade_user_secret
    • snaptrade.connections.delete_connection
    • snaptrade.connections.detail_brokerage_authorization
    • snaptrade.connections.disable_brokerage_authorization
    • snaptrade.connections.list_brokerage_authorization_accounts
    • snaptrade.connections.list_brokerage_authorizations
    • snaptrade.connections.list_connection_accounts
    • snaptrade.connections.refresh_brokerage_authorization
    • snaptrade.connections.return_rates
    • snaptrade.connections.sync_brokerage_authorization_transactions
    • snaptrade.experimental_endpoints.add_subscription
    • snaptrade.experimental_endpoints.cancel_subscription
    • snaptrade.experimental_endpoints.get_user_account_order_detail_v2
    • snaptrade.experimental_endpoints.get_user_account_orders_v2
    • snaptrade.experimental_endpoints.get_user_account_recent_orders_v2
    • snaptrade.experimental_endpoints.list_subscriptions
    • snaptrade.management.get_stats
    • snaptrade.management.get_stats_legacy
    • snaptrade.reference_data.get_partner_info
    • snaptrade.reference_data.get_stock_exchanges
    • snaptrade.reference_data.get_symbols
    • snaptrade.reference_data.get_symbols_by_ticker
    • snaptrade.reference_data.list_all_brokerage_authorization_type
    • snaptrade.reference_data.list_all_brokerage_instruments
    • snaptrade.reference_data.list_all_brokerages
    • snaptrade.reference_data.list_institutions
    • snaptrade.reference_data.symbol_search_user_account
    • snaptrade.trading.cancel_order
    • snaptrade.trading.get_cryptocurrency_pair_quote
    • snaptrade.trading.get_option_impact
    • snaptrade.trading.get_order_impact
    • snaptrade.trading.get_user_account_option_quotes
    • snaptrade.trading.get_user_account_quotes
    • snaptrade.trading.place_complex_order
    • snaptrade.trading.place_crypto_order
    • snaptrade.trading.place_force_order
    • snaptrade.trading.place_mleg_order
    • snaptrade.trading.place_order
    • snaptrade.trading.place_simple_order
    • snaptrade.trading.preview_crypto_order
    • snaptrade.trading.replace_order
    • snaptrade.trading.search_cryptocurrency_pair_instruments

Requirements

Python >=3.8

Installation

pip install snaptrade-python-sdk==13.4.11

Authentication

Choose the authentication mode that matches your credentials, then use its client in the reference examples.

Public operations

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)
Commercial API Key Auth authentication

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",
    ),
)
Personal API Key Auth authentication

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",
    ),
)
OAuth Auth authentication

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",
    ),
)
Device login

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.

Browser OAuth, explicit refresh and revocation

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.

Getting Started

# 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)

Request timeouts

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

async support is available by prepending a to any method.

OX Radar and Response Center

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.

Where it’s listed

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).

  • pypi-releases snaptrade-python-sdk

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Frame 2085668439 (1)
Group 1261154229