0.10.2 ā€¢ Published 5 months ago

tda-wsjson-client v0.10.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

TD Ameritrade WsJson API client

This is a node and browser API client for the (undocumented) TD Ameritrade WebSocket API.

šŸš§ Work in progress šŸš§

Prerequisites

  • Node 16+

Create a .env file and set your TD Ameritrade oauth access token:

CLIENT_ID=your-client-id
ACCESS_TOKEN=your-access-token
REFRESH_TOKEN=your-refresh-token
TOKEN_EXPIRES_AT=your-token-expires-at

Building for Node

yarn install
yarn build

Running the example app

cd example
yarn install
yarn link tda-wsjson-client
yarn start

Supported APIs

  • āœ… Authentication via access token
  • āœ… Quotes
  • āœ… Price History (chart)
  • āœ… Account positions
  • āœ… Place & submit order
  • āœ… Cancel order
  • āœ… User properties
  • āœ… Create alert
  • āœ… Cancel alert
  • āœ… Instrument search
  • āœ… Option chains
  • āœ… Alert lookup
  • āœ… Option chain details
  • āœ… Option chain quotes
  • āœ… Option quotes
  • āœ… Order events
  • āœ… Market depth
  • āœ… Get watchlist

Not yet implemented

  • āŒ Instrument order events
  • āŒ Alert subscription
  • āŒ And many more šŸ˜€

Usage

import WsJsonClient from "tda-wsjson-client/wsJsonClient";

const client = new WsJsonClient();
await client.authenticate(accessToken);
console.log(loginResponse);
const chartRequest = {
  symbol: "UBER",
  timeAggregation: "DAY",
  range: "YEAR2",
  includeExtendedHours: true,
};
for await (const event of client.chart(chartRequest)) {
  console.log(event);
}

For more sample usage check out https://github.com/felipecsl/tda-wsjson-client/blob/master/src/testApp.ts and https://github.com/felipecsl/tda-wsjson-client/blob/master/example/src/App.tsx

Running tests

yarn test

License

MIT

0.10.2

5 months ago

0.10.1

5 months ago

0.10.0

5 months ago

0.9.0

5 months ago

0.8.1

5 months ago

0.8.0

5 months ago

0.8.2

5 months ago

0.7.2

8 months ago

0.7.1

8 months ago

0.7.0

8 months ago

0.6.0

9 months ago

0.5.3

9 months ago

0.5.2

9 months ago

0.5.1

9 months ago

0.5.0

9 months ago

0.4.1

9 months ago

0.4.0

9 months ago

0.3.9

9 months ago

0.3.8

9 months ago

0.3.7

9 months ago

0.3.6

9 months ago

0.3.5

9 months ago

0.3.4

9 months ago

0.3.3

9 months ago

0.3.2

11 months ago

0.3.1

11 months ago

0.3.0

11 months ago

0.2.0

11 months ago

0.1.0

11 months ago