SDKs
First-party clients for the DataMaxi+ API. All SDKs are generated from the same OpenAPI spec, so endpoint coverage is identical and types stay in lock-step across languages — when a new endpoint ships on the REST API, every SDK gains a typed wrapper for it in the next release.
| Language | Package | Full reference |
|---|---|---|
| Python | datamaxi | python.datamaxiplus.com |
| Rust | datamaxi | rust.datamaxiplus.com |
| TypeScript | @bisonai/datamaxi | See TypeScript |
Per-language deep dives (full method reference, type definitions, async/await patterns) live on the dedicated subdomains. The sections below give you enough to install, authenticate, and make a first call without bouncing.
Choosing an SDK
- Python — analysis, research notebooks, trading bots, anything that touches pandas/NumPy. Default choice for most users.
- Rust — low-latency systems, market-makers, anything where allocation and GC matter. Strongly-typed end to end.
- TypeScript — browser dashboards, Node services, Edge runtimes (Cloudflare Workers, Vercel Edge). Same package on both sides; see TypeScript for browser-vs-server key safety.
Common patterns
All SDKs follow the same conventions; the language idioms differ but the moving parts don't.
▸ API key via env var. Set DTMX_API_KEY once and the client picks it up. Constructor-arg auth also works for multi-tenant code.
▸ Rate-limit handling. SDKs surface HTTP 429 as a typed error with retry-after metadata. Apply your own backoff or use the built-in retry helpers. See Rate Limits.
▸ Pagination. Most list/history endpoints return a tuple of (page, next_fn) (Python/TS) or (page, cursor) (Rust). Call the next function/cursor to fetch the following page; receive None/null when exhausted.
▸ Errors. All client errors map to a single SDK exception type with the upstream HTTP status, error code, and message preserved. See Errors.
▸ Streaming. WebSocket subscriptions are exposed as iterators / async iterators / Stream impls — same payload shape as the raw WS API.
Python
Primary client for DataMaxi+. Covers every REST endpoint and every WebSocket stream.
▸ Full reference: python.datamaxiplus.com ▸ Source: github.com/Bisonai/datamaxi-python ▸ Package: pypi.org/project/datamaxi
Install
Requires Python 3.8+.
pip install datamaxi
Auth
The client reads DTMX_API_KEY from the environment, or accepts an explicit api_key= argument.
export DTMX_API_KEY="your_api_key_here"
Get a key from your account page.
First call
from datamaxi.datamaxi import Datamaxi
maxi = Datamaxi(api_key="YOUR_API_KEY") # or omit to read DTMX_API_KEY
candle, get_next = maxi.cex.candle(
exchange="binance",
symbol="BTC-USDT",
interval="1h",
)
print(candle[:3])
Symbol format is BASE-QUOTE (note the dash, not a slash). Call get_next() to paginate.
Async vs sync
The current public Python SDK exposes a synchronous client (Datamaxi). Method calls block on the network. For async workloads, wrap calls in asyncio.to_thread() or run the client in an executor.
The full async API surface, if/when it lands, will be documented at python.datamaxiplus.com. Treat the snippet above as the verified shape.
WebSocket streaming
WebSocket access is a separate sub-module. Minimal funding-rate subscription:
from datamaxi.websocket.funding_rate import FundingRateWebsocketClient
ws = FundingRateWebsocketClient(api_key="YOUR_API_KEY")
ws.subscribe(symbols=["BTC-USDT@binance"])
for msg in ws.recv():
print(msg) # {"f": 0.0001, "i": 8, "e": "binance", ...}
Class names and import paths for WebSocket clients can shift between SDK releases. Verify against python.datamaxiplus.com for your installed version. The payload shape (
f,i,e,s, ...) is stable and matches the raw WS API.
Rust
Strongly-typed async client for low-latency consumers.
▸ Full reference: rust.datamaxiplus.com ▸ Crate: crates.io/crates/datamaxi
Install
Add the crate to Cargo.toml. Pin to the latest published version.
[dependencies]
datamaxi = "*"
tokio = { version = "1", features = ["full"] }
The client is async and expects a Tokio runtime.
Auth
The client reads DTMX_API_KEY from the environment, or accepts an explicit key in the constructor.
export DTMX_API_KEY="your_api_key_here"
First call
use datamaxi::Datamaxi;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Datamaxi::new(std::env::var("DTMX_API_KEY")?);
let candles = client
.cex()
.candle("binance", "BTC-USDT", "1h")
.await?;
println!("{:#?}", candles);
Ok(())
}
Exact module path (
datamaxi::Datamaxivsdatamaxi::client::Client) and the method-chaining surface (.cex().candle(...)) may differ in the published crate. Verify against rust.datamaxiplus.com for your installed version. The endpoint coverage and the symbol format (BASE-QUOTE) are stable across SDKs.
WebSocket streaming
Streams are exposed as Stream-impl types you can poll inside any async task:
// pseudo-shape, see rust.datamaxiplus.com for exact API
let mut stream = client.ws().funding_rate(&["BTC-USDT@binance"]).await?;
while let Some(msg) = stream.next().await {
println!("{:?}", msg?);
}
TypeScript
Isomorphic client — same package runs in Node, the browser, and Edge runtimes (Cloudflare Workers, Vercel Edge, Deno).
▸ Package: @bisonai/datamaxi
A dedicated
ts.datamaxiplus.comreference site does not exist yet — this is a known gap. Until it lands, the npm README and the type definitions shipped with the package are the source of truth.
Install
npm install @bisonai/datamaxi
# or
pnpm add @bisonai/datamaxi
# or
yarn add @bisonai/datamaxi
Auth
The client reads DTMX_API_KEY from process.env in Node, or accepts an explicit apiKey option in any runtime.
export DTMX_API_KEY="your_api_key_here"
First call
import { Datamaxi } from "@bisonai/datamaxi";
const maxi = new Datamaxi({ apiKey: process.env.DTMX_API_KEY });
const { data, next } = await maxi.cex.candle({
exchange: "binance",
symbol: "BTC-USDT",
interval: "1h",
});
console.log(data.slice(0, 3));
Exact named export (
DatamaxivsClient) and the call-style (object-arg vs positional) may differ in the published package. Check the package'sindex.d.tsafternpm installfor the verified shape. Endpoint coverage and symbol format (BASE-QUOTE) are stable across SDKs.
Browser vs Node
Node / Edge — safe
Run the client wherever you can hold an API key as a secret: a backend service, a serverless function, an Edge worker. This is the recommended pattern.
Browser — avoid for production keys
The SDK works in the browser (it ships ESM and uses fetch), but shipping an API key to a browser bundle exposes it to anyone who opens dev tools. CORS will let the call go through; that is not the same as it being safe.
Patterns to use instead:
▸ Proxy through your own backend. Browser hits your server; your server holds the key and forwards to DataMaxi+.
▸ Short-lived scoped keys. Mint a key per session on your backend, hand it to the browser, rotate aggressively.
▸ Server components / RSC. If you're on Next.js or similar, do the data fetch on the server and stream HTML to the client.
Next steps
- REST endpoints — full catalog
- WebSocket endpoints — streaming
- Rate limits
- Errors