{"id":16092307,"url":"https://github.com/alecthomas/geoip","last_synced_at":"2025-03-17T17:31:04.103Z","repository":{"id":8923676,"uuid":"10652417","full_name":"alecthomas/geoip","owner":"alecthomas","description":"A pure Go interface to the free MaxMind GeoIP database","archived":false,"fork":false,"pushed_at":"2024-01-01T08:56:34.000Z","size":3350,"stargazers_count":39,"open_issues_count":1,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-28T02:11:28.681Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alecthomas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2013-06-12T21:14:10.000Z","updated_at":"2024-12-12T20:07:05.000Z","dependencies_parsed_at":"2024-06-19T01:25:51.638Z","dependency_job_id":"f8e48ae1-638c-471a-a5b8-f33c3cbfd0b2","html_url":"https://github.com/alecthomas/geoip","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.2857142857142857,"last_synced_commit":"ef86b5d4cf8bd7291afeb016418cdbf83470af00"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Fgeoip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Fgeoip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Fgeoip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Fgeoip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alecthomas","download_url":"https://codeload.github.com/alecthomas/geoip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243871911,"owners_count":20361380,"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":[],"created_at":"2024-10-09T16:06:56.705Z","updated_at":"2025-03-17T17:31:03.314Z","avatar_url":"https://github.com/alecthomas.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A pure Go interface to the free [MaxMind GeoIP](http://dev.maxmind.com/geoip/legacy/downloadable) database\n\nThis package provides fast lookups of country by IP address.\n\nThis implementation compiles an optimized version of the database into Go (using [gobundle](http://github.com/alecthomas/gobundle)), and so does not rely on external files. The in-memory table size is around ~800KB.\n\n### Caveats\n\nCurrently only IPv4-\u003ecountry lookups are supported.\n\n### Installation\n\n```bash\n$ # Library\n$ go get github.com/alecthomas/geoip\n$ # Command\n$ go get github.com/alecthomas/geoip/cmd/geoip\n```\n\n### Usage\n\nCommand line usage:\n\n```bash\n$ geoip 1.1.1.1\nAustralia (AU)\n```\n\nSee [GoDoc](http://godoc.org/github.com/alecthomas/geoip) for API documentation.\n\n```go\ngeo, err := geoip.New()\ncountry := geo.Lookup(net.ParseIP(\"1.1.1.1\"))\nfmt.Printf(\"%s\\n\", country)\n```\n\n\n### Performance\n\nA benchmark is included (`go test -bench='.*'`). On my 2GHz Core i7 each lookup takes around 550ns.\n\n### Updating the database\n\nThe package can be rebuilt with an updated datbase with the following commands:\n\n```bash\n$ curl -O http://www.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip\n$ unzip GeoIPCountryCSV.zip\n$ make\n```\n\n### Legal\n\nThis product includes GeoLite data created by MaxMind, available from [maxmind.com](http://www.maxmind.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecthomas%2Fgeoip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falecthomas%2Fgeoip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecthomas%2Fgeoip/lists"}