0.10.2 ā¢ Published 5 months ago
tda-wsjson-client v0.10.2
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