{"id":20279355,"url":"https://github.com/simplito/geoip2-erl","last_synced_at":"2026-06-07T11:32:26.440Z","repository":{"id":89901831,"uuid":"128122344","full_name":"simplito/geoip2-erl","owner":"simplito","description":"Erlang wrapper for MaxMind GeoIP2 C library","archived":false,"fork":false,"pushed_at":"2018-04-05T11:07:07.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-14T07:11:40.536Z","etag":null,"topics":["erlang","geoip","geoip2","maxmind","wrapper"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simplito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-04T21:08:56.000Z","updated_at":"2018-04-05T11:07:08.000Z","dependencies_parsed_at":"2023-04-20T01:31:37.940Z","dependency_job_id":null,"html_url":"https://github.com/simplito/geoip2-erl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fgeoip2-erl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fgeoip2-erl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fgeoip2-erl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fgeoip2-erl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplito","download_url":"https://codeload.github.com/simplito/geoip2-erl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241773259,"owners_count":20018064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["erlang","geoip","geoip2","maxmind","wrapper"],"created_at":"2024-11-14T13:29:37.697Z","updated_at":"2026-06-07T11:32:26.411Z","avatar_url":"https://github.com/simplito.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Erlang wrapper for MaxMind GeoIP2 C library\n\nThe geoip2-erl is a safe port wrapper OTP application for MaxMind's [libmaxminddb](https://github.com/maxmind/libmaxminddb).\n\n## Basic build instruction\n\n    rebar3 compile\n\n## Configuration\n\nIn your `sys.config` you can specify multiple named instances of geoip2 servers and for every instance you can specify the path of its mmdb file and optionally its options. Right now the only option you can specify is `{cache, false}` turning off default map cache of IP lookups.\n\nExample:\n```erlang\n{geoip2, [{\n    instances, [\n        {city, \"./GeoIP2-City.mmdb\"},\n        {city_no_cache, \"./GeoIP2-City.mmdb\", [{cache, false}]}\n    ]\n}]} \n```\n\n## Usage\n\nTo lookup for data related to a given IPv4 / IPv6 address you can specify it as a tuple / string / binary:\n\n```erlang\n{ok, ResultMap} = geoip2:lookup(city, \"8.8.8.8\").\n```\n\nTo quickly extract just an interesting part of information from returned map you can use `get` (throws error) or `find` (returns `error | {ok, Value}`) functions :\n\n```erlang\n{ok, Result} = geoip2:find([country, iso_code], ResultMap).\n```\n\nor\n\n```erlang\nResult = geoip2:get([country, iso_code], ResultMap, \u003c\u003c\"EN\"\u003e\u003e)\n```\n\nIf you are interested only in specified part of information you can use \"combo\" versions of `get` or `find` functions: \n\n```erlang\n{ok, Result} = geoip2:find(city, [country, iso_code], \"8.8.8.8\").\n```\n\nTo dynamically add instance of geoip2 server use:\n\n```erlang\ngeoip2:start(country, \"./GeoIP2-Country.mmdb\").\n```\n\nThere are also `stop` and `restart` functions available.\n\n## License\n\nThis library is licensed under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplito%2Fgeoip2-erl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplito%2Fgeoip2-erl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplito%2Fgeoip2-erl/lists"}