Ip Info Collect

python
IP address
geo information
tutorial
ip2location
country
retrieval
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.
Published

May 27, 2024


Tutorial:

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

To obtain IP of ourselves, we can visit:

curl https://api.ipify.org

To get geo info of our IP, visit:

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