A simple Python tool that retrieves detailed information about a given IP address using the ipinfo.io API.
- Retrieves detailed information about an IP address, including hostname, city, region, country, organization, and more.
- Uses the
requests
library to interact with the ipinfo.io API. - Outputs the retrieved details in a clean format.
To run this project, you need Python 3.x installed and the requests
library.
Install the required package:
pip install requests
-
Clone the repository to your local machine :
git clone https://github.com/XanderSteyn/IP-To-Location.git cd IP-To-Location
-
Run the script:
python IPLookup.py
requests
A simple HTTP library to interact with the ipinfo.io API.
- The script prompts you to input an IP address.
- It sends a GET request to the ipinfo.io API to fetch the details of the provided IP.
- The retrieved information is then displayed, including the IP, hostname, city, region, country, location coordinates, organization, postal code, timezone, and anycast information.
-
Run the script :
python IPLookup.py
-
Enter the IP address when prompted :
IP: 8.8.8.8
-
The script will then display the details for the provided IP.
- API Source : The script uses the ipinfo.io API, which provides various details about the given IP address.
- Error Handling : If a requested field is not available, it will display 'N/A'.