Best practices to serve real-time data
SnapTrade offers the ability to get real-time data on both Pay as you Go / Real-time and Pay as you Go / Daily plans. Real-time requests are enabled by default on all non-custom plans. See our pricing page for more information on plans
Pay as you Go / Real-time
The best practice for showing users accurate data on Pay as you Go / Real-time is to update your user's state when they log in to your app. You can do this by making API calls to the resources you need, commonly /positions, /options, /balances. Repeat this process every 10 minutes while the user remains active in your application
Pay as you Go / Daily
On Pay as you Go / Daily, SnapTrade returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To get real-time data we recommend calling the manual refresh endpoint to update the data. SnapTrade will begin a sync and notify you via ACCOUNT_HOLDINGS_UPDATED webhooks when each account has finished syncing, at which point you can call /positions, /options, /balances for each account. If you expect your users to want intraday updates, it is a good idea to give the option of a refresh button that lets the user refresh their data in the same way. Note that calls to the Refresh endpoint will incur additional charges according to your plan
Get notified when users place trades at their broker
If you need to know when a trade has been placed by a specific user, the recommendation is to poll the Recent Orders endpoint, only during market hours. This endpoint defaults to returning the last day of executed orders. Keep a copy of this list on your end, and check if a new order is present in the polling responses. To avoid SnapTrade and institution rate limits, we recommend polling at most once every 5 minutes per account. If faster trade detection is needed, please check out https://docs.snaptrade.com/docs/webhooks#webhooks-trade_detection and contact support@snaptrade.com if you wish to purchase a subscription (or reach out on discord/slack).
Transactions
Please see our guide on Syncing and Data Freshness for more information about transactions