Skip to content

Netlas command line interface

To access Netlas using the command line interface, the Netlas team has developed a special utility. With it, you can use Netlas just like any other command line application. This utility is included in the Netlas Python SDK.

Installation

If you have Python installed, simply use the Python package installer to install the SDK:

$ pip install netlas

Or if you already have it installed and want to upgrade to the latest version:

$ pip install --upgrade netlas

Now you can interract with the Netlas platform using command netlas. The following command will return data related to your IP-address.

$ netlas host

The same data you should see in the web app if you open https://app.netlas.io/host/

Setting up API key

There are two ways of API key usage when you work with Netlas CLI (command line interface). The first way is to enter the key each time you enter a command with the -a option. Another way is to save the key using savekey command.

$ netlas host -a YOUR_API_KEY

Another way is to save the key to the local system.

$ netlas savekey YOUR_API_KEY

CLI usage

Please refer to the built-in help for command and option information. To show help page:

$ netlas --help
Usage: netlas [OPTIONS] COMMAND [ARGS]...

Options:
  -h, --help  Show this message and exit.

Commands:
  count           Calculate count of query results.
  download        Download data.
  host            Host (ip or domain) information.
  indices         Get available data indices.
  profile         Get user profile data.
  savekey         Save API key to the local system.
  search (query)  Search query.
  stat            Get statistics for query.

To view specific command help:

$ netlas command --help