Expand description
Async Rust client for the Questrade REST API.
Handles OAuth token refresh, typed market-data access (quotes, option chains, candles), and account-data access (positions, balances, activities).
§Quick start
use questrade_client::{TokenManager, QuestradeClient};
let manager = TokenManager::new(
"your_refresh_token".to_string(),
false, // false = live account, true = practice account
None, // optional token-refresh callback
None, // optional cached token to skip initial refresh
).await?;
let client = QuestradeClient::new(manager)?;
let accounts = client.get_accounts().await?;
println!("accounts: {:?}", accounts);§Token persistence
Questrade refresh tokens are single-use. Pass an OnTokenRefresh
callback to TokenManager::new to persist the rotated token after every
automatic refresh so your next session can authenticate successfully.
Re-exports§
pub use auth::CachedToken;pub use auth::OnTokenRefresh;pub use auth::TokenManager;pub use auth::TokenResponse;pub use client::QuestradeClient;pub use client::QuestradeClientBuilder;pub use error::QuestradeError;pub use error::Result;
Modules§
- api_
types - Serde types for Questrade REST API request and response bodies.
- auth
- OAuth token management for the Questrade API.
- client
QuestradeClient— async HTTP client for the Questrade REST API.- error
- Error types for the questrade-client crate.