0.10.2 • Published 2 years ago

tda-wsjson-client v0.10.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years 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

2 years ago

0.10.1

2 years ago

0.10.0

2 years ago

0.9.0

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.2

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.9

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago