Response Format

Complete reference for the NetLoc8 API response shapes, field descriptions, and error codes.

GeolocationResult

All geolocation endpoints (/v1/ip/me and /v1/ip/{ipAddress}) return this JSON object. Null or unavailable fields are omitted from the response.

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" },
        "district": "Santa Clara County",
        "city": "Mountain View",
        "postalCode": "94043",
        "coordinates": {
            "latitude": 37.386,
            "longitude": -122.084,
            "accuracyRadius": 386
        },
        "timezone": "America/Los_Angeles",
        "utcOffset": "-07:00",
        "geoConfidence": 1.0
    },
    "network": {
        "asn": "AS15169",
        "organization": "Google LLC",
        "domain": "google.com"
    },
    "sources": {
        "geo": ["dbip", "ip2location"],
        "asn": ["ipinfo"],
        "tz": ["derived"]
    },
    "meta": {
        "precision": "city",
        "tier": "pro"
    }
}

Conditional fields

Null or unavailable fields are omitted from the response. The unions array is only present for countries belonging to a political/economic union (e.g. EU). On successful responses, meta.requestId requires the X-Debug: timing header. Error responses always include meta.requestId.

Field Reference

query

FieldTypeDescription
query.typestringAlways "ip"
query.valuestringThe IP address that was looked up
query.ipVersionnumber4 (IPv4) or 6 (IPv6)

location

FieldTypeDescription
location.continent.codestringTwo-letter continent code (NA, EU, AS, …)
location.continent.namestringContinent full name
location.country.codestringISO 3166-1 alpha-2 country code
location.country.namestringCountry full name (English)
location.country.flagstringUnicode flag emoji
location.country.unionsstring[]Political/economic unions (e.g. ["EU"]). Omitted when empty.
location.region.codestringISO 3166-2 subdivision code
location.region.namestringRegion/state/province name
location.districtstringSubdivision level 2 (e.g. county). Omitted when unavailable.
location.citystringCity name
location.postalCodestringPostal / ZIP code
location.coordinates.latitudenumberLatitude (WGS 84)
location.coordinates.longitudenumberLongitude (WGS 84)
location.coordinates.accuracyRadiusnumberAccuracy radius in miles
location.timezonestringIANA timezone (e.g. America/Los_Angeles)
location.utcOffsetstringCurrent UTC offset (e.g. -07:00)
location.geoConfidencenumberConfidence score: 0.0 – 1.0

network

FieldTypeDescription
network.asnstringAutonomous System Number (e.g. AS15169)
network.organizationstringASN organization name
network.domainstringOrganization domain (when available)

sources

FieldTypeDescription
sources.geostring[]Geo data providers (e.g. ["dbip", "ip2location"])
sources.asnstring[]ASN data providers (e.g. ["ipinfo"])
sources.tzstring[]Timezone data providers (e.g. ["derived"])

meta

FieldTypeDescription
meta.precisionstring"city", "region", "country", "continent", or "none"
meta.tierstringPlan tier (e.g. "pro", "starter", "anonymous")
meta.requestIdstringUnique request ID (requires X-Debug: timing header)
meta.degradedbooleantrue when the response is limited due to cap exceeded

Error Response Format

When an error occurs, the API returns a JSON object with an error code and message:

JSON
{
    "error": {
        "code": "UNAUTHORIZED",
        "message": "Invalid API key"
    },
    "meta": {
        "requestId": "550e8400-e29b-41d4-a716-446655440000"
    }
}

Geo endpoint errors also include a query echo:

JSON
{
    "error": {
        "code": "INVALID_IP",
        "message": "Invalid IP address format"
    },
    "meta": {
        "requestId": "550e8400-e29b-41d4-a716-446655440000"
    },
    "query": {
        "type": "ip",
        "value": "not-an-ip"
    }
}

Error Codes

HTTPCodeDescription
400BAD_REQUESTMalformed request or invalid parameters
400INVALID_IPThe provided IP address is not a valid IPv4 or IPv6
400VALIDATION_ERRORRequest validation failed (e.g. missing required field)
401UNAUTHORIZEDAPI key is missing, invalid, or revoked
403FORBIDDENKey does not have the required scope or access is denied
404NOT_FOUNDEndpoint or resource does not exist
413PAYLOAD_TOO_LARGERequest body exceeds the 10 KB size limit
429RATE_LIMIT_EXCEEDEDToo many requests β€” slow down or upgrade plan
500INTERNAL_ERRORUnexpected server error β€” contact support
503SERVICE_UNAVAILABLEService temporarily unavailable β€” retry with backoff

Request ID for debugging

Error responses include a meta.requestId field. Include it when contacting support to help us trace the problem.