Skip to content
Branch: master
Go to file

Rust MaxMind DB Reader

Build Status Released API docs Master API docs

This library reads the MaxMind DB format, including the GeoIP2 and GeoLite2 databases.


To build everything:

cargo build


This crate manages its test data within a git submodule. To run the tests, you will first need to run the following command.

git submodule update --init


Add this to your Cargo.toml:

maxminddb = "0.13"

and this to your crate root:

extern crate maxminddb;

API Documentation

The API docs are on GitHub Pages.


See examples/ for a basic example.


The projects include benchmarks using

First you need to have a working copy of the GeoIP City database. You can fetch it from here.

Place it in the root folder as GeoIP2-City.mmdb.

Once this is done, run

cargo bench

If gnuplot is installed, can generate an HTML report displaying the results of the benchmark under target/criterion/report/index.html.

Result of doing 100 random IP lookups:


Contributions welcome! Please fork the repository and open a pull request with your changes.


This is free software, licensed under the ISC license.

You can’t perform that action at this time.