> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apiany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# IP geolocation

> Resolve an IP address to country, region, and city as a free API.

Use `/api/free/ip-geo` to look up IP geolocation data. This endpoint is part of
the Free API group and uses the same API key authentication and rate limits.

```bash theme={null}
curl "https://apiany.ai/api/free/ip-geo?ip=8.8.8.8" \
  -H "Authorization: Bearer $APIANY_API_KEY"
```

If `ip` is omitted, the endpoint uses the caller IP when trusted proxy headers
are available.

```json theme={null}
{
  "object": "ip_geo",
  "request_id": "req_123",
  "data": {
    "ip": "8.8.8.8",
    "country": "US",
    "region": "California",
    "city": "Mountain View",
    "source": "maxmind-city"
  }
}
```

Empty `country`, `region`, or `city` fields mean the local GeoIP database did
not contain a match for that address.
