SDKs & Libraries
Official and community SDKs for integrating with the LimesIndex API.
Official SDKs
Official SDKs are maintained by the LimesIndex team and are the recommended way to integrate with our API.
Official SDKs for popular languages are currently in development. In the meantime, you can use the REST API directly or the community libraries listed below.
Planned Official SDKs
| Language | Status | Expected Release |
|---|---|---|
| Python | In Development | Q1 2025 |
| JavaScript/TypeScript | In Development | Q1 2025 |
| Go | In Development | Q1 2025 |
| Ruby | Planned | Q2 2025 |
| PHP | Planned | Q2 2025 |
| Java | Planned | Q2 2025 |
| C# | Planned | Q3 2025 |
Community Libraries
These libraries are developed and maintained by the community. While not officially supported, they can help you get started quickly.
Community libraries are not officially supported by LimesIndex. Use at your own discretion and verify security practices before use in production.
Community libraries will be listed here as they become available.
Direct API Integration
Until official SDKs are available, you can integrate directly with the REST API. Here are minimal client implementations for common languages:
Python
"""
LimesIndex API Client - Minimal Implementation
"""
import os
import requests
from typing import List, Dict, Optional
class LimesIndex:
"""Simple client for the LimesIndex API."""
def __init__(self, api_key: Optional[str] = None):
self.api_key = api_key or os.environ.get("LIMESINDEX_API_KEY")
self.base_url = "https://api.limesindex.com"
self.session = requests.Session()
self.session.headers.update({
"X-API-Key": self.api_key,
"Accept": "application/json"
})
def lookup_ip(self, ip: str) -> Dict:
"""Look up a single IP address."""
response = self.session.get(f"{self.base_url}/v1/ip/{ip}")
response.raise_for_status()
return response.json()
def batch_lookup(self, ips: List[str]) -> Dict:
"""Look up multiple IP addresses."""
response = self.session.post(
f"{self.base_url}/v1/ip/batch",
json={"ips": ips}
)
response.raise_for_status()
return response.json()
def lookup_asn(self, asn: int, include_prefixes: bool = False) -> Dict:
"""Look up an ASN."""
params = {"include_prefixes": "true"} if include_prefixes else {}
response = self.session.get(
f"{self.base_url}/v1/asn/{asn}",
params=params
)
response.raise_for_status()
return response.json()
def search_asn(self, query: str, limit: int = 20) -> Dict:
"""Search for ASNs by name."""
response = self.session.get(
f"{self.base_url}/v1/asn/search",
params={"q": query, "limit": limit}
)
response.raise_for_status()
return response.json()
# Usage
if __name__ == "__main__":
client = LimesIndex()
# Single lookup
result = client.lookup_ip("8.8.8.8")
print(f"IP: {result['data']['ip']}")
print(f"ASN: {result['data']['asn']} ({result['data']['asn_name']})")
# Batch lookup
batch = client.batch_lookup(["8.8.8.8", "1.1.1.1"])
for ip, data in batch["data"].items():
print(f"{ip}: {data['asn_name']}")
JavaScript/TypeScript
/**
* LimesIndex API Client - Minimal Implementation
*/
interface LimesIndexOptions {
apiKey?: string;
baseUrl?: string;
}
class LimesIndex {
private apiKey: string;
private baseUrl: string;
constructor(options: LimesIndexOptions = {}) {
this.apiKey = options.apiKey || process.env.LIMESINDEX_API_KEY || '';
this.baseUrl = options.baseUrl || 'https://api.limesindex.com';
}
private async request<T>(path: string, options: RequestInit = {}): Promise<T> {
const response = await fetch(`${this.baseUrl}${path}`, {
...options,
headers: {
'X-API-Key': this.apiKey,
'Accept': 'application/json',
'Content-Type': 'application/json',
...options.headers,
},
});
if (!response.ok) {
const error = await response.json();
throw new Error(`API Error: ${error.data.error} (${error.data.code})`);
}
return response.json();
}
async lookupIP(ip: string) {
return this.request(`/v1/ip/${ip}`);
}
async batchLookup(ips: string[]) {
return this.request('/v1/ip/batch', {
method: 'POST',
body: JSON.stringify({ ips }),
});
}
async lookupASN(asn: number, includePrefixes = false) {
const params = includePrefixes ? '?include_prefixes=true' : '';
return this.request(`/v1/asn/${asn}${params}`);
}
async searchASN(query: string, limit = 20) {
return this.request(`/v1/asn/search?q=${encodeURIComponent(query)}&limit=${limit}`);
}
}
// Usage
const client = new LimesIndex();
// Single lookup
const result = await client.lookupIP('8.8.8.8');
console.log(`IP: ${result.data.ip}`);
console.log(`ASN: ${result.data.asn} (${result.data.asn_name})`);
// Batch lookup
const batch = await client.batchLookup(['8.8.8.8', '1.1.1.1']);
Object.entries(batch.data).forEach(([ip, data]) => {
console.log(`${ip}: ${data.asn_name}`);
});
export { LimesIndex };
Go
// Package limesindex provides a client for the LimesIndex API.
package limesindex
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"time"
)
// Client represents a LimesIndex API client.
type Client struct {
apiKey string
baseURL string
http *http.Client
}
// NewClient creates a new LimesIndex client.
func NewClient(apiKey string) *Client {
if apiKey == "" {
apiKey = os.Getenv("LIMESINDEX_API_KEY")
}
return &Client{
apiKey: apiKey,
baseURL: "https://api.limesindex.com",
http: &http.Client{Timeout: 30 * time.Second},
}
}
// request makes an HTTP request to the API.
func (c *Client) request(method, path string, body interface{}) ([]byte, error) {
var reqBody io.Reader
if body != nil {
jsonBody, err := json.Marshal(body)
if err != nil {
return nil, err
}
reqBody = bytes.NewBuffer(jsonBody)
}
req, err := http.NewRequest(method, c.baseURL+path, reqBody)
if err != nil {
return nil, err
}
req.Header.Set("X-API-Key", c.apiKey)
req.Header.Set("Accept", "application/json")
if body != nil {
req.Header.Set("Content-Type", "application/json")
}
resp, err := c.http.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
respBody, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
if resp.StatusCode >= 400 {
return nil, fmt.Errorf("API error: %s", string(respBody))
}
return respBody, nil
}
// IPLookupResult represents an IP lookup result.
type IPLookupResult struct {
IP string `json:"ip"`
Prefix string `json:"prefix"`
ASN int `json:"asn"`
ASNName string `json:"asn_name"`
Country string `json:"country"`
Detection struct {
IsDatacenter bool `json:"is_datacenter"`
IsVPN bool `json:"is_vpn"`
IsTorExit bool `json:"is_tor_exit"`
IsProxy bool `json:"is_proxy"`
IsAICrawler bool `json:"is_ai_crawler"`
AICompany string `json:"ai_company,omitempty"`
} `json:"detection"`
Threat struct {
Score int `json:"score"`
Level string `json:"level"`
} `json:"threat"`
}
// IPLookupResponse represents the API response for IP lookup.
type IPLookupResponse struct {
Data IPLookupResult `json:"data"`
Meta struct {
RequestID string `json:"request_id"`
ProcessingTimeMs int `json:"processing_time_ms"`
CacheStatus string `json:"cache_status"`
} `json:"meta"`
}
// LookupIP looks up a single IP address.
func (c *Client) LookupIP(ip string) (*IPLookupResponse, error) {
body, err := c.request("GET", "/v1/ip/"+ip, nil)
if err != nil {
return nil, err
}
var result IPLookupResponse
if err := json.Unmarshal(body, &result); err != nil {
return nil, err
}
return &result, nil
}
// BatchLookupRequest represents a batch lookup request.
type BatchLookupRequest struct {
IPs []string `json:"ips"`
}
// BatchLookupResponse represents the API response for batch lookup.
type BatchLookupResponse struct {
Data map[string]IPLookupResult `json:"data"`
Meta struct {
RequestID string `json:"request_id"`
ProcessingTimeMs int `json:"processing_time_ms"`
} `json:"meta"`
}
// BatchLookup looks up multiple IP addresses.
func (c *Client) BatchLookup(ips []string) (*BatchLookupResponse, error) {
body, err := c.request("POST", "/v1/ip/batch", BatchLookupRequest{IPs: ips})
if err != nil {
return nil, err
}
var result BatchLookupResponse
if err := json.Unmarshal(body, &result); err != nil {
return nil, err
}
return &result, nil
}
cURL
For quick testing or scripting, use cURL directly:
#!/bin/bash
# LimesIndex API Shell Functions
LIMESINDEX_API_KEY="${LIMESINDEX_API_KEY:-your_api_key_here}"
LIMESINDEX_BASE_URL="https://api.limesindex.com"
# Single IP lookup
limesindex_lookup() {
local ip="$1"
curl -s -X GET "${LIMESINDEX_BASE_URL}/v1/ip/${ip}" \
-H "X-API-Key: ${LIMESINDEX_API_KEY}" \
-H "Accept: application/json"
}
# Batch lookup
limesindex_batch() {
local ips="$1" # JSON array string
curl -s -X POST "${LIMESINDEX_BASE_URL}/v1/ip/batch" \
-H "X-API-Key: ${LIMESINDEX_API_KEY}" \
-H "Content-Type: application/json" \
-d "{\"ips\": ${ips}}"
}
# ASN lookup
limesindex_asn() {
local asn="$1"
curl -s -X GET "${LIMESINDEX_BASE_URL}/v1/asn/${asn}" \
-H "X-API-Key: ${LIMESINDEX_API_KEY}" \
-H "Accept: application/json"
}
# Usage examples:
# limesindex_lookup "8.8.8.8" | jq .
# limesindex_batch '["8.8.8.8", "1.1.1.1"]' | jq .
# limesindex_asn 15169 | jq .
SDK Feature Comparison
When official SDKs are released, they will include:
| Feature | Basic Client | Official SDK |
|---|---|---|
| IP Lookup | Yes | Yes |
| Batch Lookup | Yes | Yes |
| ASN Lookup | Yes | Yes |
| Rate Limit Handling | Manual | Automatic |
| Retry Logic | Manual | Built-in |
| Caching | Manual | Optional |
| Type Safety | Manual | Full |
| Error Handling | Basic | Rich |
| Async Support | Varies | Full |
| Connection Pooling | Manual | Automatic |
Contributing
Interested in building an SDK for your favorite language? We welcome contributions!
Guidelines
- Follow our API conventions - Use the response format documented in Response Format
- Implement core methods -
lookupIP,batchLookup,lookupASN,searchASN - Handle errors properly - Parse error responses and throw/return appropriate errors
- Include rate limiting - Respect rate limits and implement backoff
- Add documentation - Include usage examples and API docs
- Write tests - Include unit and integration tests
Getting Started
- Review the API Reference for endpoint details
- Check existing implementations above for patterns
- Open an issue to discuss your SDK plans
- Submit a PR to be listed as a community library
Support
- Documentation: You're already here!
- API Reference: OpenAPI Spec
- Dashboard: dashboard.limesindex.com
- Email: support@limesindex.com