An Unofficial Asynchronous Rust Library For TD Ameritrade's API. The library automatically handles authentification so you don't have to worry about it.
Add this to your Cargo.toml
toml
[dependencies]
tdameritrade_rust-async = "0.1.0"
async fn main() {
// Get Token File
TDAClient::initstart(
"chromedriverpath".into(), // Path To Chromedriver
"clientid@AMER.OAUTHAP".into(), // Client Id (Consumer Key)
"redirecturi".into(), // Redirect URI (Callback URL)
"tokenfilepath".into(), // Where To Put Token File After Completion
)
.await;
}
- After receiving the token file, you can create a client to access the API endpoints. Here's an example
use tdameritraderust_async::TDAClient;
async fn main() { // Create TDAClient let mut client = TDAClient::new( "clientid@AMER.OAUTHAP".into(), // Client Id (Consumer Key) "redirecturi".into(), // Redirect URI (Callback URL) "tokenfilepath".into(), // Location Of Token File );
// Get Quote
let res = client.get_quote("AAPL").await;
println!("{}", res);
} ```
tdameritrade_rust-async is released under the MIT license
tdameritrade_rust-async is an unofficial API wrapper. It is in no way endorsed by or affiliated with TD Ameritrade or any associated organization. The authors will accept no responsibility for any damage that might stem from use of this package. See the LICENSE file for more details.