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

# GET /ip-lookup

> Get detailed geolocation and network info for any IP address: country, city, coordinates, timezone, ISP, organization, and ASN in one request.

## Endpoint

```
GET https://api.bunny.build/api/v1/ip-lookup?ip=8.8.8.8
```

## Authentication

| Header      | Required | Value                    |
| ----------- | -------- | ------------------------ |
| `X-API-Key` | Yes      | Your API key (`bun_...`) |

## Overview

Get detailed geolocation and network information for any IP address. Bunny returns the country, country code, region, city, postal code, coordinates, timezone, ISP name, organization, and AS number, all in a single fast request.

## Use cases

* Personalise content and language by user location
* Log request origin for analytics and auditing
* Enforce region-based access controls
* Display estimated shipping locations

## Details

Supports IPv4 and IPv6. City-level accuracy varies by region and ISP. Coordinates represent the approximate centre of the detected city, not the end user's precise location.

## Query parameters

| Parameter | Type   | Required | Description                |
| --------- | ------ | -------- | -------------------------- |
| `ip`      | string | Yes      | Valid IPv4 or IPv6 address |

## Response

### 200 OK

| Field          | Type           | Description                                        |
| -------------- | -------------- | -------------------------------------------------- |
| `ip`           | string         | The IP that was looked up                          |
| `country`      | string \| null | Full country name (e.g. `"United States"`)         |
| `country_code` | string \| null | ISO 3166-1 alpha-2 country code (e.g. `"US"`)      |
| `region`       | string \| null | Full region/state name (e.g. `"California"`)       |
| `region_code`  | string \| null | Region/state code (e.g. `"CA"`)                    |
| `city`         | string \| null | City name                                          |
| `zip`          | string \| null | Postal/ZIP code                                    |
| `lat`          | number \| null | Latitude                                           |
| `lon`          | number \| null | Longitude                                          |
| `timezone`     | string \| null | Timezone identifier (e.g. `"America/Los_Angeles"`) |
| `isp`          | string \| null | Internet Service Provider name                     |
| `org`          | string \| null | Organization name                                  |
| `as`           | string \| null | AS number and name (e.g. `"AS15169 Google LLC"`)   |

**Example**

```json theme={null}
{
  "ip": "8.8.8.8",
  "country": "United States",
  "country_code": "US",
  "region": "California",
  "region_code": "CA",
  "city": "Mountain View",
  "zip": "94043",
  "lat": 37.386,
  "lon": -122.0838,
  "timezone": "America/Los_Angeles",
  "isp": "Google LLC",
  "org": "Google Public DNS",
  "as": "AS15169 Google LLC"
}
```

### 401 Unauthorized

```json theme={null}
{
  "detail": "Missing API key. Include X-API-Key header."
}
```

### 402 Payment Required

```json theme={null}
{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}
```

### 422 Unprocessable Entity

Invalid IP format.

```json theme={null}
{
  "detail": "Invalid IP address format"
}
```

### 429 Too Many Requests

```json theme={null}
{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}
```

## cURL example

```bash theme={null}
curl "https://api.bunny.build/api/v1/ip-lookup?ip=8.8.8.8" \
  -H "X-API-Key: bun_your_api_key"
```
