Skip to main content

Endpoint

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

Authentication

HeaderRequiredValue
X-API-KeyYesYour 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

ParameterTypeRequiredDescription
ipstringYesValid IPv4 or IPv6 address

Response

200 OK

FieldTypeDescription
ipstringThe IP that was looked up
countrystring | nullFull country name (e.g. "United States")
country_codestring | nullISO 3166-1 alpha-2 country code (e.g. "US")
regionstring | nullFull region/state name (e.g. "California")
region_codestring | nullRegion/state code (e.g. "CA")
citystring | nullCity name
zipstring | nullPostal/ZIP code
latnumber | nullLatitude
lonnumber | nullLongitude
timezonestring | nullTimezone identifier (e.g. "America/Los_Angeles")
ispstring | nullInternet Service Provider name
orgstring | nullOrganization name
asstring | nullAS number and name (e.g. "AS15169 Google LLC")
Example
{
  "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

{
  "detail": "Missing API key. Include X-API-Key header."
}

402 Payment Required

{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}

422 Unprocessable Entity

Invalid IP format.
{
  "detail": "Invalid IP address format"
}

429 Too Many Requests

{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}

cURL example

curl "https://api.bunny.build/api/v1/ip-lookup?ip=8.8.8.8" \
  -H "X-API-Key: bun_your_api_key"