IPWho (ipwho.org) Rust SDK
Official Rust SDK for the IPWho IP geolocation API — geoip lookup, IP location, IP to country / latitude / longitude, ASN/ISP, timezone, currency, flag, and proxy/VPN detection. Works as an IP lookup / ip-geolocation client for IPv4 and IPv6 (lookup, me, bulk).
- Product: ipwho.org
- API docs: ipwho.org/docs
- Get an API key: ipwho.org/free-plan (free Lavrox account)
- Live API host:
https://api.ipwho.org
API key
Open a free Lavrox account to get an API key for IPWho. Create your key at ipwho.org/free-plan — no credit card required.
Installation
Tokio + reqwest. Client: IPWhoClient.
Quick Start
let client = new?;
let resp = client.lookup.await?; // GET /ip/{ip}
let me = client.me.await?; // GET /me
let bulk = client.bulk.await?; // BulkResponse
IpGeoResponse
├── success
├── message
└── data: Option<GeoData>
├── ip
├── geo_location
├── timezone
├── flag
├── currency
├── connection
├── security
└── user_agent
Reading the full response (8.8.8.8)
Live IPWho values: United States, ASN 15169, America/Chicago, dial code +1. Fields are Option.
let data = client.lookup.await?.data.unwrap;
println!; // 8.8.8.8
let geo = data.geo_location.as_ref.unwrap;
println!; // Some("United States")
println!; // Some("US")
println!;
println!;
println!;
println!;
println!;
println!;
println!;
println!; // Some("+1")
println!;
println!;
println!;
println!;
let tz = data.timezone.as_ref.unwrap;
println!; // Some("America/Chicago")
println!;
println!;
println!;
println!;
println!;
let flag = data.flag.as_ref.unwrap;
println!; // 🇺🇸
println!;
let cur = data.currency.as_ref.unwrap;
println!;
println!; // US dollars
let conn = data.connection.as_ref.unwrap;
println!; // 15169
println!; // Google LLC
println!;
println!;
println!;
println!; // Corporate
let sec = data.security.as_ref.unwrap;
println!;
println!;
println!;
if let Some = &data.user_agent
let me = client.me.await?;
println!;
let bulk = client.bulk.await?;
println!;
format / fields are Option<&str> (json/xml/csv; comma-separated filter).
API Reference
IPWhoClient::new(api_key) -> Result<Self, IpWhoError>
Also with_client. Query apiKey.
Errors
IpWhoError: Http, Api { status, message }, ApiLogical, Json, Url, Validation.
Type Definitions
Serde renames match the live wire (postal_Code, flag_Icon, isVpn, asn_number, name_plural, …). Also Timezone, Flag, Currency, Connection, Security, UserAgent.
Troubleshooting
- Key: ipwho.org.
- HTTP 403: SDK sends
ipwho-rust-sdk/1.0.0. - Most nested values are
Option.
Testing
IPWHO_API_KEY=your_key
IPWHO_API_KEY=your_key
The live check is examples/smoke.rs.
Changelog
v1.0.0
lookup,me,bulkmatching api.ipwho.org
License
MIT License — see LICENSE.
Support
- Documentation: ipwho.org/docs
- Contact: ipwho.org/contact
- GitHub Issues: lavrox/SDK-IPWho-IP-Geolocation-Rust
- Website: ipwho.org
Lavrox — Independent API infrastructure. Lower latency, lower cost.