Geolocation Endpoints

IP-to-location lookups, timezone detection, and IP address validation.

Base URL

All endpoints below are relative to https://api.netloc8.com.

GET/v1/ip/meAuthenticated

Geolocate caller

Returns full geolocation data for the requesting client's IP address. The IP is auto-detected from x-forwarded-for or the connection. Same response shape as /v1/ip/{ipAddress}.

Example Request

Bash
curl -H "X-API-Key: YOUR_KEY" \
  https://api.netloc8.com/v1/ip/me

Response

200Geolocation data for the caller's IP
JSON
{
    "query": {
        "type": "ip",
        "value": "8.8.8.8",
        "ipVersion": 4
    },
    "location": {
        "continent": {
            "code": "NA",
            "name": "North America"
        },
        "country": {
            "code": "US",
            "name": "United States",
            "flag": "πŸ‡ΊπŸ‡Έ"
        },
        "region": {
            "code": "CA",
            "name": "California"
        },
        "city": "Mountain View",
        "postalCode": "94043",
        "coordinates": {
            "latitude": 37.386,
            "longitude": -122.084,
            "accuracyRadius": 621
        },
        "timezone": "America/Los_Angeles",
        "utcOffset": "-07:00",
        "geoConfidence": 1
    },
    "network": {
        "asn": "AS15169",
        "organization": "Google LLC",
        "domain": "google.com"
    },
    "sources": {
        "geo": [
            "dbip",
            "ip2location"
        ],
        "asn": [
            "ipinfo"
        ],
        "tz": [
            "derived"
        ]
    },
    "meta": {
        "precision": "city",
        "tier": "pro",
        "requestId": "550e8400-e29b-41d4-a716-446655440000"
    }
}
GET/v1/ip/{ipAddress}Authenticated

IP geolocation lookup

Returns full geolocation data for the given IP address including city, region, country, coordinates, and timezone.

Parameters

ParameterTypeRequiredDescription
ipAddressstringRequiredIPv4 or IPv6 address to look up (e.g. 8.8.8.8)

Example Request

Bash
curl -H "X-API-Key: YOUR_KEY" \
  https://api.netloc8.com/v1/ip/8.8.8.8

Response

200Geolocation data
JSON
{
    "query": {
        "type": "ip",
        "value": "8.8.8.8",
        "ipVersion": 4
    },
    "location": {
        "continent": {
            "code": "NA",
            "name": "North America"
        },
        "country": {
            "code": "US",
            "name": "United States",
            "flag": "πŸ‡ΊπŸ‡Έ"
        },
        "region": {
            "code": "CA",
            "name": "California"
        },
        "city": "Mountain View",
        "postalCode": "94043",
        "coordinates": {
            "latitude": 37.386,
            "longitude": -122.084,
            "accuracyRadius": 621
        },
        "timezone": "America/Los_Angeles",
        "utcOffset": "-07:00",
        "geoConfidence": 1
    },
    "network": {
        "asn": "AS15169",
        "organization": "Google LLC",
        "domain": "google.com"
    },
    "sources": {
        "geo": [
            "dbip",
            "ip2location"
        ],
        "asn": [
            "ipinfo"
        ],
        "tz": [
            "derived"
        ]
    },
    "meta": {
        "precision": "city",
        "tier": "pro",
        "requestId": "550e8400-e29b-41d4-a716-446655440000"
    }
}
GET/v1/ip/me/timezoneAuthenticated

Get timezone for caller

Returns the IANA timezone string (e.g. America/Chicago) for the requesting client's IP address.

Example Request

Bash
curl -H "X-API-Key: YOUR_KEY" \
  https://api.netloc8.com/v1/ip/me/timezone

Response

200IANA timezone string
JSON
"America/Chicago"
GET/v1/ip/{ipAddress}/timezoneAuthenticated

Get timezone for IP

Returns the IANA timezone string (e.g. America/Chicago) for the given IP address.

Parameters

ParameterTypeRequiredDescription
ipAddressstringRequiredIPv4 or IPv6 address

Example Request

Bash
curl -H "X-API-Key: YOUR_KEY" \
  https://api.netloc8.com/v1/ip/8.8.8.8/timezone

Response

200IANA timezone string
JSON
"America/Los_Angeles"
GET/v1/ip/{ipAddress}/validationAuthenticated

Validate IP address

Returns true if the address is a valid IPv4 or IPv6 address, false otherwise. Does not perform a geolocation lookup.

Parameters

ParameterTypeRequiredDescription
ipAddressstringRequiredIP address string to validate

Example Request

Bash
curl -H "X-API-Key: YOUR_KEY" \
  https://api.netloc8.com/v1/ip/8.8.8.8/validation

Response

200Validation result
JSON
true

Response Shape

All geolocation endpoints return a GeolocationResult object. Null fields are omitted rather than sent as null. See the Response Format page for the full schema reference.

Precision Levels

The meta.precision field indicates how specific the geolocation data is:

PrecisionFields Available
cityAll fields: country, region, city, coordinates, timezone
regionCountry, region, timezone (no city/coords)
countryCountry code and name only
continentContinent only
noneNo geolocation data found

Error Responses

See Error Codes for the full error response format and code reference.