IP.me provides a simple API to detect and return a visitor's IP address. This service supports both IPv4 and IPv6 addresses and is fully compatible with ipify.org API.
curl https://api.yourdomain.com → 192.0.2.1curl https://api.yourdomain.com?format=json → {"ip":"192.0.2.1"}
For drop-in compatibility with ipify.org, use these endpoints:
| Endpoint | Description | Example Response |
|---|---|---|
/api |
Universal (IPv4/IPv6) | 192.0.2.1 |
/api4 |
IPv4 only | 192.0.2.1 or empty |
/api6 |
IPv6 only | 2001:db8::1 or empty |
/api?format=json |
JSON response | {"ip":"192.0.2.1"} |
/api?format=jsonp&callback=fn |
JSONP response | fn({"ip":"192.0.2.1"}); |
// Using fetch API
fetch('https://api.yourdomain.com?format=json')
.then(response => response.json())
.then(data => console.log('Your IP:', data.ip));
# Get IP address (plain text) curl https://api.yourdomain.com # Get JSON response curl "https://api.yourdomain.com?format=json"
import requests
response = requests.get('https://api.yourdomain.com?format=json')
data = response.json()
print(f"Your IP address is: {data['ip']}")