A web form gives you an email address and an IP. The IP is worth more than people think — it tells you the city, the country, the timezone to call in, and the ISP, which is often the difference between a real prospect and a bot. One request enriches the record.
The vendor in the original no longer exists. api.ipaddresslabs.com returns NXDOMAIN — the hostname does not resolve at all — and the parent domain ipaddresslabs.com now redirects to an unrelated site. There is no migration path; the service is simply gone. This article uses ipwho.is, which is free, keyless, HTTPS and returns a richer payload. The original also had two code defects: it parsed a JSON response with executeXPath, and the function was declared to return a string but had no return statement at all, so it always returned empty.
This article merges two library entries. “Geolocation data API Integration” and “Ipaddress Labs to Zoho Creator API Integration” described the same vendor doing the same job — the second had no script at all. They are one article now.
IP_Address field and somewhere to put the results.// ============================================
// IP GEOLOCATION -> ZOHO CREATOR
// No key required.
// ============================================
void Enrich.geolocate(int recordId)
{
rec = Leads[ID == recordId];
ip = ifnull(rec.IP_Address,"").trim();
if(ip == "")
{
info "No IP on record " + recordId;
return;
}
response = invokeurl
[
url : "https://ipwho.is/" + ip
type : GET
];
// ipwho.is reports failure in the body with HTTP 200
if(response.getJSON("success") == false)
{
info "Lookup failed for " + ip + ": " + response.getJSON("message");
return;
}
rec.Geo_City = response.getJSON("city");
rec.Geo_Region = response.getJSON("region");
rec.Geo_Country = response.getJSON("country");
rec.Geo_PostalCode = response.getJSON("postal");
rec.Geo_Latitude = response.getJSON("latitude");
rec.Geo_Longitude = response.getJSON("longitude");
connection = response.getJSON("connection");
if(connection != null)
{
rec.Geo_ISP = connection.getJSON("isp");
}
timezone = response.getJSON("timezone");
if(timezone != null)
{
rec.Geo_Timezone = timezone.getJSON("id");
}
info "Located " + ip + " -> " + rec.Geo_City + ", " + rec.Geo_Country;
}success, not the status code. A bad or private IP still returns HTTP 200 with success: false and a message. Without that check you silently write nulls over good data.ip-api.com. It is widely recommended, but its free tier is HTTP only — the HTTPS endpoint returns “SSL unavailable”. Using it means putting your visitors’ IP addresses across the internet in clear text.This script is part of the free Creator Scripts Deluge Library.
All 39 Deluge scripts, the full Zoho Creator course, and every downloadable asset are now free. Get free access →