Skip to main content

Endpoint

GET https://api.bunny.build/api/v1/ip-classify?ip={ip}

Authentication

HeaderRequiredValue
X-API-KeyYesYour API key (bun_...)

Overview

Classify any IP address as residential, hosting/datacenter, mobile, VPN, Tor exit node, or open proxy. Bunny’s IP Classification API returns a classification label, confidence score, and a full signal breakdown, so you can make precise decisions about traffic sources.

Use cases

  • Detect and block VPN, proxy, and Tor traffic
  • Identify bot and datacenter traffic
  • Enforce geo-based access controls
  • Fraud prevention and risk scoring

Details

Supports both IPv4 and IPv6. The confidence field (0–1) indicates classification certainty. The signals object breaks down each signal individually so you can apply your own logic.

Query parameters

ParameterTypeRequiredDescription
ipstringYesValid IPv4 or IPv6 address

Response

200 OK

FieldTypeDescription
ipstringThe IP that was checked
classificationstringOne of: hosting, residential, mobile, vpn, tor, proxy, unknown
confidencenumber0.0 to 1.0
signalsobjectBoolean flags (see below)
networkobjectASN, org, provider (see below)
geoobjectcountry (see below)
signals
FieldType
is_hostingboolean
is_residentialboolean
is_mobileboolean
is_vpnboolean
is_torboolean
is_proxyboolean
network
FieldTypeDescription
asnint | nullAutonomous System Number
orgstring | nullOrganization name
providerstring | nullFriendly name (e.g. “AWS”)
geo
FieldTypeDescription
countrystring | nullISO 3166-1 alpha-2 country code (e.g. "US")
Example
{
  "ip": "8.8.8.8",
  "classification": "hosting",
  "confidence": 0.9,
  "signals": {
    "is_hosting": true,
    "is_residential": false,
    "is_mobile": false,
    "is_vpn": false,
    "is_tor": false,
    "is_proxy": false
  },
  "network": {
    "asn": 15169,
    "org": "Google LLC",
    "provider": "Google Cloud"
  },
  "geo": {
    "country": "US"
  }
}

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-classify?ip=8.8.8.8" \
  -H "X-API-Key: bun_your_api_key"