# IP Geolocation

Where one IPv4 or IPv6 address is registered — country, region, city, coordinates, flag — and who runs it: ASN, ISP, the network's own domain.

- Method: `GET`
- Path: `/v1/ip/{ip}`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `ip` | path segment | required | The address to locate, IPv4 or IPv6. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/ip/%7Bip%7D \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "ip": "8.8.8.8",
    "type": "IPv4",
    "country": "United States",
    "country_code": "US",
    "region": "California",
    "city": "San Jose",
    "postal": "95113",
    "latitude": 37.3361663,
    "longitude": -121.8905913,
    "is_eu": false,
    "flag_emoji": "🇺🇸",
    "timezone_id": "America/Los_Angeles",
    "utc_offset_seconds": -25200,
    "asn": 15169,
    "org": "Google LLC",
    "isp": "Google LLC",
    "connection_domain": "google.com"
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T04:05:00.000Z",
    "age_seconds": 42,
    "next_update_at": "2026-08-21T04:05:00.000Z"
  }
}
```