Bulk IPv4 Whois Report is a powerful tool for obtaining information about a large number of IPv4 addresses simultaneously. Instead of performing individual lookups for each IP, a bulk report streamlines the process, providing a consolidated view of ownership, registration, and etc. for many IP addresses at once.
ipwhois.py utilizes IPinfo's public API and service is limited to 1000 requests per day. The limit is shared by everyone within same network using same Public IP Address for requests; see API data differences here. I highly recommend utilizing an API Token to avoid limitation by following provided steps below:
- Sign up for free account at https://ipinfo.io/signup; Otherwise, login to your IPinfo account here
- Navigate to
API Token
page
- Copy your account's
Token
- Download ipwhois_api.py from this respository
- Open file in editor and add
Token
toline two
then Save
WARNING: API tokens are sensitive! Keep them secret, don't expose them in code you share or public repositories, and revoke immediately if compromised.
- Requires use of CSV files' default comma delimitation
- Requires column name with IPs and will be prompted to provide; Case sensitive
- Requires to be space or line delimited
For test samples: see test_samples folder in repository here
- Before starting, please review Supported Versions and Disclaimers here and confirm you meet requirements for usage.
- Download or make copy of script
- Take note of the script’s path
- Open PowerShell as an administrator
- Optional: Navigate to directory location of script using
cd
command (Example:cd “C:\My Folder”
) - Run Python Script:
python <scriptname>.py <Parameter1> <Parameter2>
python C:\MyFolder\<scriptname>.py <Parameter1> <Parameter2>
- Before starting, please review Supported Versions and Disclaimers here and confirm you meet requirements for usage.
- Download or make copy of script
- Take note of the script’s path
- Open Terminal
- Optional: Navigate to directory location of script using
cd
command (Example:cd "/My Folder"
) - Run Python Script:
python3 ./<scriptname>.py <Parameter1> <Parameter2>
python3 /MyFolder/<scriptname>.py <Parameter1> <Parameter2>
python3 ipwhois.py <File_Path>
<File_Path>
is a required parameter to pull report of IPs for running Bulk IP Whois against using script. If not provided, the script will end with usage instructions python3 ipwhois.py '<filepath>'
.
python3 ipwhois.py <File_Path> --verbose
--verbose
is an optional parameter to provide more detailed reports and all examples will be provided here. Once provided, you will see print Verbose mode enabled.
within terminal.
ipwhois.csv
ipcount_verbose.csv
ipwhois_verbose.csv
Note: You can find all examples of reports here
python3 ipwhois_api.py "/Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois/test_samples/test_space_delimited.txt"
macOS detected.
Starting..
Provided file path: /Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois/test_samples/test_space_delimited.txt
File type: .txt
IP(s) found: ['8.8.8.8', '1.1.1.1', '70.231.16.0', '8.8.8.8']
CSV data exported to ipwhois.csv
Location: /Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois
Thank you for using Bulk IPv4 Whois Report!
Goodbye!
python3 ipwhois_api.py "/Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois/test_samples/test_space_delimited.txt" --verbose
macOS detected.
Starting..
Verbose mode enabled.
Provided file path: /Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois/test_samples/test_space_delimited.txt
File type: .txt
IP(s) found: ['8.8.8.8', '1.1.1.1', '70.231.16.0', '8.8.8.8']
Starting..
Verbose mode: IP Count CSV report
CSV data exported to ipcount_verbose.csv
Location: /Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois
CSV data exported to ipwhois_verbose.csv
Location: /Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois
Thank you for using Bulk IPv4 Whois Report!
Goodbye!
python3 ipwhois_api.py "/Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois/test_samples/test.csv"
macOS detected.
Starting..
Provided file path: /Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois/test_samples/test.csv
File type: .csv
Enter the column name containing IPs [case sensitive]: IP
IP(s) found: ['8.8.8.8', '1.1.1.1', '70.231.16.0', '8.8.8.8']
CSV data exported to ipwhois.csv
Location: /Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois
Thank you for using Bulk IPv4 Whois Report!
Goodbye!
python3 ipwhois_api.py "/Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois/test_samples/test.csv" --verbose
macOS detected.
Starting..
Verbose mode enabled.
Provided file path: /Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois/test_samples/test.csv
File type: .csv
Enter the column name containing IPs [case sensitive]: IP
IP(s) found: ['8.8.8.8', '1.1.1.1', '70.231.16.0', '8.8.8.8']
Starting..
Verbose mode: IP Count CSV report
CSV data exported to ipcount_verbose.csv
Location: /Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois
CSV data exported to ipwhois_verbose.csv
Location: /Users/levarnorwood/workspace/github.com/lev2pr0/ipwhois
Thank you for using Bulk IPv4 Whois Report!
Goodbye!
Please Note: API tokens are used in all demos provided above.
- Python 3.10+
- Windows 10 and above
- macOS 14 (Sonoma) and above
- Stable versions of Linux (unsupported vendor linux distributions experience may vary)
- Minimal .py files and condensed code for easier distribution.
- Python Standard Library used only to reduce complex requirements to use.
- .env file is recommended for API Token for personal use. Design choice for ease of use for all; especially in secure environments that block .env files.
Sample IPinfo Lite API Data
{
"ip": "8.8.8.8",
"asn": "AS15169",
"as_name": "Google LLC",
"as_domain": "google.com",
"country_code": "US",
"country": "United States",
"continent_code": "NA",
"continent": "North America"
}
Sample IPinfo Public API Data
{
"ip": "8.8.8.8",
"hostname": "dns.google",
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.4056,-122.0775",
"org": "AS15169 Google LLC",
"postal": "94043",
"timezone": "America/Los_Angeles",
"readme": "https://ipinfo.io/missingauth",
"anycast": true
}
- API tokens are sensitive! Keep them secret, don't expose them in code you share or public repositories, and revoke immediately if compromised.
- Always test the script in a non-production environment first.
- Review the script's code and understand its functionality before execution.
- The script may require specific permissions or elevated privileges to run correctly.
- The script's behavior may vary depending on the system configuration and environment.
Open to all collaboration 🙏🏽
Please follow best practice outlined below:
- Fork from the
main
branch only - Once forked, make branch from
main
with relevant topic - Make commits to improve project on branch with detailed notes
- Test, test, test and verify
- Push branch to
main
in your Github repository - Test, test, test and verify
- Open pull request to
main
with details of changes (screenshots if applicable)
How to support? Buy me coffee ☕️ via Paypal