Kotlin SDK
The IPWho Kotlin SDK wraps the IP geolocation API in idiomatic Kotlin — data class responses, coroutine support, and a single Maven dependency. One call returns the full payload: geolocation, timezone, currency, connection (ASN/ISP), security flags, and more.
- Source: lavrox/SDK-IPWho-IP-Geolocation-Kotlin
- Maven:
com.lavrox:ipwho-kotlin:1.0.0 - API key: ipwho.org/free-plan
Installation
Section titled “Installation”implementation("com.lavrox:ipwho-kotlin:1.0.0")JDK 17+, Ktor, kotlinx.serialization, coroutines. Apply kotlin("plugin.serialization"). Package: com.ipwho.sdk. Public methods are suspend.
Quick start
Section titled “Quick start”val client = IpWhoClient(System.getenv("IPWHO_API_KEY"))
val resp = client.lookup("8.8.8.8") // GET /ip/{ip}val me = client.me() // GET /meval bulk = client.bulk(listOf("8.8.8.8", "1.1.1.1"))Error handling
Section titled “Error handling”try { val resp = client.lookup("8.8.8.8")} catch (e: InvalidIPException) { // malformed IP address (404)} catch (e: RateLimitException) { // plan limit reached (429)} catch (e: APIResponseException) { // unexpected response}Methods
Section titled “Methods”lookup(ip: String)—GET /ip/{ip}(suspend)me()—GET /me(suspend)bulk(ips: List<String>)—GET /bulk/{a,b,c}(suspend)