This script is designed to extract and retrieve geolocation information for IP addresses found in a given file. It utilizes the IP Geolocation API to gather information about each IP address and displays the results.
Before using the script, ensure you have obtained an API key from IPGeolocation.io.
To use this script, follow these steps:
-
Obtain an API key from IPGeolocation.io.
-
Create a
config.pyfile in the same directory as the script and add your API key as follows:# config.py # Define your API key here API_KEY = "your_api_key_here"
-
Run the script using the following command:
python main.py <file_path_or_directory>Replace
<file_path_or_directory>with the path to a text file containing IP addresses or a directory containing multiple text files. The script will extract and retrieve geolocation information for the IP addresses found in the specified file(s) and display the results.
- IP addresses are processed only once, even if they appear multiple times in the specified file(s).
