SnapTrade.Net 3.17.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SnapTrade.Net --version 3.17.0
NuGet\Install-Package SnapTrade.Net -Version 3.17.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SnapTrade.Net" Version="3.17.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SnapTrade.Net --version 3.17.0
#r "nuget: SnapTrade.Net, 3.17.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SnapTrade.Net as a Cake Addin
#addin nuget:?package=SnapTrade.Net&version=3.17.0

// Install SnapTrade.Net as a Cake Tool
#tool nuget:?package=SnapTrade.Net&version=3.17.0

SnapTrade.Net - the C# library for the SnapTrade

Connect brokerage accounts to your app for live positions and trading

This C# SDK is automatically generated by the Konfig:

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Generate the DLL using your preferred tool (e.g. dotnet build)

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using SnapTrade.Net.Api;
using SnapTrade.Net.Client;
using SnapTrade.Net.Model;

Getting Started

using System;
using System.Collections.Generic;
using System.Diagnostics;
using SnapTrade.Net.Api;
using SnapTrade.Net.Client;
using SnapTrade.Net.Model;

namespace Example
{
    public class GetAllUserHoldingsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();

            // Configure custom BasePath if desired
            // config.BasePath = "https://api.snaptrade.com/api/v1";

            config.ApiKey.Add("clientId", System.Environment.GetEnvironmentVariable("SNAPTRADE_CLIENT_ID"));
            config.ConsumerKey = System.Environment.GetEnvironmentVariable("SNAPTRADE_CONSUMER_KEY");

            var apiInstance = new AccountInformationApi(config);
            var userId = "userId_example";  // string | 
            var userSecret = "userSecret_example";  // string | 
            var brokerageAuthorizations = 917c8734-8470-4a3e-a18f-57c3f2ee6631;  // Guid? | Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional) 

