For AI agents: the documentation index is available at https://docs.snaptrade.com/llms.txt, and the comprehensive documentation index is available at https://docs.snaptrade.com/llms-full.txt. The complete public OpenAPI specification is available at https://docs.snaptrade.com/openapi.yaml. Complete public OpenAPI specification with all documented operations, schemas, servers, and authentication requirements. Use it for SDK generation and API tooling; beta operations are marked x-beta. Markdown versions of documentation pages are available by appending .md to the URL path.
Account Information

List account balances

get
https://api.snaptrade.com/accounts/{accountId}/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, Daily data is cached and refreshed once a day. Exact refresh timing may vary by 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.

Execute an API Request

Authentication Method

Use commercial authentication when acting on behalf of your application and passing end-user credentials with requests that require them.

Credentials
Path
accountIdstring (format: uuid)required

Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.

Request
Installation
$
npm install snaptrade-typescript-sdk
1
import {
2
Snaptrade,
3
SnaptradeAuth,
4
} from "snaptrade-typescript-sdk";
5
6
const snaptrade = new Snaptrade({
7
auth: SnaptradeAuth.commercialApiKey({
8
consumerKey: "CONSUMER_KEY",
9
clientId: "CLIENT_ID",
10
}),
11
});
12
13
const response =
14
await snaptrade.accountInformation.getUserAccountBalance(
15
{
16
accountId:
17
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
18
userId: "USER_ID",
19
userSecret: "USER_SECRET",
20
},
21
);
22
console.log(response.data);

Response fields

array of objects
object

Holds balance information for a single currency in an account.

1
[
2
{
3
"currency": {
4
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
5
"code": "USD",
6
"name": "US Dollar"
7
},
8
"cash": 300.71,
9
"buying_power": 410.71
10
}
11
]