Documentation navigation

IP Geolocation API

IP address geolocation lookup

Authentication: X-API-Key header on every request. Get a key.

IP geolocation lookup

GET/v1/ip/{address}

Quota cost: 1 unit Try it

Returns geolocation data for a given IPv4 or IPv6 address.

Parameters

Name Type Required Description
address string required

IPv4 or IPv6 address

lang string optional

ISO 639-1 language code for localized names (e.g., de, fr, ja)

fields string optional

Comma-separated list of fields to include in the response

Code samples

Response

{
  "data": {
    "ip": "8.8.8.8",
    "continent": {
      "code": "NA",
      "name": "North America"
    },
    "country": {
      "iso_code": "US",
      "name": "United States",
      "is_in_european_union": false
    },
    "region": {
      "iso_code": "CA",
      "name": "California"
    },
    "city": {
      "name": "Mountain View"
    },
    "postal": {
      "code": "94043"
    },
    "location": {
      "latitude": 37.386,
      "longitude": -122.0838,
      "accuracy_radius": 1000,
      "timezone": "America/Los_Angeles"
    },
    "is_anonymous_proxy": false,
    "is_satellite_provider": false
  }
}

Errors

Status Code When
401 authentication_required No API key was supplied
401 authentication_failed The supplied API key is not valid
422 invalid_parameter Invalid IP address format
429 rate_limit_exceeded Per-second throttle exceeded
429 quota_exceeded Monthly quota exhausted

401 authentication_required

{
  "error": {
    "code": "authentication_required",
    "message": "API key required. Get one at /signup",
    "request_id": "req_abc123"
  }
}

401 authentication_failed

{
  "error": {
    "code": "authentication_failed",
    "message": "Invalid API key",
    "request_id": "req_abc123"
  }
}

422 invalid_parameter

{
  "error": {
    "code": "invalid_parameter",
    "message": "invalid IP address format",
    "request_id": "req_abc123"
  }
}

429 rate_limit_exceeded

{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Try again later.",
    "request_id": "req_abc123"
  }
}

429 quota_exceeded

{
  "error": {
    "code": "quota_exceeded",
    "message": "Monthly quota exhausted. You've used 2,000,000 of 2,000,000 requests for the current period, which resets on March 1, 2026. Upgrade for a higher limit.",
    "request_id": "req_abc123",
    "quota": {
      "limit": 2000000,
      "used": 2000000,
      "resets_at": "2026-03-01T00:00:00Z",
      "upgrade_url": "https://geosearch.dev/dashboard/billing"
    }
  }
}

Caller's IP geolocation

GET/v1/ip/me

Quota cost: 1 unit Try it

Auto-detects the client's IP address (from X-Forwarded-For or RemoteAddr) and returns its geolocation data.

Parameters

Name Type Required Description
lang string optional

ISO 639-1 language code for localized names (e.g., de, fr, ja)

fields string optional

Comma-separated list of fields to include in the response

Code samples

Response

{
  "data": {
    "ip": "8.8.8.8",
    "network": "8.8.8.0/24",
    "continent": {
      "code": "NA",
      "name": "North America"
    },
    "country": {
      "iso_code": "US",
      "name": "United States",
      "is_in_european_union": false
    },
    "region": {
      "iso_code": "CA",
      "name": "California"
    },
    "city": {
      "name": "Mountain View"
    },
    "postal": {
      "code": "94043"
    },
    "location": {
      "latitude": 37.386,
      "longitude": -122.0838,
      "accuracy_radius": 1000,
      "timezone": "America/Los_Angeles"
    },
    "is_anonymous_proxy": false,
    "is_satellite_provider": false
  }
}

Errors

Status Code When
401 authentication_required No API key was supplied
401 authentication_failed The supplied API key is not valid
429 rate_limit_exceeded Per-second throttle exceeded
429 quota_exceeded Monthly quota exhausted

401 authentication_required

{
  "error": {
    "code": "authentication_required",
    "message": "API key required. Get one at /signup",
    "request_id": "req_abc123"
  }
}

401 authentication_failed

{
  "error": {
    "code": "authentication_failed",
    "message": "Invalid API key",
    "request_id": "req_abc123"
  }
}

429 rate_limit_exceeded

{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Try again later.",
    "request_id": "req_abc123"
  }
}

429 quota_exceeded

{
  "error": {
    "code": "quota_exceeded",
    "message": "Monthly quota exhausted. You've used 2,000,000 of 2,000,000 requests for the current period, which resets on March 1, 2026. Upgrade for a higher limit.",
    "request_id": "req_abc123",
    "quota": {
      "limit": 2000000,
      "used": 2000000,
      "resets_at": "2026-03-01T00:00:00Z",
      "upgrade_url": "https://geosearch.dev/dashboard/billing"
    }
  }
}