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": "πŸ‡ΊπŸ‡Έ",
            "isEU": false
        },
        "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.0
    },
    "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"
    }
}

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.isEUbooleanWhether the country is an EU member
location.region.codestringISO 3166-2 subdivision code
location.region.namestringRegion/state/province name
location.citystringCity name
location.postalCodestringPostal / ZIP code
location.coordinates.latitudenumberLatitude (WGS 84)
location.coordinates.longitudenumberLongitude (WGS 84)
location.coordinates.accuracyRadiusnumberAccuracy radius in km
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)

meta

FieldTypeDescription
meta.precisionstring"city", "region", "country", "continent", or "none"
meta.tierstringPlan tier that served the request
meta.requestIdstringUnique request ID for support / debugging

Error Response Format

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

JSON
{
    "error": {
        "code": "INVALID_API_KEY",
        "message": "The provided API key is invalid or has been revoked.",
        "status": 401
    }
}

Error Codes

HTTPCodeDescription
400BAD_REQUESTMalformed request or invalid parameters
400INVALID_IPThe provided IP address is not a valid IPv4 or IPv6
401MISSING_API_KEYNo API key provided in X-API-Key header
401INVALID_API_KEYAPI key is invalid, revoked, or expired
403FORBIDDENKey does not have the required scope
403ORIGIN_NOT_ALLOWEDPublishable key: the request origin is not in allowed list
404NOT_FOUNDEndpoint or resource does not exist
409CONFLICTResource already exists (e.g. duplicate site)
429RATE_LIMIT_EXCEEDEDToo many requests β€” slow down or upgrade plan
429MONTHLY_CAP_REACHEDMonthly request quota exhausted
500INTERNAL_ERRORUnexpected server error β€” contact support
503SERVICE_UNAVAILABLEService temporarily unavailable β€” retry with backoff

Request ID for debugging

Every response includes a meta.requestId field. Include it when contacting support to help us trace the problem.