Deploy your own private GeoIP service with complete control over your data and infrastructure
No external API dependencies - everything runs on your infrastructure
Keep your IP lookups private with your own isolated instance
Optimized for speed with local database queries and minimal overhead
Free to use, modify, and extend to meet your specific requirements
Direct IP lookup via URL path
https://geoip-api.malith.dev/8.8.8.8
IP lookup via query parameter
https://geoip-api.malith.dev/?ip=8.8.8.8
Standard API endpoint
https://geoip-api.malith.dev/api/v1/geoip/lookup/8.8.8.8
{ "ip": "8.8.8.8", "code": "US", "country": "United States", "city": "Mountain View", "lat": 37.4056, "lon": -122.0775, "tz": "America/Los_Angeles", "isp": "Google LLC", "asn": 15169 }
pip install geoip-py
from geoip_api import GeoIPLookup
# Initialize the lookup service (downloads DB files if needed)
lookup = GeoIPLookup(download_if_missing=True)
# Look up an IP address
result = lookup.lookup('8.8.8.8')
print(result)
Keep sensitive IP lookup data within your network perimeter. No data sharing with third-party API providers.
Eliminate subscription fees and per-query costs associated with commercial GeoIP APIs.
Remove external API dependencies and potential points of failure from your infrastructure.
Customize and extend functionality to meet your specific business requirements.
docker pull malithrukshan/geoip-api
docker run -p 8000:8000 malithrukshan/geoip-api
Docker Hub
GeoIP API is an open-source project designed for self-hosting your own IP geolocation service. Unlike commercial GeoIP APIs that require external calls and subscriptions, our solution gives you complete control over your infrastructure and data.
Built with FastAPI and utilizing MaxMind's GeoLite2 databases, this service operates completely locally on your infrastructure, with no external API dependencies. All IP lookups are performed against databases stored on your own servers, ensuring privacy, reliability, and elimination of per-query costs.
The project is available both as a Python package (for integration into your applications) and as a deployable API service with Docker support for easy self-hosting.