Multi-Language SDKs
Native clients for Rust, Python, Go, and C++. Each SDK returns fully typed structures in its language's native idiom.
No terminal. No overhead. Pure speed. Connect directly to ThetaData from Rust, Python, Go, and C++.
# Add to Cargo.toml
cargo add thetadatadx tokio --features tokio/rt-multi-thread,tokio/macrospip install thetadatadx
# With pandas DataFrame support
pip install thetadatadx[pandas]# Build the Rust FFI library first
cargo build --release -p thetadatadx-ffi# Build the Rust FFI library first
cargo build --release -p thetadatadx-ffi
# Then link against libthetadatadx_ffi.so/.dylibuse thetadatadx::{ThetaDataDx, Credentials, DirectConfig};
#[tokio::main]
async fn main() -> Result<(), thetadatadx::Error> {
let creds = Credentials::from_file("creds.txt")?;
let tdx = ThetaDataDx::connect(&creds, DirectConfig::production()).await?;
let quotes = tdx.stock_history_quote("AAPL", "20250115", "60000").await?;
for q in "es {
println!("{}: bid={} ask={}", q.date, q.bid_price(), q.ask_price());
}
Ok(())
}from thetadatadx import ThetaDataDx, Credentials, Config
creds = Credentials.from_file("creds.txt")
tdx = ThetaDataDx(creds, Config.production())
quotes = tdx.stock_history_quote("AAPL", "20250115", "60000")
for q in quotes:
print(f"{q['date']}: bid={q['bid']:.2f} ask={q['ask']:.2f}")creds, _ := thetadatadx.CredentialsFromFile("creds.txt")
defer creds.Close()
config := thetadatadx.ProductionConfig()
defer config.Close()
client, _ := thetadatadx.Connect(creds, config)
defer client.Close()
quotes, _ := client.StockHistoryQuote("AAPL", "20250115", "60000")
for _, q := range quotes {
fmt.Printf("%d: bid=%.2f ask=%.2f\n", q.Date, q.Bid, q.Ask)
}#include "thetadx.hpp"
auto creds = tdx::Credentials::from_file("creds.txt");
auto client = tdx::Client::connect(creds, tdx::Config::production());
auto quotes = client.stock_history_quote("AAPL", "20250115", "60000");
for (auto& q : quotes) {
std::cout << q.date << ": bid=" << q.bid
<< " ask=" << q.ask << std::endl;
}