Skip to content
Pure haskell access to the MaxMind GeoIP2 database
Branch: master
Clone or download

Latest commit

Latest commit 1db262c Nov 20, 2019


Type Name Latest commit message Commit time
Failed to load latest commit information.
Data Fixes #10 Nov 20, 2019

GeoIP2 - library for accessing GeoIP2 database

Build Status Hackage

GeoIP2 is a haskell binding to the MaxMind GeoIP2 database. It parses the database according to the MaxMind DB specification, version 2 of the specification is supported. The free geolite2 database can be downloaded at

See haddock documentaion for details.

{-# LANGUAGE OverloadedStrings #-}
import Data.GeoIP2
import Data.IP (IP(..))

main = do
  geodb <- openGeoDB "GeoLite2-City.mmdb"
  let ip = IPv4 ""
  print (findGeoData geodb "en" ip)

  let ip2 = IPv6 "2001:4800:7817:104:be76:4eff:fe04:f608"
  print (findGeoData geodb "en" ip2)
You can’t perform that action at this time.