npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gitchrisqueen/tdameritrade-api-js-client

v0.2.1

Published

TD Ameritrade API integration for node.js

Downloads

347

Readme

TD Ameritrade API Workflow CI

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

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