Skip to content

amfinethankyou/ip-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


๐ŸŒ IP Info Extractor

Powerful IP intelligence at your fingertips โ€” straight from the terminal.

Python 3.8+ MIT License ip-api.com Output formats


โœจ Features

Feature Details
๐Ÿ” Single & Batch Lookups Look up one IP or hundreds at once
๐Ÿ  Own-IP Detection Run with no arguments to discover your own public IP
๐ŸŒˆ Rich Coloured Tables Beautiful terminal output powered by Rich
๐Ÿ“„ Multiple Output Formats table (default), json, or csv
๐Ÿ’พ Save to File Write results to any file with --output
๐Ÿ›ก๏ธ Proxy / VPN / Hosting Flags Instantly know if an IP belongs to a VPN, proxy, or data-centre
๐Ÿ“ก Reverse DNS PTR record lookup for every IP
โœ… Input Validation Invalid IPs are skipped gracefully with a clear error
๐Ÿ“‚ Input File Support Read IPs from a file via --input-file
๐Ÿ” Retry + Timeout Controls Tune network behavior with --retries and --timeout
โฑ๏ธ Timeout Handling Never hangs โ€” all requests have a configurable timeout

๐Ÿš€ Quick Start

Prerequisites

python --version   # Python 3.8+
pip --version

Install dependencies

pip install -r requirements.txt

Make the script executable (optional)

chmod +x ip_info_extractor.py

๐Ÿ“– Usage

usage: ip_info_extractor.py [-h] [--input-file FILE] [--format {table,json,csv}] [--output FILE] [--timeout TIMEOUT] [--retries RETRIES] [--no-color] [IP ...]

๐ŸŒ IP Info Extractor โ€“ Powerful IP intelligence at your fingertips

positional arguments:
  IP                    IP address(es) to look up (omit to detect your own public IP)

options:
  -h, --help            show this help message and exit
  --input-file/-i FILE  Read IP address(es) from FILE (one per line or comma-separated)
  --format/-f {table,json,csv}
                        Output format (default: table)
  --output, -o FILE     Save output to FILE instead of printing to stdout
  --timeout TIMEOUT     Request timeout in seconds (default: 10.0)
  --retries RETRIES     Request retries on failure (default: 2)
  --no-color            Disable coloured output

๐Ÿ’ก Examples

Look up your own public IP

python3 ip_info_extractor.py

Single IP lookup

python3 ip_info_extractor.py 8.8.8.8
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚       IP Intelligence Report  โ€ข  8.8.8.8            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Field              โ”‚ Value                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ IP Address         โ”‚ 8.8.8.8                        โ”‚
โ”‚ Country            โ”‚ United States                  โ”‚
โ”‚ Country Code       โ”‚ US                             โ”‚
โ”‚ Region             โ”‚ California                     โ”‚
โ”‚ City               โ”‚ Mountain View                  โ”‚
โ”‚ ZIP                โ”‚ 94043                          โ”‚
โ”‚ Latitude           โ”‚ 37.422                         โ”‚
โ”‚ Longitude          โ”‚ -122.0841                      โ”‚
โ”‚ ISP                โ”‚ Google LLC                     โ”‚
โ”‚ Organization       โ”‚ Google LLC                     โ”‚
โ”‚ AS Number          โ”‚ AS15169 Google LLC             โ”‚
โ”‚ Timezone           โ”‚ America/Los_Angeles            โ”‚
โ”‚ Mobile Network     โ”‚ No                             โ”‚
โ”‚ Proxy / VPN        โ”‚ No                             โ”‚
โ”‚ Hosting / DC       โ”‚ Yes                            โ”‚
โ”‚ Reverse DNS        โ”‚ dns.google                     โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Batch lookup (multiple IPs)

python3 ip_info_extractor.py 8.8.8.8 1.1.1.1 9.9.9.9

Load IPs from a file

python3 ip_info_extractor.py --input-file ips.txt

ips.txt can contain one IP per line or comma-separated values.

JSON output

python3 ip_info_extractor.py 8.8.8.8 --format json
{
    "query": "8.8.8.8",
    "country": "United States",
    "countryCode": "US",
    "regionName": "California",
    "city": "Mountain View",
    "zip": "94043",
    "lat": 37.422,
    "lon": -122.0841,
    "isp": "Google LLC",
    "org": "Google LLC",
    "as": "AS15169 Google LLC",
    "timezone": "America/Los_Angeles",
    "mobile": "No",
    "proxy": "No",
    "hosting": "Yes",
    "rdns": "dns.google"
}

CSV output

python3 ip_info_extractor.py 8.8.8.8 1.1.1.1 --format csv

Save results to a file

python3 ip_info_extractor.py 8.8.8.8 --format json --output result.json
python3 ip_info_extractor.py 8.8.8.8 1.1.1.1 --format csv  --output results.csv

Plain output (no colour, useful for piping)

python3 ip_info_extractor.py 8.8.8.8 --format json --no-color | jq .

Tune request reliability

python3 ip_info_extractor.py 8.8.8.8 --timeout 5 --retries 3

๐Ÿ—‚๏ธ Repository Structure

ip-tool/
โ”œโ”€โ”€ ip_info_extractor.py   # Main tool
โ”œโ”€โ”€ requirements.txt       # Python dependencies
โ””โ”€โ”€ README.md              # This file

๐Ÿ”Œ API

This tool uses the free tier of ip-api.com.

Note: The free tier is limited to 45 requests/minute. For higher throughput, see the ip-api.com Pro plan.


๐Ÿ“ฆ Dependencies

Package Purpose
requests HTTP client
rich Coloured terminal output

๐Ÿ“„ License

This project is released under the MIT License โ€” do whatever you like with it.

About

ip information extractor tool.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages