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:
- Gradle - for building and managing the project
- JUnit Jupiter - for unit testing
- Fasterxml Jackson - for JSON parsing
- OkHttp3 - for making HTTP requests
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.
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);
This library includes unit tests using JUnit Jupiter. You can run the tests by executing the following Gradle command:
./gradlew test
This library throws a NetlasRequestException
when an error occurs while sending an HTTP request. You should handle this exception appropriately in your code.
This project is licensed under the License - see the LICENSE file.