Explore our IP Address Database Downloads for instant access to our IP address insights

Learn more
  1. IPinfo
  2. Blog
  3. IPinfo CLI: Summarize IPs sub-command - IPinfo.io blog
IPinfo CLI: Summarize IPs sub-command - IPinfo.io blog
2 years ago by IPinfo Team 6 min read

IPinfo CLI: Summarize IPs sub-command

In our last article of the IPinfo CLI article series, we showed how IPinfo CLI users can use the mapping feature to map IP addresses on an interactive map right from their terminal. Today we are going to explore another feature of the IPinfo CLI, the summarize command.

The summarize command summarizes IP address information from a list of IP addresses. This allows you to get a summary result that contains geolocation data, ASN data, privacy detection (aka anonymous data), mobile carrier data and more, in a report-like format that can even be outputted as a JSON file.

summarize IP inputs

The summarize command like other IPinfo CLI commands can take in singular and multiple sources of IP address data. You can use text files containing IP addresses, CIDRs, and IP ranges and can even mix and match all of them in a single command. This is the summary of the summarize command:

Commands Description
ipinfo summarize ips.txt Summarize IP address data from a text file
ipinfo summarize ips_1.txt ips_2.txt ips_3.txt Summarize IP address data from multiple text files
ipinfo summarize 8.8.8.0/24 Summarize data from all the IP addresses in a CIDR
ipinfo summarize 8.8.8.0/24 1.1.1.0/24 Summarize data from all the IP addresses from multiple CIDRs
ipinfo summarize 8.8.8.0-8.8.8.255 Summarize data of IP addresses in an IP range
ipinfo summarize 8.8.8.0-8.8.8.255 1.1.1.0/30 123.123.123.123 ips.txt Summarize IP address data from multiple sources simultaneously

Summarizing IP addresses from a file

You can get summary-level information from IP addresses listed in a text file. This is incredibly helpful if you are processing a log file or have just copied and pasted a list of IP addresses to a file.

Simply pass the path to the file containing the IP addresses to the IPinfo CLI like so:

ipinfo summarize ips.txt

You can also input several text files to be simultaneously summarized into one output:

ipinfo summarize ips_1.txt ips_2.txt ips_3.txt ips_4.txt
IPinfo summarize command output from 200 randomly generated IP addresses contained in a couple of plaintext files

Summarizing IP addresses from CIDR and IP ranges

CIDR and IP ranges are unique as they represent a block or a set of IP address information.

To get summary-level information from a CIDR, you can simply pass the CIDR value to the CLI:

  • Summarizing information from a singular CIDR
ipinfo summarize 8.8.8.0/24
  • Summarizing information from multiple CIDRs
ipinfo summarize 142.245.65.0/24 142.245.67.0/24 142.245.71.0/24 142.245.72.0/24
Output sample from summarizing IP information extracted from multiple CIDRs

We can even create IP range summaries right out of the box with the IPinfo CLI and as always, you can process multiple sources simultaneously in one line of command:

  • Summarizing IP insights from a singular IP range:
ipinfo summarize 149.234.16.0-149.234.31.255
  • Summarizing IP insights from multiple IP ranges:
ipinfo summarize 149.234.16.0-149.234.31.255 212.64.224.0-212.64.255.255
Output sample of IP information summary of an IP range

Simultaneous processing of all sources

And last but not least, simultaneously process and summarize different of kinds of IP address data sources:

ipinfo summarize 149.234.16.0-149.234.31.255 142.245.72.0/24 ips.txt

summarize IP Results

The summarize command lets you summarize IP address-related information from a list of IP addresses in one fell swoop and returns a robust, information-dense result. The summary output shows the following features on the output report:

Summary

  • Total: Total number of input IP addresses
  • Unique: Total number of unique input IP address
  • Anycast: Total number of Anycast IP addresses which are IP addresses that are hosted on multiple devices.
  • Bogon: Total number of Bogon IP addresses, which are IP addresses that are reserved for special use and are not assigned to a specific user or server.
  • Mobile: Total number of IP addresses assigned to mobile devices
  • VPN: Total number of IP addresses that are using a VPN service
  • Proxy: Total number of IP addresses that are using a proxy service
  • Hosting: Total number of IP addresses that are hosted on a server or datacenter
  • Tor: Total number of IP addresses that originate from a Tor exit node
  • Relay: Total number of IP addresses that are using a relay

