Recommended endpoints to get started

This page will give a brief overview of our most commonly used endpoints, and when to use them. All endpoints will return data in the same format, regardless of brokerage

Holdings

/holdings

https://docs.snaptrade.com/reference/get_holdings-1

Used to return all holdings information for each account a user has connected in the following format:

[
  {  
    "account": account info,  
    "balances": balance info,  
    "positions": position info,  
    "option_positions": option position info,  
    "orders": recent order info,  
    "errors": error encountered if any,  
    "total_value": total value of the account,  
  }
]

Pros:

  • Can fetch all relevant account info in one api call

Cons:

  • Can be slower response compared to calling only what you need individually

Tips:

  • Can filter to return holdings only for a particular authorization id, by passing that ID as a query param
  • Can instead use /accounts/{account_id}/holdings to only get holdings for a specific account
  • If looking to instead fetch holdings info in parts, you can split up the calls with the endpoints listed below. No reason to use the below endpoints in addition to the holdings endpoint, since information returned from below endpoint is already available in the holdings call

/accounts

https://docs.snaptrade.com/reference/get_accounts-1

Returns a list of all the accounts a user has connected

Pros:

  • Quickest way to get info on that brokerage accounts a user has access to

/accounts/{accountId}/balances

https://docs.snaptrade.com/reference/get_accounts-accountid-balances-1

Returns a list of all cash balances associated with the account id supplied, as well as what currency the balance is in

Pros:

  • Quickest way to see what balances a user's account currently has

/accounts/{accountId}/positions

https://docs.snaptrade.com/reference/get_accounts-accountid-positions-1

Returns a list of all positions associated with the account id supplied, as well as information on the security (current price, ticker, exchange, average purchase price, etc)

Pros:

  • Quickest way to see what positions a user's account currently has

Orders, Transactions, Activities

/accounts/{accountId}/orders

https://docs.snaptrade.com/reference/get_accounts-accountid-orders

Returns a list of recent orders (buys, sells) from the brokerage

Pros:

  • Implemented for all brokerages
  • Realtime data (updated intraday)
  • Includes all orders (not just executed orders)
  • Has timestamps in addition to the date

Cons:

  • Limited history (brokerage dependent)

/activities

https://docs.snaptrade.com/reference/get_activities

Returns a list of transactions/activities for the given user. Activities will include at minimum buys, sells, dividends, contributions, withdrawals. Some brokerages will also provide transactions for things like forex transactions, share splits, and more.

Pros:

  • Includes all types of transactions, not just trades
  • History goes all the way back to the date the account was opened

Cons:

  • Only includes executed trades
  • Get's updated end of day
  • Not all brokerages support this feature
  • Some brokerages only include date, not time of transaction

Tips:

  • Syncing may not be instant upon initial brokerage connection for some brokerages, make use of the ACCOUNT_TRANSACTIONS_INITIAL_UPDATE webhook to be notified exactly when all transactions have been loaded for an account