Get detailed information about your IP address including geolocation, network details, and device information.
GET https://ip.freeapi.me/
{
"ip": {
"address": "203.0.113.195",
"version": "IPv4"
},
"location": {
"country": "US",
"region": "California",
"city": "San Francisco",
"timezone": "America/Los_Angeles"
},
"network": {
"asn": "13335",
"asOrganization": "Cloudflare, Inc."
}
...
}
https://ip.freeapi.me/
All API requests should be made to this endpoint. HTTPS is required for all API calls.
The IP Information API accepts GET requests only.
The following query parameters can be used to customize the API response:
Parameter | Type | Description |
---|---|---|
formatoptional | string |
Use format=ip to return just
the IP address as plain text. If omitted,
returns full JSON response.
|
# Get full IP information curl https://ip.freeapi.me/ # Get just the IP address curl https://ip.freeapi.me/?format=ip
// Get full IP information fetch('https://ip.freeapi.me/') .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
import requests # Get full IP information response = requests.get('https://ip.freeapi.me/') data = response.json() print(data)
// Get full IP information $response = file_get_contents('https://ip.freeapi.me/'); $data = json_decode($response, true); print_r($data);
By default, the API returns a JSON object with detailed information about the client's IP address.
{ "ip": { "address": "203.0.113.195", "version": "IPv4" }, "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/91.0.4472.124", "language": "en-US,en;q=0.9", "location": { "country": "US", "region": "California", "city": "San Francisco", "timezone": "America/Los_Angeles" }, "network": { "asn": "13335", "asOrganization": "Cloudflare, Inc." }, "device": { "deviceType": "desktop", "mobile": false }, "timestamp": "2023-11-16T15:23:01.789Z" }
The API may return the following error responses: