Fast, reliable, and free IP geolocation API
Our GeoIP API provides detailed geolocation data for IP addresses. The API is RESTful, returns JSON, and supports both IPv4 and IPv6 addresses.
/json/{query}
Returns geolocation data for a specific IP address or domain.
| Parameter | Type | Description |
|---|---|---|
| query | string | IP address (IPv4 or IPv6) to lookup |
| fields | string | Comma-separated list of fields to return |
| lang | string | Response language (en, de, es, fr, ja, pt-BR, ru, zh-CN) |
| callback | string | JSONP callback function name |
/json
Returns geolocation data for the requesting IP address.
| Field | Description | Example |
|---|---|---|
| status | Success or failure indicator | success |
| continent | Continent name | North America |
| continentCode | Two-letter continent code | NA |
| country | Country name | United States |
| countryCode | Two-letter country code ISO 3166-1 alpha-2 | US |
| region | Region/state code | CA |
| regionName | Region/state name | California |
| city | City name | San Francisco |
| zip | Zip/postal code | 94105 |
| lat | Latitude | 37.7749 |
| lon | Longitude | -122.4194 |
| timezone | Timezone (IANA format) | America/Los_Angeles |
| proxy | Proxy/VPN detection | true/false |
| hosting | Hosting/datacenter detection | true/false |
| org | Organization name | Cloudflare, Inc. |
| as | AS number and organization | AS13335 |
curl https://ip-api.m-server.cf/json/8.8.8.8
{
"status": "success",
"country": "United States",
"countryCode": "US",
"region": "VA",
"regionName": "Virginia",
"city": "Ashburn",
"zip": "20149",
"lat": 39.03,
"lon": -77.5,
"timezone": "America/New_York",
"org": "Google LLC",
"as": "AS15169"
}
curl https://ip-api.m-server.cf/json/8.8.8.8?fields=country,city,org
{
"status": "success",
"country": "United States",
"city": "Ashburn",
"org": "Google LLC"
}
curl https://ip-api.m-server.cf/json/8.8.8.8?lang=de
{
"status": "success",
"country": "Vereinigte Staaten",
"city": "Ashburn",
"org": "Google LLC"
}
The API is rate limited to protect our services from abuse. The current limits are: