Experimental endpoints

Add a Trade Detection subscription

BETA
post
https://api.snaptrade.com/api/v1/snapTrade/tradeDetection/subscriptions

Adds or restores a Trade Detection subscription for a connected brokerage account. This endpoint requires userId and userSecret in addition to the partner signature.

Execute an API Request

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.

Request Body
account_idstring (format: uuid)required

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

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.experimentalEndpoints.addSubscription(
10
{
11
userId: "snaptrade-user-123",
12
userSecret:
13
"adf2aa34-8219-40f7-a6b3-60156985cc61",
14
account_id:
15
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
16
},
17
);
18
console.log(response.data);

Response fields

object

An active Trade Detection subscription for a brokerage account.

account_idstring (format: uuid)

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

coststring

Monthly subscription cost as a decimal string.

How often the subscribed account is checked for new trades.

1
{
2
"account_id": "917c8734-8470-4a3e-a18f-57c3f2ee6631",
3
"cost": "100.00",
4
"check_interval_seconds": 300
5
}