Official SDK Libraries
Official client libraries for Python, JavaScript, Go, and Rust. Simplify API integration with typed clients, automatic retry logic, and WebSocket support.
Python SDK
Package: smartmoney-api
Installation: pip install smartmoney-api
Repo: github.com/smartmoneyapi/python-client
from smartmoney import SmartMoneyAPI
# Initialize client
client = SmartMoneyAPI(api_key="sk_live_abc123xyz789")
# Get whale positions
whales = client.whale_positions(symbol="BTCUSDT", limit=50)
for position in whales:
print(f"{position.wallet_address}: {position.position_size} BTC @ {position.entry_price}")
# Get funding rates
funding = client.funding_rates(symbol="BTCUSDT", interval="4h", limit=24)
# Stream live updates
with client.stream_whale_positions(["BTCUSDT", "ETHUSDT"]) as stream:
for update in stream:
print(f"Position update: {update}")
Features
- Async/await support (asyncio, aiohttp)
- Automatic retry with exponential backoff
- WebSocket streaming with auto-reconnect
- Type hints and IDE autocomplete
- Request logging and debugging
JavaScript SDK
Package: smartmoney-api
Installation: npm install smartmoney-api
Repo: github.com/smartmoneyapi/js-client
import { SmartMoneyAPI } from "smartmoney-api";
const client = new SmartMoneyAPI({
apiKey: "sk_live_abc123xyz789"
});
// Get whale positions
const whales = await client.whalePositions({
symbol: "BTCUSDT",
limit: 50
});
whales.positions.forEach(pos => {
console.log(`${pos.wallet_address}: ${pos.position_size} BTC`);
});
// Stream real-time updates
const stream = client.streamWhalePositions(["BTCUSDT", "ETHUSDT"]);
stream.on("data", (update) => {
console.log("Position update:", update);
});
stream.on("error", (err) => {
console.error("Stream error:", err);
});
Go SDK
Module: github.com/smartmoneyapi/go-client
Installation: go get github.com/smartmoneyapi/go-client
package main
import (
"fmt"
"github.com/smartmoneyapi/go-client"
)
func main() {
// Create client
client := smartmoney.NewClient("sk_live_abc123xyz789")
// Get whale positions
positions, err := client.WhalePositions(ctx, &smartmoney.WhalePositionsFilter{
Symbol: "BTCUSDT",
Limit: 50,
})
if err != nil {
panic(err)
}
for _, pos := range positions {
fmt.Printf("%s: %.2f BTC\n", pos.WalletAddress, pos.PositionSize)
}
}
Rust SDK
Crate: smartmoney-api
Installation: cargo add smartmoney-api
use smartmoney_api::Client;
#[tokio::main]
async fn main() -> Result<(), Box> {
let client = Client::new("sk_live_abc123xyz789");
// Get whale positions
let positions = client
.whale_positions()
.symbol("BTCUSDT")
.limit(50)
.send()
.await?;
for position in positions.iter() {
println!(
"{}: {} BTC @ {}",
position.wallet_address,
position.position_size,
position.entry_price
);
}
Ok(())
}
Common Patterns
Error Handling
All SDKs provide rich error types with automatic retry logic. Errors include status code, error code, and human-readable message.
Request Timeouts
Configurable request timeouts (default 30s). Set custom timeouts for long-running operations.
Rate Limit Handling
Automatic exponential backoff when hitting rate limits. Respects Retry-After header.
Pick Your SDK
Get started with your language of choice. Full documentation and examples included.
View API Reference