/netlas-java

Netlas.io Java library

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

Netlas Java Library

GitHub license GitHub issues Build Status Codacy Badge Codacy Badge

This Java library is designed to interact with the Netlas API, allowing you to easily search for certificates, domains, and WHOIS information. It requires an API key, and makes use of the following dependencies:

Installation

To use this library, you'll need to add it as a dependency to your Gradle project. You can do this by adding the following to your build.gradle file:

dependencies {
  implementation 'com.michael2to3:netlas:VERSION'
}

Replace VERSION with the desired version of the library.

Usage

First, create an instance of the Netlas class with your API key and the base URL of the Netlas API.

Netlas netlas = new Netlas("YOUR_API_KEY", "https://api.netlas.io");

Once you have a Netlas instance, you can use its methods to search for information:

// Search for certificate information
netlas.java.scheme.Response response = netlas.search("example.com", DataType.CERT, 1, null, null, false);

// Search for domain information
netlas.java.scheme.Response response = netlas.search("example.com", DataType.DOMAIN, 1, null, null, false);

// Search for WHOIS information for an IP address
netlas.java.scheme.Response response = netlas.search("8.8.8.8", DataType.WHOIS_IP, 1, null, null, false);

// Search for WHOIS information for a domain
netlas.java.scheme.Response response = netlas.search("example.com", DataType.WHOIS_DOMAIN, 1, null, null, false);

Testing

This library includes unit tests using JUnit Jupiter. You can run the tests by executing the following Gradle command:

./gradlew test

Exceptions

This library throws a NetlasRequestException when an error occurs while sending an HTTP request. You should handle this exception appropriately in your code.

License

This project is licensed under the License - see the LICENSE file.