            try
            {
                // List all accounts for the user, plus balances and positions for each account.
                List<AccountHoldings> result = apiInstance.GetAllUserHoldings(userId, userSecret, brokerageAuthorizations);
                Console.WriteLine(result);
            }
            catch (ApiException e)
            {
                Console.WriteLine("Exception when calling AccountInformationApi.GetAllUserHoldings: " + e.Message);
                Console.WriteLine("Status Code: "+ e.ErrorCode);
                Console.WriteLine(e.StackTrace);
            }
            catch (ClientException e)
            {
                Console.WriteLine(e.Response.StatusCode);
                Console.WriteLine(e.Response.RawContent);
                Console.WriteLine(e.InnerException);
            }
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.snaptrade.com/api/v1

Class Method HTTP request Description
AccountInformationApi GetAllUserHoldings GET /holdings List all accounts for the user, plus balances and positions for each account.
AccountInformationApi GetUserAccountBalance GET /accounts/{accountId}/balances Get all cash balances of an investment account
AccountInformationApi GetUserAccountDetails GET /accounts/{accountId} Return details of a specific investment account
AccountInformationApi GetUserAccountOrders GET /accounts/{accountId}/orders Get all history of orders placed in account
AccountInformationApi GetUserAccountPositions GET /accounts/{accountId}/positions Get all positions of an investment account
AccountInformationApi GetUserHoldings GET /accounts/{accountId}/holdings List balances, positions and orders for the specified account.
AccountInformationApi ListUserAccounts GET /accounts List all investment accounts for the user
AccountInformationApi UpdateUserAccount PUT /accounts/{accountId} Update details of an investment account
APIStatusApi Check GET / Get API Status
AuthenticationApi DeleteSnapTradeUser DELETE /snapTrade/deleteUser Delete user from SnapTrade, disabling all brokerage authorizations and permanently deleting all data associated with the user
AuthenticationApi GetUserJWT GET /snapTrade/encryptedJWT Obtains an encrypted JWT tokens that should be decrypted on a user's local device
AuthenticationApi ListSnapTradeUsers GET /snapTrade/listUsers Get a list of all SnapTrade users you've registered on our platform
AuthenticationApi LoginSnapTradeUser POST /snapTrade/login Generate a redirect URI to securely login a user to the SnapTrade Connection Portal
AuthenticationApi RegisterSnapTradeUser POST /snapTrade/registerUser Register user with SnapTrade in order to create secure brokerage authorizations
ConnectionsApi DetailBrokerageAuthorization GET /authorizations/{authorizationId} Get detail of a specific brokerage authorizations for the user
ConnectionsApi ListBrokerageAuthorizations GET /authorizations List all brokerage authorizations for the user
ConnectionsApi RemoveBrokerageAuthorization DELETE /authorizations/{authorizationId} Remove a brokerage authorization.
ConnectionsApi SessionEvents GET /sessionEvents List all session events for the partner
ErrorLogsApi ListUserErrors GET /snapTrade/listUserErrors Retrieve error logs on behalf of your SnapTrade users
OptionsApi GetOptionStrategy POST /accounts/{accountId}/optionStrategy Creates an option strategy object that will be used to place an option strategy order
OptionsApi GetOptionsChain GET /accounts/{accountId}/optionsChain Get the options chain
OptionsApi GetOptionsStrategyQuote GET /accounts/{accountId}/optionStrategy/{optionStrategyId} Get latest market data of option strategy
OptionsApi ListOptionHoldings GET /accounts/{accountId}/options Get the options holdings in the account
OptionsApi PlaceOptionStrategy POST /accounts/{accountId}/optionStrategy/{optionStrategyId}/execute Place an option strategy order on the brokerage
PortfolioManagementApi AddPortfolioExcludedAsset POST /portfolioGroups/{portfolioGroupId}/excludedassets Adds an asset to exclude to a portfolio group
PortfolioManagementApi Create POST /portfolioGroups Create new portfolio group
PortfolioManagementApi CreateAssetClass POST /modelAssetClass Create a new model asset class
PortfolioManagementApi CreateModelPortfolio POST /modelPortfolio Creates a new model portfolio
PortfolioManagementApi DeleteAssetClass DELETE /modelAssetClass/{modelAssetClassId} Deletes a model asset class
PortfolioManagementApi DeleteExcludedAsset DELETE /portfolioGroups/{portfolioGroupId}/excludedassets/{symbolId} Unexclude an asset from a portfolio group
PortfolioManagementApi DeleteModelPortfolioById DELETE /modelPortfolio/{modelPortfolioId} Deletes a model portfolio
PortfolioManagementApi DeletePortfoli DELETE /portfolioGroups/{portfolioGroupId} Remove a target portfolio.
PortfolioManagementApi DeletePortfolioTargetById DELETE /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId} Remove a TargetAsset.
PortfolioManagementApi DetailAssetClass GET /modelAssetClass/{modelAssetClassId} Get details of a model asset class
PortfolioManagementApi GetCalculatedTradeById GET /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/{TradeId} Return an individual trade
PortfolioManagementApi GetModelDetailsById GET /modelPortfolio/{modelPortfolioId} Get details of a model portfolio
PortfolioManagementApi GetPortfolioBalances GET /portfolioGroups/{portfolioGroupId}/balances Get sum of cash balances in portfolio group
PortfolioManagementApi GetPortfolioDetailsById GET /portfolioGroups/{portfolioGroupId} Get details of a target portfolio
PortfolioManagementApi GetPortfolioInfo GET /portfolioGroups/{portfolioGroupId}/info Return a whole bunch of relevant information relating to a portfolio group.
PortfolioManagementApi GetPortfolioSettings GET /portfolioGroups/{portfolioGroupId}/settings Get portfolio group settings
PortfolioManagementApi GetPortfolioTargetById GET /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId} Get a specific target from a portfolio group
PortfolioManagementApi GetPortfolioTargets GET /portfolioGroups/{portfolioGroupId}/targets Get all target assets under the specified PortfolioGroup.
PortfolioManagementApi GetPortoflioExcludedAssets GET /portfolioGroups/{portfolioGroupId}/excludedassets Get an array of excluded assets associated with a portfolio group\
PortfolioManagementApi ImportModelPortfolio POST /portfolioGroups/{portfolioGroupId}/import Import target allocation based on portfolio group
PortfolioManagementApi List GET /portfolioGroups List all portfolio groups
PortfolioManagementApi ListAssetClasses GET /modelAssetClass List of model asset class
PortfolioManagementApi ListCalculatedTrades GET /portfolioGroups/{portfolioGroupId}/calculatedtrades List of trades to make to rebalance portfolio group
PortfolioManagementApi ListModelPortfolio GET /modelPortfolio List of model portfolio
PortfolioManagementApi ListPortfolioAccounts GET /portfolioGroups/{portfolioGroupId}/accounts Get all accounts associated with a portfolio group
PortfolioManagementApi ModifyModelPortfolioById POST /modelPortfolio/{modelPortfolioId} Updates model portfolio object
PortfolioManagementApi SavePortfolio PATCH /portfolioGroups/{portfolioGroupId} Update an existing target portfolio.
PortfolioManagementApi SearchPortfolioSymbols POST /portfolioGroups/{portfolioGroupId}/symbols Search for symbols limited to brokerages under the specified portfolio group
PortfolioManagementApi SetPortfolioTargets POST /portfolioGroups/{portfolioGroupId}/targets Set a new list of target assets under the specified PortfolioGroup. All existing target assets under this portfolio group will be replaced with the new list.
PortfolioManagementApi UpdateAssetClass POST /modelAssetClass/{modelAssetClassId} Updates model asset class objects
PortfolioManagementApi UpdatePortfolioSettings PATCH /portfolioGroups/{portfolioGroupId}/settings Updates portfolio group settings
PortfolioManagementApi UpdatePortfolioTargetById PATCH /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId} Update a TargetAsset under the specified PortfolioGroup.
ReferenceDataApi GetCurrencyExchangeRatePair GET /currencies/rates/{currencyPair} Return the exchange rate of a currency pair
ReferenceDataApi GetPartnerInfo GET /snapTrade/partners Get metadata related to Snaptrade partner
ReferenceDataApi GetSecurityTypes GET /securityTypes List of all security types.
ReferenceDataApi GetStockExchanges GET /exchanges Return list of stock exchanges on Passiv and their suffixes
ReferenceDataApi GetSymbols POST /symbols Search for symbols
ReferenceDataApi GetSymbolsByTicker GET /symbols/{ticker} Get details of a symbol by the ticker
ReferenceDataApi ListAllBrokerageAuthorizationType GET /brokerageAuthorizationTypes List of all brokerage authorization types
ReferenceDataApi ListAllBrokerages GET /brokerages List of all brokerages.
ReferenceDataApi ListAllCurrencies GET /currencies List of all supported currencies
ReferenceDataApi ListAllCurrenciesRates GET /currencies/rates Return the exchange rates of all supported currencies
ReferenceDataApi SymbolSearchUserAccount POST /accounts/{accountId}/symbols Search for symbols that are supported by a brokerage account using a substring
TradingApi CancelUserAccountOrder POST /accounts/{accountId}/orders/cancel Cancel open order in account
TradingApi GetCalculatedTradeImpactById GET /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/modify/{tradeId} Return details of a specific trade before it's placed
TradingApi GetCalculatedTradesImpact GET /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/impact Return the impact of placing a series of trades on the portfolio
TradingApi GetOrderImpact POST /trade/impact Check impact of trades on account.
TradingApi GetUserAccountQuotes GET /accounts/{accountId}/quotes Get symbol quotes
TradingApi ModifyCalculatedTradeById PATCH /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/modify/{tradeId} Modify units of a trade before it is placed
TradingApi PlaceCalculatedTrades POST /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/placeOrders Place orders for the CalculatedTrades in series
TradingApi PlaceForceOrder POST /trade/place Place a trade with NO validation.
TradingApi PlaceOCOOrder POST /trade/oco Place a OCO (One Cancels Other) order
TradingApi PlaceOrder POST /trade/{tradeId} Place order
TransactionsAndReportingApi GetActivities GET /activities Get transaction history for a user
TransactionsAndReportingApi GetReportingCustomRange GET /performance/custom Get performance information for a specific timeframe

