geocoder.ip('me').country returns None
See original GitHub issueThanks for a great package that’s worked in my system, Mycodo, for over a year without an issue.
Recently (past week or so), I’ve been having the country query return None, from systems around the world.
import geocoder
print("Country='{return}'".format(return=geocoder.ip('me').country))
$ python ./test_geocoder.py
Country='None'
I haven’t dug enough into geocoder to know exactly how to debug this.
Is this a known issue? Is there anything I can do to help?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
geocoder.ip('me') work locally but not on heroku - Stack Overflow
I am using Django and need to get the user's current location, so I use geocoder.ip('me') . It works fine locally, but after...
Read more >IP Info.io — geocoder 1.38.1 documentation - Read the Docs
Use the IPInfo.io IP lookup API to quickly and simply integrate IP geolocation ... To retrieve your own IP address, simply have ''...
Read more >Geocoder Documentation - Read the Docs
g = geocoder.ip('me') ... As for now, Geocoder always returns one result: the best match ... print([g.address, g.country, g.latlng]).
Read more >Advice on geocoding IP addresses - GIS Stack Exchange
I downloaded their database and used that to process my data. It is amazing that it is free for non-commercial use! – djq....
Read more >geocoder-php/stack-geo-ip - Packagist
By wrapping the GeoIP middleware around it using the StackBuilder, if the IP address can be matched to a country, the X-Country header...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kizniche There’s two providers that offer reverse IP lookups,
maxmind
&ipinfo
. When you usegeocoder.ip('me')
it’s actually using http://ipinfo.io/ for it’s internal requests.Seems like
geocoder.ip('me')
is broken if you provide ‘me’ or blank.Strange that it use to work before, maybe it was always a “bug” however their server accepted that HTTP request.
Solution: Change
geocoder.ip('me')
HTTP request fromhttp://ipinfo.io//json
=>http://ipinfo.io/json
👍