Connections

List connection rate of returns

get
https://api.snaptrade.com/api/v1/authorizations/{authorizationId}/returnRates

Returns a list of rate of return percents for a given connection.

Execute an API Request

Path
authorizationIdstring (format: uuid)required

Unique identifier for the connection. This is the UUID used to reference the connection in SnapTrade.

Query
userIdstringrequired

SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.

userSecretstringrequired

SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the rotate user secret endpoint.

timeframesstring

Optional comma separated list of rate-of-return timeframes to return. Supported values are ALL, 1Y, YTD, 1M, 1W, and 1D. If omitted, SnapTrade returns all six supported timeframes.

Authorization
Request
Installation
$
npm install snaptrade-typescript-sdk
1
import { Snaptrade } from "snaptrade-typescript-sdk";
2
3
const snaptrade = new Snaptrade({
4
clientId: "PARTNER_CLIENT_ID",
5
consumerKey: "CONSUMER_KEY",
6
});
7
8
const response =
9
await snaptrade.connections.returnRates({
10
authorizationId:
11
"87b24961-b51e-4db8-9226-f198f6518a89",
12
userId: "snaptrade-user-123",
13
userSecret:
14
"adf2aa34-8219-40f7-a6b3-60156985cc61",
15
timeframes: "ALL,1Y",
16
});
17
console.log(response.data);

Response fields

object

List of return rates with their timeframe

dataarray of objects

List of return percentages

1
{
2
"data": [
3
{
4
"timeframe": "ALL",
5
"return_percent": 5.97,
6
"created_date": "2024-07-30T22:51:49.746Z"
7
}
8
]
9
}