This article provides a tutorial on finding an IP address and retrieving its geo information using Python. It includes instructions for obtaining your own IP address and demonstrates how to use the ip2location package to retrieve the country associated with any given IP address.

Tutorial:

https://stackoverflow.com/questions/24678308/how-to-find-location-with-ip-address-in-python

To obtain IP of ourselves, we can visit:

1
2
curl https://api.ipify.org

To get geo info of our IP, visit:

1
2
curl https://ipinfo.io | jq .country

TO get geo info of any IP, use:

https://pypi.org/project/IP2Location/

https://ip2location-python.readthedocs.io/en/latest/quickstart.html

Comments