Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeoIP API

Dead simple API to get geo information for IP addresses. Including prometheus metrics.

Usage

Download a GeoIP database containing country codes, e.g. from db-ip.com and add it to the main folder as geodata.mmdb.

Run the webserver with go run main.go.

Call curl localhost:8080 --data-raw "8.8.8.8" to get the country code for an IP.

Metrics are served at localhost:8080/metrics.

Docker Compose

version: "3.3"

services:
  geoip-api:
    image: cubicrootxyz/geoip-api:beta
    container_name: geoip-api
    volumes:
      - "./geodata.mmdb:/run/geodata.mmdb"
    environment:
      HTTP_PORT: "8080"

About

Dead simple API to get geo information for IP addresses

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages