/ipYour IP as plain text
Returns only the caller's public IP address with a trailing newline. Useful in shell scripts and health checks.
curl https://ipgetter.com/ipUse IPGetter from shell scripts, dashboards and small applications. The public v1 API works without an account. Optional API keys give signed-in developers higher limits while keeping the same endpoints and response contract.
/ipReturns only the caller's public IP address with a trailing newline. Useful in shell scripts and health checks.
curl https://ipgetter.com/ip/api/v1/meReturns the caller's IP, IP version, hostname, protocol and local GeoIP / ASN details.
curl https://ipgetter.com/api/v1/me/api/v1/lookup?ip=8.8.8.8Looks up a valid IPv4 or IPv6 address and returns scope, reverse DNS, geo and ASN data.
curl "https://ipgetter.com/api/v1/lookup?ip=8.8.8.8"/api/v1/asn?ip=1.1.1.1Returns the autonomous system number and network organisation for an IP address.
curl "https://ipgetter.com/api/v1/asn?ip=1.1.1.1"/api/v1/reverse?ip=1.1.1.1Returns the PTR hostname resolved for a valid IPv4 or IPv6 address.
curl "https://ipgetter.com/api/v1/reverse?ip=1.1.1.1"All JSON endpoints support GET and browser CORS. Here is the same lookup in four common environments.
curl "https://ipgetter.com/api/v1/lookup?ip=8.8.8.8"
const res = await fetch('https://ipgetter.com/api/v1/lookup?ip=8.8.8.8');
const data = await res.json();
console.log(data);
import requests
data = requests.get(
'https://ipgetter.com/api/v1/lookup',
params={'ip': '8.8.8.8'},
timeout=10,
).json()
print(data)
$json = file_get_contents(
'https://ipgetter.com/api/v1/lookup?ip=8.8.8.8'
);
$data = json_decode($json, true);
var_dump($data);
Anonymous requests keep working exactly as before. Free account holders can create revocable API keys and send them as a Bearer token from server-side code.
curl \
-H "Authorization: Bearer ipg_live_YOUR_KEY" \
"https://ipgetter.com/api/v1/lookup?ip=8.8.8.8"
Create a free IPGetter account to generate revocable API keys. The full secret is shown once, only its hash is stored by IPGetter, and each key can be revoked independently. Do not expose secret keys in public browser JavaScript.
JSON responses include a boolean success field. Existing result fields remain at the top level, so the v1 response stays simple and backwards-friendly.
{
"success": true,
"ip": "8.8.8.8",
"version": "IPv4",
"scope": "Public",
"hostname": "dns.google",
"geo": {
"country_code": "US",
"asn": "AS15169",
"organisation": "Google LLC",
"source": "DB-IP Lite"
}
}
{
"success": false,
"error": {
"code": "invalid_ip",
"message": "Provide a valid IPv4 or IPv6 address in the ip parameter."
}
}
Anonymous clients get 120 requests per minute and 10,000 requests per UTC day. API keys get 300 per minute and 50,000 per UTC day. A 429 response includes Retry-After.
Every counted request includes remaining and reset information in X-RateLimit-* response headers.
Public endpoints send Access-Control-Allow-Origin: * and allow the Authorization header. Keep secret API keys in server-side code rather than public browser JavaScript.
Rate limiting uses a one-way server-side client hash. IPGetter does not store raw client IP addresses in its analytics logs.
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_ip | The supplied IP parameter is missing or invalid. |
| 401 | invalid_api_key | The supplied Bearer token is invalid or has been revoked. |
| 405 | method_not_allowed | The endpoint was called with a method other than GET or OPTIONS. |
| 429 | rate_limit_exceeded | The per-minute or daily anonymous limit has been exceeded. |
If a request is not behaving as expected, send the endpoint, response status and a redacted example to support. Never include a full API secret.
GeoIP and ASN enrichment is served from IPGetter's managed local Geo Engine. The current provider is DB-IP Lite, with validated monthly updates and rollback protection. Reverse DNS uses the server's configured DNS resolver.