Rust SDK
The IPWho Rust SDK wraps the IP geolocation API in idiomatic Rust — serde-backed structs with Option for nullable fields, Result-based error handling, and a single cargo add. One call returns the full payload: geolocation, timezone, currency, connection (ASN/ISP), security flags, and more.
- Source: lavrox/SDK-IPWho-IP-Geolocation-Rust
- crates.io:
ipwho-sdk1.0.0 - API key: ipwho.org/free-plan
Installation
Section titled “Installation”cargo add ipwho-sdkTokio + reqwest. Client: IPWhoClient.
Quick start
Section titled “Quick start”use ipwho_sdk::IPWhoClient;
let client = IPWhoClient::new(std::env::var("IPWHO_API_KEY")?)?;
let resp = client.lookup("8.8.8.8", None, None).await?; // GET /ip/{ip}let me = client.me(None, None).await?; // GET /melet bulk = client.bulk(&["8.8.8.8", "1.1.1.1"]).await?;Error handling
Section titled “Error handling”match client.lookup("8.8.8.8", None, None).await { Ok(resp) => { /* use resp.data */ } Err(IpWhoError::InvalidIP) => { /* malformed IP (404) */ } Err(IpWhoError::RateLimitExceeded) => { /* plan limit (429) */ } Err(e) => { /* APIResponseError or transport */ }}Methods
Section titled “Methods”lookup(ip, fields, lang)—GET /ip/{ip}(async, returnsResult<IpGeoResponse>)me(fields, lang)—GET /me(async, returnsResult<IpGeoResponse>)bulk(ips)—GET /bulk/{a,b,c}(async)