Skip to content

Swift SDK

Swift SPM

SPM uses the GitHub repo URL (no extra registry). Product: IPWho. Client: IPWhoClient.

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+.

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 /me
let bulk = try await client.bulk(ips: ["8.8.8.8", "1.1.1.1"])