> API Documentation
Integrate IP-Info.me's powerful IP intelligence into your applications.
Introduction
The IP-Info.me API provides programmatic access to detailed information about IP addresses, including geolocation, network details, security flags, and more. This documentation will guide you through authentication, making requests, and understanding the responses.
To get started, you'll need an API Key and a User Key, which you can obtain by registering an account and visiting your dashboard.
Authentication
All API requests require authentication. You must include your unique api_key
and user_key
as GET parameters in every request.
api_key
: Your personal API key.user_key
: Your personal User key.
You can find both keys on your User Dashboard.
Making Requests
Endpoint
The base URL for all API requests is:
GET https://ip-info.me/api.php
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
api_key |
String | Yes | Your unique API key. |
user_key |
String | Yes | Your unique User Key. |
ip |
String | Yes | The IP address (e.g., 8.8.8.8 ) or domain name (e.g., google.com ) to look up. For multiple IPs/domains, separate with semicolons (; ) or use CIDR notation (e.g., 192.168.1.0/24 ). |
Example Request (cURL)
curl "https://ip-info.me/api.php?api_key=YOUR_API_KEY&user_key=YOUR_USER_KEY&ip=8.8.8.8"
Replace YOUR_API_KEY
and YOUR_USER_KEY
with your actual credentials.
Responses
The API returns responses in JSON format. All responses will include a top-level boolean field success
.
Successful Response (200 OK
)
If the request is successful, success
will be true
, and the IP information will be contained within the data
object. For multi-IP lookups, the data
will be an array of IP profiles.
{
"success": true,
"data": {
"general_location": {
"ip_address": "8.8.8.8",
"type": "IPv4",
"city": "Mountain View",
"region": "California",
"region_code": "CA",
"country": "United States",
"country_code": "US",
"continent": "North America",
"continent_code": "NA",
"is_eu": false,
"latitude": 37.4224,
"longitude": -122.0842,
"hostnames": ["dns.google"],
"postal_codes": ["94043"]
/* ... other fields like all_coords ... */
},
"connection_network": {
"asn": 15169,
"isp_name": "Google LLC",
"organization": "Google LLC",
"connection_domain": "google.com",
"connection_type": "Corporate",
"route": "8.8.8.0/24"
},
"timezone_info": {
"id": "America/Los_Angeles",
"abbreviation": "PDT",
"is_dst": true,
"current_time": "YYYY-MM-DDTHH:MM:SSZ"
},
"currency_info": { /* May not always be present */
"code": "USD",
"name": "United States Dollar",
"symbol": "$"
},
"security_flags": [
"VPN/Proxy Detected",
"Threat Detected",
"High Risk IP"
],
"threat_summary": [
{
"type": "malicious",
"level": "critical",
"description": "Confirmed aggressive attacker, potentially malware C2."
},
{
"type": "anonymizer",
"level": "informational",
"description": "Identified as an anonymizing proxy or VPN."
}
]
}
}
Note: The availability of specific fields like currency or all security flags can vary depending on the IP address and the data provided by our upstream sources. The threat_summary
provides consolidated internal threat intelligence.
Error Responses
If an error occurs, success
will be false
, and an error
object will be provided containing a code
(corresponding to the HTTP status code) and a descriptive message
.
Status Code | Meaning | Example Message |
---|---|---|
400 | Bad Request | "Bad Request. IP address or domain parameter is missing." |
401 | Unauthorized | "Authentication failed. Both api_key and user_key are required." |
403 | Forbidden | "Forbidden. Invalid API key or User Key combination." or "Forbidden. Your account is inactive." |
404 | Not Found | "Not Found. Could not resolve domain: invalid-domain.xyz" or "Not Found. No information could be retrieved for IP: X.X.X.X" |
429 | Too Many Requests | "Too Many Requests. Your monthly API quota (1000) has been reached..." |
500 | Internal Server Error | "Internal Server Error. Could not process your request." |
Rate Limits & Usage
API usage is subject to monthly quotas based on your account tier, as outlined on our Pricing Page. Your current usage and limit are displayed on your Dashboard.
Exceeding your quota will result in a 429 Too Many Requests
error until your quota resets (typically at the beginning of the month) or you upgrade your plan.
Code Examples
Remember to replace YOUR_API_KEY
and YOUR_USER_KEY
with your actual credentials.
Python (using requests
)
import requests
api_key = "YOUR_API_KEY"
user_key = "YOUR_USER_KEY"
ip_address = "google.com" # Can be an IP, domain, multiple IPs (e.g., "8.8.8.8;1.1.1.1"), or CIDR (e.g., "192.168.1.0/24")
url = f"https://ip-info.me/api.php"
params = {
"api_key": api_key,
"user_key": user_key,
"ip": ip_address
}
try:
response = requests.get(url, params=params)
response.raise_for_status() # Raises an HTTPError for bad responses (4XX or 5XX)
data = response.json()
if data.get("success"):
print("IP Information:", data.get("data"))
else:
print("API Error:", data.get("error"))
except requests.exceptions.HTTPError as http_err:
print(f"HTTP error occurred: {http_err}")
print(f"Response content: {response.content.decode()}")
except Exception as err:
print(f"Other error occurred: {err}")
JavaScript (using fetch
)
async function getIpInfo(ipAddress) {
const apiKey = "YOUR_API_KEY";
const userKey = "YOUR_USER_KEY";
// Modified to include multi-IP/CIDR capability in the example URL
const apiUrl = `https://ip-info.me/api.php?api_key=${apiKey}&user_key=${userKey}&ip=${encodeURIComponent(ipAddress)}`;
try {
const response = await fetch(apiUrl);
const data = await response.json();
if (!response.ok || !data.success) {
const errorMsg = data.error ? data.error.message : `HTTP error ${response.status}`;
console.error(`API Error: ${errorMsg}`);
return null;
}
// If a single IP was queried, data.data contains the profile.
// If multiple, data.results will be an array of profiles.
console.log("IP Information:", data.data || data.results);
return data.data || data.results;
} catch (error) {
console.error('Network or other error fetching IP information:', error);
return null;
}
}
// Example usage:
// For a single IP or domain:
// getIpInfo("8.8.8.8");
// getIpInfo("cloudflare.com");
// For multiple IPs (separated by semicolon):
// getIpInfo("8.8.8.8;1.1.1.1;github.com");
// For a CIDR range:
// getIpInfo("192.168.1.0/24");