@gitchrisqueen/tdameritrade-api-js-client

    0.2.1 • Public • Published

    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

    bearerAuth

    • Type: API key
    • API key parameter name: Authorization
    • Location: HTTP header

    Install

    npm i @gitchrisqueen/tdameritrade-api-js-client

    DownloadsWeekly Downloads

    23

    Version

    0.2.1

    License

    MIT

    Unpacked Size

    3.38 MB

    Total Files

    847

    Last publish

    Collaborators

    • npmchrisqueen