SDKs overview

ip-fast.com offers a suite of Software Development Kits (SDKs) and client libraries designed to facilitate interaction with its IP geolocation and VPN/proxy detection API. These SDKs abstract the underlying HTTP requests and response parsing, enabling developers to integrate IP data functionalities into their applications using familiar programming language constructs. The primary goal of these libraries is to reduce the boilerplate code required for API consumption, allowing developers to focus on application logic rather than API communication specifics.

The available SDKs support common operations such as querying an IP address to retrieve location details, identifying potential VPN or proxy usage, and accessing specific data points like country, city, and ISP information. Each SDK typically handles API key authentication, request formatting (e.g., setting query parameters), and response deserialization into native data structures (e.g., objects, dictionaries, or maps) for ease of use. This approach is consistent with common API integration patterns, as observed in other API platforms like Stripe's API documentation.

While official SDKs are maintained directly by ip-fast.com, the ecosystem may also include community-contributed libraries. These community efforts can extend language support or offer specialized functionalities not covered by the official offerings. Developers are encouraged to consult the official ip-fast.com documentation for the most up-to-date information on supported languages and integration methods.

Official SDKs by language

ip-fast.com provides official SDKs for several popular programming languages, ensuring broad compatibility for developers. These libraries are designed to offer a consistent and reliable interface for accessing the IP geolocation and detection services. Each SDK is typically maintained to reflect the latest API features and best practices for the respective language environment.

Language Package Name Install Command Maturity
Python ip-fast-python pip install ip-fast-python Stable
PHP ip-fast/php-sdk composer require ip-fast/php-sdk Stable
Node.js ip-fast-node npm install ip-fast-node Stable
Ruby ip-fast-ruby gem install ip-fast-ruby Stable
Java com.ipfast:java-sdk Maven: <dependency><groupId>com.ipfast</groupId><artifactId>java-sdk</artifactId><version>1.0.0</version></dependency>
Gradle: implementation 'com.ipfast:java-sdk:1.0.0'
Stable
Go github.com/ip-fast/go-sdk go get github.com/ip-fast/go-sdk Stable

The table above outlines the key details for integrating each official SDK. Developers can find specific versioning information and more detailed API definitions within the ip-fast.com developer documentation. Each SDK aims to provide idiomatic access to the API, meaning the code examples and method calls align with typical practices in each programming language, enhancing developer productivity.

Installation

Installing an ip-fast.com SDK typically involves using the package manager specific to your chosen programming language. The process is designed to be straightforward, allowing developers to quickly add the library to their project dependencies. Below are detailed installation instructions for each officially supported language.

Python

For Python projects, the SDK is available via PyPI. Use pip to install:

pip install ip-fast-python

Ensure you have a recent version of Python and pip installed. Virtual environments are recommended for managing project dependencies, as described in the Google Python development setup guide.

PHP

PHP projects utilize Composer for dependency management. Add the SDK to your project with:

composer require ip-fast/php-sdk

This command will download the library and its dependencies, updating your composer.json and composer.lock files. You'll then include Composer's autoloader in your PHP script: require 'vendor/autoload.php';.

Node.js

Node.js developers can install the SDK using npm, the default package manager for Node.js:

npm install ip-fast-node

Alternatively, if you prefer Yarn:

yarn add ip-fast-node

This adds the package to your package.json file and makes it available for use in your JavaScript or TypeScript projects.

Ruby

For Ruby applications, the SDK is distributed as a Gem. Install it using the gem command:

gem install ip-fast-ruby

After installation, you can require the gem in your Ruby scripts: require 'ip-fast-ruby'.

Java

Java projects commonly use Maven or Gradle for dependency management. Add the appropriate dependency snippet to your project's configuration file.

Maven

In your pom.xml:

<dependency>
    <groupId>com.ipfast</groupId>
    <artifactId>java-sdk</artifactId>
    <version>1.0.0</version> <!-- Check ip-fast.com docs for latest version -->
</dependency>

Gradle

In your build.gradle:

implementation 'com.ipfast:java-sdk:1.0.0' // Check ip-fast.com docs for latest version

