Skip to content
InboxAsk a human

Account Data

What is an account?

An account represents a unique account at a brokerage, like an individual account, or a 401k retirement account. A connection can have multiple accounts. The same brokerage account can also belong to multiple connections. For example a joint account between two individual account holders are visible under each account holder’s connection.

What can you do with an account?

With a connected account, you can call any SnapTrade account data API to get information about the account, its holdings, and its history.

Account Details

Returns account detail known to SnapTrade for the specified account.

Check your API key on the Customer Dashboard billing page to see if you have real-time data access:

  • If you do, this endpoint returns real-time data.

  • If you don't, the data is cached and refreshed once a day. If you need real-time, use the manual refresh endpoint.

If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see this guide on how to fix a disabled connection.

from pprint import pprint from snaptrade_client import SnapTrade snaptrade = SnapTrade( client_id="PARTNER_CLIENT_ID", consumer_key="CONSUMER_KEY" ) response = snaptrade.account_information.get_user_account_details( account_id="917c8734-8470-4a3e-a18f-57c3f2ee6631", user_id="snaptrade-user-123", user_secret="adf2aa34-8219-40f7-a6b3-60156985cc61" ) pprint(response.body)

Positions

Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the options endpoint.

Check your API key on the Customer Dashboard billing page to see if you have real-time data access:

  • If you do, this endpoint returns real-time data.

  • If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the brokerage integrations doc and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the manual refresh endpoint.

If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see this guide on how to fix a disabled connection.

from pprint import pprint from snaptrade_client import SnapTrade snaptrade = SnapTrade( client_id="PARTNER_CLIENT_ID", consumer_key="CONSUMER_KEY" ) response = snaptrade.account_information.get_user_account_positions( account_id="917c8734-8470-4a3e-a18f-57c3f2ee6631", user_id="snaptrade-user-123", user_secret="adf2aa34-8219-40f7-a6b3-60156985cc61" ) pprint(response.body)

Balances

Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade allows holding multiple currencies in the same account.

Check your API key on the Customer Dashboard billing page to see if you have real-time data access:

  • If you do, this endpoint returns real-time data.

  • If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the brokerage integrations doc and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the manual refresh endpoint.

If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see this guide on how to fix a disabled connection.

from pprint import pprint from snaptrade_client import SnapTrade snaptrade = SnapTrade( client_id="PARTNER_CLIENT_ID", consumer_key="CONSUMER_KEY" ) response = snaptrade.account_information.get_user_account_balance( account_id="917c8734-8470-4a3e-a18f-57c3f2ee6631", user_id="snaptrade-user-123", user_secret="adf2aa34-8219-40f7-a6b3-60156985cc61" ) pprint(response.body)

Orders

Orders are how a broker keeps track of trading activity in an account. This differs from account activities in the following ways:

  • Is updated intraday

  • Contains all orders placed at the broker regardless if they resulted in a change in position, including cancelled orders and pending orders

  • Often has more granular timestamps than account activities

  • Only looks back a few months at most

from pprint import pprint from snaptrade_client import SnapTrade snaptrade = SnapTrade( client_id="PARTNER_CLIENT_ID", consumer_key="CONSUMER_KEY" ) response = snaptrade.account_information.get_user_account_orders( account_id="917c8734-8470-4a3e-a18f-57c3f2ee6631", user_id="snaptrade-user-123", user_secret="adf2aa34-8219-40f7-a6b3-60156985cc61", days=30 ) pprint(response.body)

Recent Orders

A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders Differs from /orders in that it is always realtime, and only checks the last 24 hours By default only returns executed orders, but that can be changed by setting only_executed to false

from pprint import pprint from snaptrade_client import SnapTrade snaptrade = SnapTrade( client_id="PARTNER_CLIENT_ID", consumer_key="CONSUMER_KEY" ) response = snaptrade.account_information.get_user_account_recent_orders( account_id="917c8734-8470-4a3e-a18f-57c3f2ee6631", user_id="snaptrade-user-123", user_secret="adf2aa34-8219-40f7-a6b3-60156985cc61" ) pprint(response.body)

Activities

Returns all historical transactions for the specified account.

This endpoint is paginated with a default page size of 1000. The endpoint will return a maximum of 1000 transactions per request. See the query parameters for pagination options.

Transaction are returned in reverse chronological order, using the trade_date field.

The data returned here is always cached and refreshed once a day.

If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see this guide on how to fix a disabled connection.

import { Snaptrade } from "snaptrade-typescript-sdk"; const snaptrade = new Snaptrade({ clientId: "PARTNER_CLIENT_ID", consumerKey: "CONSUMER_KEY", }); const response = await snaptrade.accountInformation.getAccountActivities( { accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631", userId: "snaptrade-user-123", userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61", startDate: "2022-01-24", endDate: "2022-01-24", type: "BUY,SELL,DIVIDEND", }, ); console.log(response.data);