Swift SDK
The IPWho Swift SDK wraps the IP geolocation API in idiomatic Swift — Codable response structs, structured error throwing, and zero-dependency SPM installation. One call returns the full payload: geolocation, timezone, currency, connection (ASN/ISP), security flags, and more.
- Source: lavrox/SDK-IPWho-IP-Geolocation-Swift
- API key: ipwho.org/free-plan
Installation
Section titled “Installation”Xcode: File → Add Package Dependencies…
https://github.com/lavrox/SDK-IPWho-IP-Geolocation-Swift.package(url: "https://github.com/lavrox/SDK-IPWho-IP-Geolocation-Swift.git", from: "1.0.0")Swift 5.9+.
Quick start
Section titled “Quick start”import IPWho
let client = IPWhoClient(apiKey: ProcessInfo.processInfo.environment["IPWHO_API_KEY"] ?? "")
let resp = try await client.lookup(ip: "8.8.8.8") // GET /ip/{ip}let me = try await client.me() // GET /melet bulk = try await client.bulk(ips: ["8.8.8.8", "1.1.1.1"])Error handling
Section titled “Error handling”do { let resp = try await client.lookup(ip: "8.8.8.8")} catch let error as IPWhoError { switch error { case .invalidIP: // malformed IP address (404) case .rateLimitExceeded: // plan limit reached (429) case .apiError(let message): // unexpected response }}Methods
Section titled “Methods”lookup(ip:)—GET /ip/{ip}(async throws)me()—GET /me(async throws)bulk(ips:)—GET /bulk/{a,b,c}(async throws)