Free API
IP Lookup API
A simple, free, no-auth REST API to look up IP addresses. Returns the caller's IP along with hostname, location, and ISP data. No API key required.
Base URL
https://freeiptools.com
GET
/api/ip
Returns the requester's IP address along with hostname, geolocation, and ISP information. No parameters required — simply make a GET request and the response reflects the calling client.
Request
curl https://freeiptools.com/api/ip
Response
{
"ip": "203.0.113.42",
"hostname": "pool-203-0-113-42.example.net",
"city": "San Francisco",
"region": "California",
"country": "United States",
"isp": "Comcast Cable"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| ip | string | The caller's public IP address (IPv4 or IPv6) |
| hostname | string | Reverse DNS hostname (falls back to IP if not found) |
| city | string | City associated with the IP |
| region | string | Region or state associated with the IP |
| country | string | Country name |
| isp | string | Internet Service Provider name |
Code Examples
JavaScript (fetch)
fetch('https://freeiptools.com/api/ip')
.then(res => res.json())
.then(data => console.log(data.ip));
Python
import requests
data = requests.get('https://freeiptools.com/api/ip').json()
print(data['ip'])
curl
curl https://freeiptools.com/api/ip # Just the IP: curl -s https://freeiptools.com/api/ip | python3 -c "import sys,json; print(json.load(sys.stdin)['ip'])"
PHP
$data = json_decode(file_get_contents('https://freeiptools.com/api/ip'), true);
echo $data['ip'];
Notes
- • No API key or account required — completely free to use.
- • The API always reflects the IP of the requesting client. To look up a different IP, use a server-side request from that machine.
- • CORS is enabled — you can call this API directly from browser JavaScript.
- • Geo data (city, region, country, ISP) may be empty for private or reserved IP ranges.