LinuxCommandLibrary

ipinfo

Retrieve IP address information

TLDR

Display details for your current IP address

$ ipinfo myip
copy

Display details for a specific IP address
$ ipinfo [ip_address]
copy

Display details for multiple IP addresses in bulk from a file
$ ipinfo bulk [path/to/ips.txt]
copy

Display details for a CIDR or IP range
$ ipinfo bulk [cidr_range]
copy

Display only specific fields from IP lookup results
$ ipinfo [ip_address] [[-f|--field]] [hostname,country,org]
copy

Summarize details for a group of IP addresses
$ ipinfo summarize [path/to/ips.txt]
copy

Extract IP addresses from text and highlight them
$ ipinfo grepip [path/to/file.txt]
copy

Display help
$ ipinfo [[-h|--help]]
copy

SYNOPSIS

ipinfo [-h | -V | -f FIELDS | -j | -L | -t TOKEN | -y] [IP_ADDRESS_OR_FILE]

PARAMETERS

-h, --help
    Display help message and exit

-V, --version
    Show ipinfo version

-f, --fields FIELDS
    Comma-separated list of fields (e.g., city,country,org) to display

-j, --json
    Output full response in JSON format

-L, --locate
    Return only latitude and longitude

-t, --token TOKEN
    API token for extended data (ASN, company, etc.) and higher limits

-y, --yaml
    Output full response in YAML format

DESCRIPTION

ipinfo is a lightweight command-line interface tool that retrieves detailed information about IP addresses using the ipinfo.io API.

It provides geolocation data, ASN details, carrier information, company ownership, and more for any IPv4 or IPv6 address. By default, running ipinfo without arguments queries your own public IP. Specify an IP to analyze others.

Key features include customizable output formats (JSON, YAML), field selection to focus on specific data like city, country, or org, and batch processing from files or stdin. It's ideal for network diagnostics, security analysis, scripting, and monitoring.

The tool is cross-platform, installable via pip (pip install ipinfo), Homebrew, or binaries from GitHub. Free tier offers 50,000 requests/month; a token unlocks more data and higher limits. Output is structured for easy parsing in automation workflows.

CAVEATS

Requires internet access and ipinfo.io API (free tier: 50k req/mo). Some data needs token. Not installed by default; third-party tool.

INSTALLATION

pip install ipinfo
brew install ipinfo/cli
or download binaries from GitHub releases

BATCH USAGE

ipinfo IP1 IP2 ...
cat ips.txt | ipinfo
Supports stdin for large lists

HISTORY

Developed by ipinfo.io team; open-source on GitHub since ~2018. Written in Go for speed/portability. Evolved with API v2+ support, batch mode, and YAML output.

SEE ALSO

host(1), dig(1), whois(1), nslookup(1)

Copied to clipboard