Documentation for Models

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.0.15 34 4/18/2024
5.0.14 70 4/12/2024
5.0.13 108 4/5/2024
5.0.12 260 3/14/2024
5.0.11 73 3/12/2024
5.0.10 90 3/5/2024
5.0.9 372 2/23/2024
5.0.8 97 2/21/2024
5.0.7 76 2/16/2024
5.0.6 96 2/14/2024
5.0.5 80 2/9/2024
5.0.4 73 2/2/2024
5.0.3 339 2/1/2024
5.0.2 83 1/29/2024
5.0.1 77 1/26/2024
5.0.0 75 1/24/2024
4.0.12 800 1/17/2024
4.0.11 84 1/16/2024
4.0.10 191 1/11/2024
4.0.9 120 1/3/2024
4.0.8 413 12/12/2023
4.0.7 162 12/4/2023
4.0.6 117 11/30/2023
4.0.5 107 11/15/2023
4.0.4 114 11/8/2023
4.0.3 121 11/1/2023
4.0.2 148 10/18/2023
4.0.1 147 10/13/2023
4.0.0 149 10/7/2023
3.33.2 204 9/26/2023
3.33.1 158 9/19/2023
3.33.0 231 9/2/2023
3.32.1 151 8/31/2023
3.32.0 153 8/16/2023
3.31.0 167 8/14/2023
3.30.0 202 8/11/2023
3.29.0 165 8/9/2023
3.28.0 176 8/9/2023
3.27.0 175 8/4/2023
3.26.0 158 8/2/2023
3.25.0 192 7/31/2023
3.24.0 166 7/27/2023
3.23.0 178 7/27/2023
3.22.0 176 7/18/2023
3.21.0 171 6/22/2023
3.20.0 170 6/13/2023
3.19.0 171 6/7/2023
3.18.0 197 6/5/2023
3.17.0 247 6/1/2023
3.15.0 163 5/29/2023
3.14.0 168 5/26/2023
3.13.0 3,529 5/18/2023
3.12.0 154 5/16/2023
3.11.0 161 5/15/2023
3.10.0 188 5/9/2023
3.9.0 473 4/28/2023
3.8.0 202 4/28/2023
3.7.0 370 4/23/2023
3.6.0 169 4/21/2023
3.5.0 195 4/20/2023
3.4.0 186 4/18/2023
3.3.0 195 4/17/2023
3.2.0 214 4/15/2023
3.1.0 200 4/15/2023
3.0.0 211 4/12/2023
2.0.0 217 4/11/2023
1.3.0 233 4/6/2023
1.2.0 217 4/6/2023
1.1.0 242 4/6/2023
1.0.0 236 4/6/2023

Minor update