Skip to content

geoip.City() returns a half-empty object with the specified IP address #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
groall opened this issue Jul 9, 2024 · 3 comments
Closed

Comments

@groall
Copy link

groall commented Jul 9, 2024

ip := "185.76.254.54"
city, err := geoip.City(net.ParseIP(ip))

both city.City.Name and city.City.GeoNameID are empty, but other properties such as Continent or Country are filled.

I'm using the latest maxdb update. And if I convert the database to csv, then the csv will have complete information about the city - name, id, etc.

I have the problem only with the IP address from the example.

@oschwald
Copy link
Owner

It appears that the database doesn't have city-level data for that IP address. Not all IPs are geolocated to a city.

@groall
Copy link
Author

groall commented Jul 11, 2024

@oschwald sorry, maybe I misunderstand the results for this IP at https://www.maxmind.com/en/geoip-web-services-demo - there is a complete location with region and city:
Selection_437
I was hoping I could get the same information using maxminddb-golang

@oschwald
Copy link
Owner

That is a demo for MaxMind's web service, which has more precise data. You don't mention which database you are using, but the latest GeoLite database does not have city-level data for that IP.

I'd suggest directing data questions to MaxMind's support.

nanasnumber pushed a commit to nanasnumber/maxminddb-golang that referenced this issue Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants