Interact with the AntiVPN API on https://funkemunky.cc.
Java
import dev.brighten.isitbad.IsItBadAPI;
import dev.brighten.isitbad.structures.FailedResponse;
import dev.brighten.isitbad.structures.IpInformation;
import dev.brighten.isitbad.utils.Result;
public class ExampleAPI {
public static void main(String[] args) {
IsItBadAPI.setLicense("MY_LICENSE");
Result<IpInformation, FailedResponse> apiResult = IsItBadAPI.getIpInformation("192.168.1.1");
if(apiResult instanceof Result.Ok) {
IpInformation result = apiResult.unwrap();
System.out.println("IP: " + result.getIp());
} else {
FailedResponse result = ((Result.Err<IpInformation, FailedResponse>)apiResult).getError();
System.out.println("Failed to get IP information: " + result.getReason());
}
}
}
Kotlin
import dev.brighten.isitbad.IsItBadAPI
import dev.brighten.isitbad.structures.FailedResponse
import dev.brighten.isitbad.structures.IpInformation
import dev.brighten.isitbad.utils.Result
fun main() {
IsItBadAPI.setLicense("MY_LICENSE")
val apiResult = IsItBadAPI.getIpInformation("192.168.1.1")
if (apiResult is Result.Ok) {
val result: IpInformation = apiResult.unwrap()
val bad = if (result.isProxy) {
"yes"
} else {
"no"
}
println("IP: ${result.ip} and is it bad? ${if (result.isProxy) "yes" else "no"}")
} else {
val result: FailedResponse = (apiResult as Result.Err<IpInformation, FailedResponse>).error
println("Failed to get IP information: " + result.reason)
}
}
Dependency
<dependency>
<groupId>dev.brighten.antivpn</groupId>
<artifactId>isitbadapi</artifactId>
<version>1.1</version>
</dependency>
Repository
<repository>
<id>funkemunky-releases</id>
<url>https://nexus.funkemunky.cc/content/repositories/releases/</url>
</repository>