https://github.com/t0mer/freegeoip
freegeoip provides a public HTTP API for software developers to search the geolocation of IP addresses. It uses a database of IP addresses that are associated to cities along with other relevant information like time zone, latitude and longitude.
https://github.com/t0mer/freegeoip
docker geoip monitoring-plugins
Last synced: 7 months ago
JSON representation
freegeoip provides a public HTTP API for software developers to search the geolocation of IP addresses. It uses a database of IP addresses that are associated to cities along with other relevant information like time zone, latitude and longitude.
- Host: GitHub
- URL: https://github.com/t0mer/freegeoip
- Owner: t0mer
- License: apache-2.0
- Created: 2022-01-12T12:25:48.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-26T22:31:22.000Z (about 1 year ago)
- Last Synced: 2025-03-27T14:45:06.679Z (12 months ago)
- Topics: docker, geoip, monitoring-plugins
- Language: Dockerfile
- Homepage:
- Size: 30.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License
Awesome Lists containing this project
README
# freegeoip
freegeoip provides a public HTTP API for software developers to search the geolocation of IP addresses. It uses a database of IP addresses that are associated to cities along with other relevant information like time zone, latitude and longitude.
freegeoip
=========
## docker-compose.yml
```yaml
freegeoip:
image: techblog/freegeoip
container_name: freegeoip
ports:
- "8080:8080"
- "8888:8888"
restart: always
```
## up and running
```bash
$ docker-compose up -d
$ curl -s http://localhost:8080/json/8.8.8.8 | jq .
{
"ip": "8.8.8.8",
"country_code": "US",
"country_name": "United States",
"region_code": "",
"region_name": "",
"city": "",
"zip_code": "",
"time_zone": "",
"latitude": 37.751,
"longitude": -97.822,
"metro_code": 0
}
$ curl -s http://localhost:8888/metrics
freegeoip_client_connections{proto="http"} 0
freegeoip_client_country_code_total{country_code="unknown"} 7
freegeoip_client_ipproto_version_total{ip="4"} 7
freegeoip_db_events_total{event="loaded"} 1
go_gc_duration_seconds{quantile="0"} 5.9754e-05
go_gc_duration_seconds{quantile="0.25"} 7.0367e-05
go_gc_duration_seconds{quantile="0.5"} 9.6169e-05
go_gc_duration_seconds{quantile="0.75"} 0.000112867
go_gc_duration_seconds{quantile="1"} 0.000260533
go_gc_duration_seconds_sum 0.001055739
```