GeoJS
GeoJS is a free, no-authentication IP geolocation API that returns the country, city, geographic coordinates, timezone, and other location information associated with an IP address. Designed for simplicity and zero friction, GeoJS requires no API key, no account registration, and no billing setup — making it the fastest possible path to basic IP-based location detection for web applications. For Nigerian developers who need simple country detection or approximate location awareness without the overhead of commercial IP geolocation services, GeoJS is an excellent starting point.
The core use case for GeoJS in Nigerian web development is detecting whether a website visitor is accessing from Nigeria or another country, enabling basic localization decisions: displaying prices in NGN versus USD, showing Nigeria-specific content, pre-selecting Nigeria in country dropdowns, or applying different business rules for Nigerian versus international users. Because the API is completely free and requires no authentication, it can be called directly from frontend JavaScript without exposing API keys or routing through a backend proxy.
CORS (Cross-Origin Resource Sharing) is enabled on GeoJS, meaning web browsers can make direct API calls from client-side JavaScript without CORS errors. This is a significant practical advantage for web developers who want to detect location at page load time without adding a backend API endpoint specifically for geolocation. A simple fetch call from the browser returns the visitor's location data immediately.
The API supports multiple response formats including JSON (most common for web applications), JSONP (for older applications or scenarios where CORS is not available), and plain text (for simple use cases where only one field is needed). The JSON response includes: IP address, country name, country code (ISO 2-letter), city name, region, latitude, longitude, timezone identifier (IANA format), ASN (autonomous system number), and organization.
Nigerian visitors to websites using GeoJS will typically be identified with country code "NG" and country name "Nigeria", with city identification for major cities like Lagos, Abuja, Port Harcourt, and Kano where IP geolocation databases have sufficient data. As with all IP-based geolocation, accuracy varies — mobile networks using centralized gateway IPs may report an incorrect city, and VPN users will appear to be in their VPN exit country. For country-level detection (Nigeria vs. not Nigeria), accuracy is very high. For city-level detection in Nigeria, accuracy is reasonable for major cities.
IPv6 support means GeoJS works correctly for the growing proportion of Nigerian internet users accessing websites over IPv6 connections, which is relevant as Nigerian ISPs and mobile networks adopt IPv6.
JSONP support allows calling GeoJS from web pages that must support very old browsers or environments where CORS is not available. The API appends a callback function wrapper to the response when a callback parameter is specified in the request URL.
For applications that need more detail than GeoJS provides — such as Nigerian state-level identification, ISP information, threat intelligence (proxy/VPN detection), or higher accuracy geocoding — commercial IP geolocation services like MaxMind GeoIP2, IPInfo, or IP2Location offer more comprehensive data with subscription pricing. GeoJS is best suited for the simplest tier of geo-awareness: knowing whether a visitor is in Nigeria, their approximate city, and their timezone, without any infrastructure setup or operational cost.
The zero-setup nature of GeoJS makes it particularly popular for Nigerian developers prototyping new features, building personal projects, or working on applications where user count is low enough that the absence of API key management and billing is worth more than the additional features of paid alternatives. The API has been stable and well-maintained, with reported high uptime suitable for production use in non-critical location detection scenarios.