A self-hosted GeoIP lookup service for offline IP geolocation and network intelligence. Provides a web interface and REST API backed by MaxMind GeoLite2 databases.
GeoLite2-ASN.mmdbGeoLite2-City.mmdbGeoLite2-Country.mmdbLocal:
pip install -r requirements.txt
# Place the three GeoLite2-*.mmdb files in the project root
python server.py
Docker Compose:
# Place the three GeoLite2-*.mmdb files in the project root
docker-compose up -d
The server starts on port 8000. Database loading and cache building takes a few seconds on first start.
All endpoints accept both HTML (text/html) and JSON (application/json) via the Accept header.
| Method | Path | Description |
|---|---|---|
GET | /ip/{ip} | IP lookup (supports CIDR: /ip/1.1.1.0/24) |
GET | /myip | Redirect to caller's own IP lookup |
GET | /asn/{asn} | ASN lookup (e.g. /asn/15169 or /asn/AS15169) |
GET | /country/{iso} | All networks in a country (e.g. /country/US) |
GET | /country-search?q= | Search countries by ISO code or name |
GET | /search?q= | Search organizations by name |
GET | /multi-country?q= | ASes spanning multiple countries (comma-separated ISOs) |
GET | /asn/{asn}/country/{iso} | Networks for an ASN filtered by country |
GET | /cidr/{prefix} | CIDR subnet details |
GET | /subnet?q= | Interactive subnet divider |
POST | /bulk | Bulk IP lookup (JSON array, max 100) |
GET | /health | Health check with database stats |
Examples:
curl http://localhost:8000/ip/8.8.8.8
curl http://localhost:8000/asn/15169
curl http://localhost:8000/search?q=Cloudflare
curl -X POST http://localhost:8000/bulk \
-H "Content-Type: application/json" \
-d '["1.1.1.1", "8.8.8.8", "9.9.9.9"]'
A command-line lookup tool is included:
python cli.py 8.8.8.8
Uses MaxMind GeoLite2 data — see MaxMind's license for terms.
Content type
Image
Digest
sha256:eb933b012…
Size
46.8 MB
Last updated
14 days ago
docker pull s4l3h1/netscope