SDKs overview
Software Development Kits (SDKs) and libraries for IP Address Details provide pre-built functionality to interact with its API endpoints. These tools are designed to streamline the integration process for developers, allowing them to incorporate IP geolocation, VPN/proxy detection, and ASN/ISP lookup features into their applications without directly managing HTTP requests, response parsing, or error handling. SDKs abstract the underlying RESTful API, offering language-specific methods and objects that map directly to API operations and data structures.
IP Address Details offers a set of official SDKs for commonly used programming languages, ensuring direct support and alignment with the API's capabilities. These official SDKs are typically maintained by the service provider, offering reliability and up-to-date features. Alongside official offerings, a developer community may also contribute third-party libraries, which can extend language support or provide additional convenience features. These community contributions, while not officially supported, can offer alternatives for niche use cases or languages not covered by official SDKs.
Official SDKs by language
IP Address Details provides official SDKs to facilitate integration across several programming languages. These client libraries are maintained to reflect the current API specifications for services such as IP Geolocation API, VPN/Proxy Detection API, and ASN/ISP Lookup. Using official SDKs generally ensures compatibility and stability, as they are developed by the same team that maintains the API itself. For a comprehensive overview of the API's capabilities, developers can refer to the official IP Address Details API documentation.
| Language | Package Name | Install Command | Maturity |
|---|---|---|---|
| Python | ipaddressdetails-python |
pip install ipaddressdetails-python |
Stable |
| Node.js | @ipaddressdetails/node |
npm install @ipaddressdetails/node |
Stable |
| PHP | ipaddressdetails/php-sdk |
composer require ipaddressdetails/php-sdk |
Stable |
| Ruby | ipaddressdetails-ruby |
gem install ipaddressdetails-ruby |
Stable |
Installation
SDK installation varies by programming language and package manager. The following instructions detail how to integrate the official IP Address Details SDKs into a project. It is critical to ensure that the chosen language environment and package manager are correctly configured before proceeding. For example, Python projects rely on pip for package management, while Node.js projects utilize npm or yarn.
Python
To install the Python SDK, use pip, the Python package installer. Ensure you have Python 3.6 or newer installed. You can verify your Python version by running python --version or python3 --version in your terminal. For managing dependencies in a project, it is recommended to use a Python virtual environment.
pip install ipaddressdetails-python
Node.js
For Node.js applications, the SDK is available via npm. Node.js applications require Node.js 12 or newer. Use the following command in your project directory:
npm install @ipaddressdetails/node
Alternatively, if you are using Yarn:
yarn add @ipaddressdetails/node
For best practices in Node.js development, refer to the official Node.js documentation.
PHP
The PHP SDK for IP Address Details is distributed via Composer. Ensure Composer is installed globally on your development machine. The minimum PHP version required is typically PHP 7.4 or higher.
composer require ipaddressdetails/php-sdk
After installation, Composer generates an autoloader file that must be included in your PHP script to use the SDK classes.
require 'vendor/autoload.php';
Ruby
For Ruby projects, the SDK can be installed as a Gem. Ensure you have RubyGems installed, which typically comes with Ruby installations (version 2.7 or higher recommended).
gem install ipaddressdetails-ruby
After installation, you can require the gem in your Ruby application:
require 'ipaddressdetails'
Quickstart example
The following quickstart examples demonstrate basic usage of the official IP Address Details SDKs to perform an IP geolocation lookup. A valid API key is required for authentication with the IP Address Details API. You can obtain an API key by signing up on the IP Address Details homepage.
Python Quickstart
This Python example uses the ipaddressdetails-python SDK to retrieve details for a specified IP address. Replace YOUR_API_KEY with your actual API key.
from ipaddressdetails import Client
api_key = "YOUR_API_KEY"
client = Client(api_key=api_key)
# Look up details for an IP address
ip_address = "8.8.8.8" # Example: Google DNS IP
response = client.get_ip_details(ip_address)
if response.is_success:
details = response.json()
print(f"IP: {details.get('ip')}")
print(f"Country: {details.get('country_name')}")
print(f"City: {details.get('city')}")
print(f"Latitude: {details.get('latitude')}")
print(f"Longitude: {details.get('longitude')}")
print(f"ISP: {details.get('isp')}")
else:
print(f"Error: {response.status_code} - {response.text}")
Node.js Quickstart
This Node.js example utilizes the @ipaddressdetails/node package to fetch IP address information. Remember to replace YOUR_API_KEY with your actual key.
const { ApiClient } = require('@ipaddressdetails/node');
const apiKey = 'YOUR_API_KEY';
const client = new ApiClient(apiKey);
async function getIpDetails() {
const ipAddress = '8.8.8.8'; // Example: Google DNS IP
try {
const response = await client.getIpDetails(ipAddress);
console.log(`IP: ${response.ip}`);
console.log(`Country: ${response.country_name}`);
console.log(`City: ${response.city}`);
console.log(`Latitude: ${response.latitude}`);
console.log(`Longitude: ${response.longitude}`);
console.log(`ISP: ${response.isp}`);
} catch (error) {
console.error('Error fetching IP details:', error.message);
}
}
getIpDetails();
PHP Quickstart
The PHP quickstart demonstrates how to use the ipaddressdetails/php-sdk to query IP address details. Ensure vendor/autoload.php is correctly included.
<?php
require 'vendor/autoload.php';
use Ipaddressdetails\Client;
$apiKey = 'YOUR_API_KEY';
$client = new Client($apiKey);
$ipAddress = '8.8.8.8'; // Example: Google DNS IP
try {
$details = $client->getIpDetails($ipAddress);
echo "IP: " . $details['ip'] . "\n";
echo "Country: " . $details['country_name'] . "\n";
echo "City: " . $details['city'] . "\n";
echo "Latitude: " . $details['latitude'] . "\n";
echo "Longitude: " . $details['longitude'] . "\n";
echo "ISP: " . $details['isp'] . "\n";
} catch (\Exception $e) {
echo "Error fetching IP details: " . $e->getMessage() . "\n";
}
?>
Ruby Quickstart
This Ruby example shows how to perform an IP lookup using the ipaddressdetails-ruby gem.
require 'ipaddressdetails'
api_key = 'YOUR_API_KEY'
client = Ipaddressdetails::Client.new(api_key)
ip_address = '8.8.8.8' # Example: Google DNS IP
begin
details = client.get_ip_details(ip_address)
puts "IP: #{details['ip']}"
puts "Country: #{details['country_name']}"
puts "City: #{details['city']}"
puts "Latitude: #{details['latitude']}"
puts "Longitude: #{details['longitude']}"
puts "ISP: #{details['isp']}"
rescue StandardError => e
puts "Error fetching IP details: #{e.message}"
end
Community libraries
While IP Address Details provides official SDKs for several popular languages, the open-source community may also develop and maintain additional libraries. These community-contributed tools can offer support for other programming languages, integrate with specific frameworks, or provide unique features not found in the official SDKs. Community libraries are typically hosted on platforms like GitHub or language-specific package repositories.
Developers interested in exploring community-driven solutions are encouraged to search public code repositories or package managers for ipaddressdetails and related terms. When using third-party libraries, it is advisable to review their documentation, community activity, and licensing terms. Examining the HTTP status codes and error handling in any SDK, whether official or community-driven, is important for robust application development. For a complete list of API endpoints and their expected responses, refer to the IP Address Details API documentation.
As of 2026-05-29, the primary recommended integration method remains through the official SDKs or direct HTTP requests, as community contributions are subject to independent maintenance and may not always align with the latest API updates. Always prioritize security and maintainability when selecting third-party dependencies for production environments.