I'm trying to locate the visitor IP address using the following: https://github.com/ipinfo/python
I'm doing the exact same thing as in the documentation and I got the access_token:
import ipinfo
if request.environ.get('HTTP_X_FORWARDED_FOR') is None:
ip_address = request.environ['REMOTE_ADDR']
else:
ip_address = request.environ['HTTP_X_FORWARDED_FOR']
handler = ipinfo.getHandler(mytoken)
details = handler.getDetails(ip_address)
However the last lines give me:
400 Client Error: Bad Request for url: https://ipinfo.io/2.44.94.227
It returns this error with every IP address. Do you have any ideas? Thanks!