Top ASNs: Top 5 ASNs with organization name

Top Usage Types: Usage types with the option being: Business, Hosting, ISP and Education.

Top Routes: IP range routes with ASN

Top Countries: IP address source countries

Top Cities: IP address source cities

Top Regions: IP address source regions

Top Domains: Top domains associated with the input IP addresses

This is what a pretty output summary report looks like after analyzing 1,000 randomly generated IP addresses:

$ ipinfo summarize ips.txt

Summary
- Total   200
- Unique  200
- Anycast 0
- Bogon   41
- Mobile  6
- VPN     1
- Proxy   0
- Hosting 10
- Tor     0
- Relay   0

Top ASNs
- AS749 DoD Network Information Center  7 (3.5%)
- AS7018 AT&T Services, Inc.            6 (3.0%)
- AS17676 Softbank BB Corp.             4 (2.0%)
- AS8075 Microsoft Corporation          4 (2.0%)
- AS209 CenturyLink Communications, LLC 3 (1.5%)

Top Usage Types
- ISP       98 (49.0%)
- Business  44 (22.0%)
- Hosting   10 (5.0%)
- Education 5 (2.5%)

Top Routes
- 107.64.0.0/10 (AS7018)  3 (1.5%)
- 7.0.0.0/8 (AS749)       2 (1.0%)
- 215.0.0.0/9 (AS721)     2 (1.0%)
- 135.4.0.0/14 (AS10455)  1 (0.5%)
- 170.21.0.0/16 (AS22773) 1 (0.5%)

Top Countries
- United States  81 (40.5%)
- Japan          10 (5.0%)
- China          8 (4.0%)
- United Kingdom 6 (3.0%)
- Germany        4 (2.0%)

Top Cities
- Columbus, Ohio, US      10 (5.0%)
- London, England, GB     6 (3.0%)
- Redmond, Washington, US 6 (3.0%)
- Tokyo, Tokyo, JP        5 (2.5%)
- Chicago, Illinois, US   4 (2.0%)

Top Regions
- Ohio, US       10 (5.0%)
- California, US 10 (5.0%)
- Washington, US 9 (4.5%)
- England, GB    6 (3.0%)
- Tokyo, JP      6 (3.0%)

Top Carriers
- T-Mobile UK  1 (0.5%)
- Claro        1 (0.5%)
- OOREDOO%20TN 1 (0.5%)
- Verizon      1 (0.5%)
- Safaricom    1 (0.5%)

Top Domains
- bbtec.net   4 (2.0%)
- comcast.net 4 (2.0%)
- qwest.net   3 (1.5%)
- rr.com      2 (1.0%)

summarize Command Output Formats

The summarize command has “pretty printed" output turned on by default. You can disable colors with the argument --nocolor. Going beyond the prettify format output, the summarize command let’s you output the results in a json format as well with the argument --json or -j for short.

ipinfo summarize ips.txt --json

Summarize IP - IPinfo Online Tool

If you are looking for a web UI with interactive features, check out our: IPinfo Summary Tool. Our online summary tool also integrates our mapping tool into a single page.

You can generate this online report from the command line as well:

$ cat ips.txt | curl -XPOST --data-binary @- "ipinfo.io/tools/summarize-ips?cli=1"

{
  "status": "Report Generated",
  "reportUrl": "<https://ipinfo.io/tools/summarize-ips/ac27ea4a-79b2-4f9d-9302-c9a87975d316>"
}

And you can pass all the IP address inputs we described so far.

Getting started with IPinfo's CLI

All CLI binaries (e.g. ipinfo, grepip, map IPs) are available for download from multiple mechanisms. See https://github.com/ipinfo/cli#installation for full details.

IPinfo CLI Cheatsheet

IPinfo is a comprehensive IP address data and API provider with flexible pricing plans to meet your business needs. We handle billions of API requests per month, serving data like IP geolocation, VPN detection, ASN, and more. Sign up for a free account or contact our team to learn more.