SDKs overview
DomainDb Info provides a suite of APIs for accessing domain-related data, including domain search, WHOIS information, and domain availability checks. To facilitate developer integration, DomainDb Info offers official Software Development Kits (SDKs) and supports community-contributed libraries across several popular programming languages. These SDKs are designed to abstract the complexities of direct API calls, handling authentication, request formatting, and response parsing, allowing developers to focus on integrating domain data into their applications more efficiently. The API itself is documented to guide developers on how to interact with its various endpoints directly, regardless of SDK use DomainDb Info API documentation.
The availability of SDKs in multiple languages addresses the diverse development environments of DomainDb Info users. The core products, such as the Domain Search API, WHOIS API, and Domain Availability API, are accessible through these libraries, enabling use cases ranging from cybersecurity threat intelligence to bulk domain data enrichment. Developers can leverage these tools for various tasks, including validating domain ownership, tracking domain registration details, and performing large-scale domain data analysis.
Official SDKs by language
DomainDb Info maintains official SDKs for several programming languages, providing tested and supported methods for API interaction. These SDKs are typically distributed through standard package managers for each language, simplifying installation and dependency management. The official documentation for each SDK provides specific usage examples and API endpoint mappings. The primary language examples include Python, PHP, and Node.js, which are commonly used for web development and data processing DomainDb Info API reference.
The following table summarizes the key details for the officially supported SDKs:
| Language | Package Name | Install Command (Example) | Maturity |
|---|---|---|---|
| Python | domaindb-info-python |
pip install domaindb-info-python |
Stable |
| PHP | domaindb-info/php-sdk |
composer require domaindb-info/php-sdk |
Stable |
| Node.js | @domaindb-info/nodejs-sdk |
npm install @domaindb-info/nodejs-sdk |
Stable |
| Ruby | domaindb-info-ruby |
gem install domaindb-info-ruby |
Stable |
| Go | github.com/domaindb-info/go-sdk |
go get github.com/domaindb-info/go-sdk |
Stable |
| Java | com.domaindbinfo:java-sdk |
Add to pom.xml or build.gradle |
Stable |
Installation
Installing DomainDb Info SDKs typically involves using the package manager native to the programming language. Each SDK is designed to be easily integrated into existing projects. A valid API key, obtained from the DomainDb Info website, is required for authentication when making API requests DomainDb Info API key management.
Python Installation
The Python SDK can be installed using pip, the standard package installer for Python:
pip install domaindb-info-python
PHP Installation
For PHP projects, Composer is used to manage dependencies:
composer require domaindb-info/php-sdk
Node.js Installation
The Node.js SDK is available via npm, the package manager for JavaScript:
npm install @domaindb-info/nodejs-sdk
Ruby Installation
Ruby projects can install the SDK using RubyGems:
gem install domaindb-info-ruby
Go Installation
Go modules are used to manage the Go SDK:
go get github.com/domaindb-info/go-sdk
Java Installation
For Java projects, the SDK can be included as a dependency in your build tool (e.g., Maven or Gradle). For Maven, add the following to your pom.xml:
<dependency>
<groupId>com.domaindbinfo</groupId>
<artifactId>java-sdk</artifactId>
<version>1.0.0</version> <!-- Use the latest version -->
</dependency>
For Gradle, add to your build.gradle:
implementation 'com.domaindbinfo:java-sdk:1.0.0' // Use the latest version
Quickstart example
The following examples demonstrate basic usage of DomainDb Info SDKs to perform a domain lookup. These snippets assume you have already installed the respective SDK and have a valid API key.
Python Quickstart
This Python example shows how to use the domaindb-info-python SDK to retrieve information for a specified domain.
from domaindb_info import Client
api_key = "YOUR_API_KEY"
client = Client(api_key)
try:
domain_info = client.get_domain_info("example.com")
print(f"Domain: {domain_info['domain']}")
print(f"Registrar: {domain_info['registrar']}")
print(f"Creation Date: {domain_info['creation_date']}")
# Access other fields as needed
except Exception as e:
print(f"Error: {e}")
PHP Quickstart
This PHP example demonstrates fetching domain data using the domaindb-info/php-sdk.
<?php
require 'vendor/autoload.php';
use DomainDbInfo\Client;
$apiKey = 'YOUR_API_KEY';
$client = new Client($apiKey);
try {
$domainInfo = $client->getDomainInfo('example.com');
echo "Domain: " . $domainInfo['domain'] . "\n";
echo "Registrar: " . $domainInfo['registrar'] . "\n";
echo "Creation Date: " . $domainInfo['creation_date'] . "\n";
// Access other fields as needed
} catch (\Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
}
?>
Node.js Quickstart
Below is a Node.js example for retrieving domain information using the @domaindb-info/nodejs-sdk.
const { Client } = require('@domaindb-info/nodejs-sdk');
const apiKey = 'YOUR_API_KEY';
const client = new Client(apiKey);
async function getDomainData() {
try {
const domainInfo = await client.getDomainInfo('example.com');
console.log(`Domain: ${domainInfo.domain}`);
console.log(`Registrar: ${domainInfo.registrar}`);
console.log(`Creation Date: ${domainInfo.creation_date}`);
// Access other fields as needed
} catch (error) {
console.error(`Error: ${error.message}`);
}
}
getDomainData();
Go Quickstart
This Go example illustrates how to use the go-sdk to query domain details.
package main
import (
"fmt"
"log"
domaindbinfo "github.com/domaindb-info/go-sdk"
)
func main() {
apiKey := "YOUR_API_KEY"
client := domaindbinfo.NewClient(apiKey)
domainInfo, err := client.GetDomainInfo("example.com")
if err != nil {
log.Fatalf("Error fetching domain info: %v", err)
}
fmt.Printf("Domain: %s\n", domainInfo.Domain)
fmt.Printf("Registrar: %s\n", domainInfo.Registrar)
fmt.Printf("Creation Date: %s\n", domainInfo.CreationDate)
// Access other fields as needed
}
Java Quickstart
A Java example demonstrating how to retrieve domain data using the DomainDb Info Java SDK.
import com.domaindbinfo.Client;
import com.domaindbinfo.model.DomainInfo;
public class DomainLookup {
public static void main(String[] args) {
String apiKey = "YOUR_API_KEY";
Client client = new Client(apiKey);
try {
DomainInfo domainInfo = client.getDomainInfo("example.com");
System.out.println("Domain: " + domainInfo.getDomain());
System.out.println("Registrar: " + domainInfo.getRegistrar());
System.out.println("Creation Date: " + domainInfo.getCreationDate());
// Access other fields as needed
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
}
}
Community libraries
Beyond the officially supported SDKs, the DomainDb Info API's adherence to standard HTTP/HTTPS protocols and JSON response formats allows for the development of community-contributed libraries. While not officially maintained or supported by DomainDb Info, these libraries can offer alternative approaches or support for languages not covered by the official SDKs. Developers often create such libraries to integrate APIs into specific frameworks or to add features tailored to niche use cases. Exploring community repositories on platforms like GitHub can reveal additional tools and examples Mozilla HTTP documentation.
When considering community libraries, it is advisable to review their documentation, community activity, and licensing to ensure they meet project requirements and security standards. Direct integration with the RESTful API using standard HTTP clients (e.g., requests in Python, fetch in Node.js, cURL in PHP) remains a universally applicable method, especially if a specific language's SDK is not available or if custom behavior is required. For instance, developers can use a library like axios in JavaScript to make HTTP requests, as described in its official documentation Axios GitHub repository.
The DomainDb Info API's clear documentation and consistent structure facilitate custom client development. The API supports custom fields for responses, allowing developers to retrieve only the data they need, which can be beneficial for optimizing performance and reducing bandwidth usage DomainDb Info custom fields guide. This flexibility can make custom implementations viable for projects with unique requirements.