After adding the dependency, your build tool will download the necessary JAR files.

Go

Go modules are used to manage dependencies in Go projects. Install the SDK using the go get command:

go get github.com/ip-fast/go-sdk

This command fetches the module and adds it to your go.mod file. You can then import it into your Go source files.

Quickstart example

This section provides a quickstart example using the Python SDK to demonstrate how to retrieve IP geolocation information. The example assumes you have already obtained an API key from ip-fast.com and have installed the Python SDK as described in the installation section above.

Python Quickstart

The following Python code snippet illustrates how to initialize the client and make a request to get geolocation data for a specified IP address. This example queries the public IP address of the machine running the code, or a specific IP if provided.

import os
from ip_fast_python import IpFastClient

# Replace with your actual API key from ip-fast.com
# It's recommended to store your API key as an environment variable
API_KEY = os.environ.get("IP_FAST_API_KEY", "YOUR_API_KEY_HERE")

if API_KEY == "YOUR_API_KEY_HERE":
    print("Warning: Please replace 'YOUR_API_KEY_HERE' with your actual API key or set the IP_FAST_API_KEY environment variable.")
    exit()

client = IpFastClient(api_key=API_KEY)

# Example 1: Get geolocation for the requesting IP (your public IP)
try:
    ip_data_self = client.get_geolocation()
    print("--- Geolocation for your IP ---")
    print(f"IP: {ip_data_self.ip}")
    print(f"Country: {ip_data_self.country_name} ({ip_data_self.country_code})")
    print(f"City: {ip_data_self.city}")
    print(f"Latitude: {ip_data_self.latitude}, Longitude: {ip_data_self.longitude}")
    print(f"ISP: {ip_data_self.isp}")
    print(f"Is Proxy/VPN: {ip_data_self.is_proxy_vpn}")
except Exception as e:
    print(f"Error getting geolocation for self IP: {e}")

print("\n")

# Example 2: Get geolocation for a specific IP address (e.g., Google's public DNS)
specific_ip = "8.8.8.8"
try:
    ip_data_specific = client.get_geolocation(ip_address=specific_ip)
    print(f"--- Geolocation for {specific_ip} ---")
    print(f"IP: {ip_data_specific.ip}")
    print(f"Country: {ip_data_specific.country_name} ({ip_data_specific.country_code})")
    print(f"City: {ip_data_specific.city}")
    print(f"Organization: {ip_data_specific.organization}")
    print(f"Timezone: {ip_data_specific.timezone}")
    print(f"Is Proxy/VPN: {ip_data_specific.is_proxy_vpn}")
except Exception as e:
    print(f"Error getting geolocation for {specific_ip}: {e}")

This example demonstrates two common use cases: querying the IP address from which the request originates and querying a specific, user-defined IP address. The get_geolocation() method returns an object containing various IP-related data points, which can then be accessed as attributes. Error handling is included to catch potential issues during the API call, such as network errors or invalid API keys. For more advanced features, such as filtering response fields or batch processing, refer to the comprehensive ip-fast.com API documentation.

Community libraries

While ip-fast.com maintains official SDKs for widely used programming languages, the developer community may also contribute unofficial libraries or wrappers. These community-driven projects can offer support for additional languages, alternative frameworks, or specialized functionalities not present in the official offerings. Such contributions often arise from developers integrating the API into unique environments or seeking to share their own implementations.

Community libraries are typically hosted on platforms like GitHub, npm, or PyPI, and their quality, maintenance, and feature set can vary. Before adopting a community library, developers are advised to evaluate its active maintenance, community support, documentation, and alignment with the official ip-fast.com API specifications. While these libraries can provide flexibility, official SDKs generally offer the most reliable and up-to-date integration experience, as they are directly supported by the service provider.

Developers interested in contributing to the ip-fast.com ecosystem or exploring community-developed tools can often find references or discussions within developer forums, open-source repositories, or by searching relevant package managers. For instance, the general approach to finding open-source libraries is often through a language's primary package repository, such as npm for Node.js or PyPI for Python, using keywords related to "ip-fast" or "IP geolocation".