@gitchrisqueen/tdameritrade-api-js-client
v0.2.1
Published
TD Ameritrade API integration for node.js
Downloads
347
Maintainers
Readme
TD Ameritrade API integration for Node.js
See - TD Ameritrade API
Installation
$ npm i @gitchrisqueen/tdameritrade-api-js-client --save
Getting Started
Please follow the installation instruction and execute the following JS code:
var GitChrisQueen_TDA_JS = require('@gitchrisqueen/tdameritrade-api-js-client');
var defaultClient = GitChrisQueen_TDA_JS.ApiClient.instance;
// Configure API key authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearerAuth.apiKeyPrefix['Authorization'] = "Token"
var api = new GitChrisQueen_TDA_JS.AccountsApi()
var accountId = 56; // {Number}
var opts = {
'fields': "fields_example" // {String} Balances displayed by default, additional fields can be added here by adding positions or orders. Example: fields=positions,orders
};
api.accountsAccountIdGET(accountId, opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Documentation for API Endpoints
All URIs are relative to https://api.tdameritrade.com/v1
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- GitChrisQueen_TDA_JS.AccountsApi | accountsAccountIdGET | GET /accounts/{accountId} | Get Account GitChrisQueen_TDA_JS.AccountsApi | accountsGET | GET /accounts | Get Accounts GitChrisQueen_TDA_JS.AuthenticationApi | oauth2TokenPOST | POST /oauth2/token | Post Access Token GitChrisQueen_TDA_JS.InstrumentsApi | instrumentsCusipGET | GET /instruments/{cusip} | Get Instrument GitChrisQueen_TDA_JS.InstrumentsApi | instrumentsGET | GET /instruments | Search Instruments GitChrisQueen_TDA_JS.MarketHoursApi | marketdataHoursGET | GET /marketdata/hours | Get Hours for Multiple Markets GitChrisQueen_TDA_JS.MarketHoursApi | marketdataMarketHoursGET | GET /marketdata/{market}/hours | Get Hours for Multiple Markets GitChrisQueen_TDA_JS.MoversApi | marketdataIndexMoversGET | GET /marketdata/{index}/movers | Get price history for a symbol GitChrisQueen_TDA_JS.OptionChainsApi | marketdataChainsGET | GET /marketdata/chains | Get Option Chain GitChrisQueen_TDA_JS.OrdersApi | accountsAccountIdOrdersGET | GET /accounts/{accountId}/orders | Get Orders by Path GitChrisQueen_TDA_JS.OrdersApi | accountsAccountIdOrdersOrderIdDELETE | DELETE /accounts/{accountId}/orders/{orderId} | Cancel Order GitChrisQueen_TDA_JS.OrdersApi | accountsAccountIdOrdersOrderIdGET | GET /accounts/{accountId}/orders/{orderId} | Get Order GitChrisQueen_TDA_JS.OrdersApi | accountsAccountIdOrdersOrderIdPUT | PUT /accounts/{accountId}/orders/{orderId} | Replace Order GitChrisQueen_TDA_JS.OrdersApi | ordersGET | GET /orders | Get Orders By Query GitChrisQueen_TDA_JS.OrdersApi | ordersPOST | POST /orders | Place Order GitChrisQueen_TDA_JS.PriceHistoryApi | marketdataSymbolPricehistoryGET | GET /marketdata/{symbol}/pricehistory | Get price history for a symbol GitChrisQueen_TDA_JS.QuotesApi | marketdataQuotesGET | GET /marketdata/quotes | Get Quotes GitChrisQueen_TDA_JS.QuotesApi | marketdataSymbolQuotesGET | GET /marketdata/{symbol}/quotes | Get Quote GitChrisQueen_TDA_JS.SavedOrdersApi | accountsAccountIdSavedordersGET | GET /accounts/{accountId}/savedorders | Get Saved Orders by Path GitChrisQueen_TDA_JS.SavedOrdersApi | accountsAccountIdSavedordersPOST | POST /accounts/{accountId}/savedorders | Create Saved Orders GitChrisQueen_TDA_JS.SavedOrdersApi | accountsAccountIdSavedordersSavedOrderIdDELETE | DELETE /accounts/{accountId}/savedorders/{savedOrderId} | Delete Saved Orders GitChrisQueen_TDA_JS.SavedOrdersApi | accountsAccountIdSavedordersSavedOrderIdGET | GET /accounts/{accountId}/savedorders/{savedOrderId} | Get Saved Orders GitChrisQueen_TDA_JS.SavedOrdersApi | accountsAccountIdSavedordersSavedOrderIdPUT | PUT /accounts/{accountId}/savedorders/{savedOrderId} | Replace Saved Orders GitChrisQueen_TDA_JS.TransactionsApi | accountsAccountIdTransactionsGET | GET /accounts/{accountId}/transactions | Get Transactions GitChrisQueen_TDA_JS.TransactionsApi | accountsAccountIdTransactionsTransactionIdGET | GET /accounts/{accountId}/transactions/{transactionId} | Get Transaction GitChrisQueen_TDA_JS.UserInfoPreferencesApi | accountsAccountIdPreferencesGET | GET /accounts/{accountId}/preferences | Get Preferences GitChrisQueen_TDA_JS.UserInfoPreferencesApi | accountsAccountIdPreferencesPUT | PUT /accounts/{accountId}/preferences | Update Preferences GitChrisQueen_TDA_JS.UserInfoPreferencesApi | userprincipalsGET | GET /userprincipals | Get User Principals GitChrisQueen_TDA_JS.UserInfoPreferencesApi | userprincipalsStreamersubscriptionkeysGET | GET /userprincipals/streamersubscriptionkeys | Get Streamer Subscription Keys GitChrisQueen_TDA_JS.WatchlistApi | accountsAccountIdWatchlistsGET | GET /accounts/{accountId}/watchlists | Get Watchlists for Single Account GitChrisQueen_TDA_JS.WatchlistApi | accountsAccountIdWatchlistsPOST | POST /accounts/{accountId}/watchlists | Create Watchlist GitChrisQueen_TDA_JS.WatchlistApi | accountsAccountIdWatchlistsWatchlistIdGET | GET /accounts/{accountId}/watchlists/{watchlistId} | Get Watchlists GitChrisQueen_TDA_JS.WatchlistApi | accountsAccountIdWatchlistsWatchlistIdPATCH | PATCH /accounts/{accountId}/watchlists/{watchlistId} | Update Watchlist GitChrisQueen_TDA_JS.WatchlistApi | accountsAccountIdWatchlistsWatchlistIdPUT | PUT /accounts/{accountId}/watchlists/{watchlistId} | Replace Watchlist GitChrisQueen_TDA_JS.WatchlistApi | accountsWatchlistsGET | GET /accounts/watchlists | Get Watchlists for Multiple Accounts
Documentation for Models
- GitChrisQueen_TDA_JS.Account
- GitChrisQueen_TDA_JS.AccountSecuritiesAccount
- GitChrisQueen_TDA_JS.AssetType
- GitChrisQueen_TDA_JS.Bond
- GitChrisQueen_TDA_JS.CandleList
- GitChrisQueen_TDA_JS.CandleListCandles
- GitChrisQueen_TDA_JS.CashAccount
- GitChrisQueen_TDA_JS.CashAccountBalances
- GitChrisQueen_TDA_JS.CashAccountCurrentBalances
- GitChrisQueen_TDA_JS.CashAccountInitialBalances
- GitChrisQueen_TDA_JS.CashEquivalent
- GitChrisQueen_TDA_JS.Duration
- GitChrisQueen_TDA_JS.EASObject
- GitChrisQueen_TDA_JS.ETFQuote
- GitChrisQueen_TDA_JS.Equity
- GitChrisQueen_TDA_JS.EquityAssetType
- GitChrisQueen_TDA_JS.EquityQuote
- GitChrisQueen_TDA_JS.ErrorObject
- GitChrisQueen_TDA_JS.Execution
- GitChrisQueen_TDA_JS.ExecutionExecutionLegs
- GitChrisQueen_TDA_JS.ExpirationDate
- GitChrisQueen_TDA_JS.FixedIncome
- GitChrisQueen_TDA_JS.ForexQuote
- GitChrisQueen_TDA_JS.FrequencyType
- GitChrisQueen_TDA_JS.Fundamental
- GitChrisQueen_TDA_JS.FundamentalData
- GitChrisQueen_TDA_JS.FundamentalFundamental
- GitChrisQueen_TDA_JS.FutureOptionsQuote
- GitChrisQueen_TDA_JS.FutureQuote
- GitChrisQueen_TDA_JS.GetOptionChainResponse
- GitChrisQueen_TDA_JS.GetQuoteResponse
- GitChrisQueen_TDA_JS.Hours
- GitChrisQueen_TDA_JS.HoursSessionHours
- GitChrisQueen_TDA_JS.IndexQuote
- GitChrisQueen_TDA_JS.Instrument
- GitChrisQueen_TDA_JS.LotMethod
- GitChrisQueen_TDA_JS.MarginAccount
- GitChrisQueen_TDA_JS.MarginAccountBalances
- GitChrisQueen_TDA_JS.MarginAccountCurrentBalances
- GitChrisQueen_TDA_JS.MarginAccountInitialBalances
- GitChrisQueen_TDA_JS.MarginAccountOrderStrategies
- GitChrisQueen_TDA_JS.MarginAccountPositions
- GitChrisQueen_TDA_JS.Mover
- GitChrisQueen_TDA_JS.MutualFund
- GitChrisQueen_TDA_JS.MutualFundQuote
- GitChrisQueen_TDA_JS.Option
- GitChrisQueen_TDA_JS.OptionChain
- GitChrisQueen_TDA_JS.OptionChainOption
- GitChrisQueen_TDA_JS.OptionChainOptionOptionDeliverablesList
- GitChrisQueen_TDA_JS.OptionChainOptionPutCall
- GitChrisQueen_TDA_JS.OptionChainStrategy
- GitChrisQueen_TDA_JS.OptionChainUnderlying
- GitChrisQueen_TDA_JS.OptionDeliverable
- GitChrisQueen_TDA_JS.OptionDeliverableInner
- GitChrisQueen_TDA_JS.OptionDeliverableInnerAssetType
- GitChrisQueen_TDA_JS.OptionQuote
- GitChrisQueen_TDA_JS.OrderActivity
- GitChrisQueen_TDA_JS.OrderGet
- GitChrisQueen_TDA_JS.OrderGetCancelTime
- GitChrisQueen_TDA_JS.OrderGetDuration
- GitChrisQueen_TDA_JS.OrderGetInstrument
- GitChrisQueen_TDA_JS.OrderGetOrderActivityCollection
- GitChrisQueen_TDA_JS.OrderGetOrderLegCollection
- GitChrisQueen_TDA_JS.OrderGetOrderType
- GitChrisQueen_TDA_JS.OrderGetSession
- GitChrisQueen_TDA_JS.OrderType
- GitChrisQueen_TDA_JS.PeriodType
- GitChrisQueen_TDA_JS.Positions
- GitChrisQueen_TDA_JS.PositionsInner
- GitChrisQueen_TDA_JS.PositionsInnerInstrument
- GitChrisQueen_TDA_JS.PostAccessBody
- GitChrisQueen_TDA_JS.Preferences
- GitChrisQueen_TDA_JS.PutCall
- GitChrisQueen_TDA_JS.SearchInstrument
- GitChrisQueen_TDA_JS.SearchInstrumentResponse
- GitChrisQueen_TDA_JS.SecuritiesAccount
- GitChrisQueen_TDA_JS.Session
- GitChrisQueen_TDA_JS.Strategy
- GitChrisQueen_TDA_JS.StrikePriceMap
- GitChrisQueen_TDA_JS.SubscriptionKey
- GitChrisQueen_TDA_JS.SubscriptionKeyKeys
- GitChrisQueen_TDA_JS.Transaction
- GitChrisQueen_TDA_JS.TransactionTransactionItem
- GitChrisQueen_TDA_JS.TransactionTransactionItemInstrument
- GitChrisQueen_TDA_JS.Underlying
- GitChrisQueen_TDA_JS.UserPrincipal
- GitChrisQueen_TDA_JS.UserPrincipalAccounts
- GitChrisQueen_TDA_JS.UserPrincipalAuthorizations
- GitChrisQueen_TDA_JS.UserPrincipalPreferences
- GitChrisQueen_TDA_JS.UserPrincipalPreferencesMutualFundTaxLotMethod
- GitChrisQueen_TDA_JS.UserPrincipalQuotes
- GitChrisQueen_TDA_JS.UserPrincipalStreamerInfo
- GitChrisQueen_TDA_JS.UserPrincipalStreamerSubscriptionKeys
- GitChrisQueen_TDA_JS.WatchList
- GitChrisQueen_TDA_JS.WatchListInstrument
- GitChrisQueen_TDA_JS.WatchListRequest
- GitChrisQueen_TDA_JS.WatchListRequestInstrument
- GitChrisQueen_TDA_JS.WatchListRequestWatchlistItems
- GitChrisQueen_TDA_JS.WatchListResponse
- GitChrisQueen_TDA_JS.WatchListWatchlistItems
Documentation for Authorization
application
- Type: OAuth
- Flow: accessCode
- Authorization URL: https://auth.tdameritrade.com/auth?response_type=code&redirect_uri=http%3A%2F%2Flocalhost&client_id=YHJUQFCHRMJ7XODGVGGPINB05SCG2H45%40AMER.OAUTHAP
- Scopes: N/A
bearerAuth
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header