ipinfo is the official CLI tool for the IPinfo.io IP address API, allowing you to:
You will need to have the Go programming language installed on your system in addition to Git.
After that run the commands:
git clone https://github.com/ipinfo/cli ipinfo-cli
cd ipinfo-cli/
go build -o ~ ./ipinfo
cd
sudo install -v ipinfo .local/bin/
Then remove the cloned directory: ipinfo-cli.
To get a help
of the parameters, just run the ipinfo command, something like this will appear:
Usage: ipinfo <cmd> [<opts>] [<args>]
Commands:
<ip> look up details for an IP address, e.g. 8.8.8.8.
<asn> look up details for an ASN, e.g. AS123 or as123.
myip get details for your IP.
bulk get details for multiple IPs in bulk.
summarize get summarized data for a group of IPs.
...
To get data from your own IP, run:
ipinfo myip
Find out the IP of a given URL and get detailed information with ipinfo:
Example, get data from the URL: https://en.terminalroot.com.br/
ipinfo $(ping -c1 en.terminalroot.com.br | sed -n '1p' | sed 's/.* (//;s/) .*//')
Output in JSON format
ipinfo myip --json
The parameters must be indicated at the end of the command.
See an example GIF usage:
For more information access the links below: