Command Line Interface (CLI)

Learn how to programatically use Validin with our Command Line tooling

Installation

The CLI ships with the Python SDK. It needs Python 3.9 or later.

pip install validin-sdk

To install it as a standalone tool, isolated from your other Python packages, use pipx:

pipx install validin-sdk

Check it works:

validin version

To upgrade: pip install --upgrade validin-sdk (or pipx upgrade validin-sdk).

Setup

validin setup

setup asks for your API key (input is hidden) and endpoint, checks them against the API, then asks which output format to use by default (table, json, jsonl, csv, or list). It saves these settings to ~/.validin/config.json. The file is created readable only by you. It then offers to turn on tab completion for your shell. Press Enter to keep a value shown in brackets. Rerun validin setup at any time to change these settings or refresh completion.

The Python SDK reads the same saved key and endpoint, so Client() works in scripts run as the same user.

setup is an interactive shell and needs a terminal. In scripts and CI, use environment variables instead.

Environment variables

export VALIDIN_API_KEY="your-api-key"

# Enterprise accounts only
export VALIDIN_BASE_URL="https://your-enterprise-endpoint.example.com"

Precedence

Each setting is resolved in this order, and the first one found wins:

  1. Command-line flag: --api-key, --endpoint
  2. Environment variable: VALIDIN_API_KEY, VALIDIN_BASE_URL
  3. Config file: ~/.validin/config.json
  4. Default endpoint: https://app.validin.com

Verify

validin ping

ping checks that the endpoint is reachable and the key is accepted, and shows which endpoint and key are in effect and where each came from (flag, env, config, or default). The key is masked.

Tab completion

validin setup offers completion for bash, zsh, and fish, based on $SHELL. It completes commands, subcommands, options, and option values such as --mode, --tag, -o, pivots --category, and registration --field.

  • bash / zsh: the script is saved to ~/.validin/completion.bash or ~/.validin/completion.zsh, and one source line is added to ~/.bashrc or ~/.zshrc.
  • fish: the script is saved to fish's completions directory and loads automatically.

Usage

validin COMMAND [SUBCOMMAND] [ARGUMENTS] [OPTIONS]
validin dns example.com
validin dns example.com --lookback 30 -o csv
validin project list
validin yara matches r123 -p 1a2b3c --json

Put options after the command name: validin dns example.com -o json, not validin -o json dns example.com.

Get help for any command with --help:

validin --help
validin dns --help
validin project --help
validin project add --help

Global options

Lookup and management commands accept these options after the command or subcommand.

OptionDescription
-o, --output FORMATtable, json, jsonl, csv, or list. Default: the format saved by validin setup, or table if none is saved, on a terminal and in pipes and files alike.
--jsonShorthand for -o json.
--api-key KEYAPI key for this command.
--endpoint URLAPI base URL for this command.
-h, --helpShow help.

Indicators

Lookup commands take one or more indicators. The type is inferred:

ValueType
203.0.113.7, 2001:db8::1IP
203.0.113.0/24CIDR
An even number of hex characters, at least 18 (MD5, SHA-1, SHA-256, 20-character header hashes)hash
example.com, or any name with two or more dot-separated labelsdomain
anything elsestring

Where a command takes strings but not hashes (dns, registration), a hex-only value is searched as a string, so verification tokens work without --as string.

Use --as TYPE to override inference for every indicator in the command. For example, to search text that would otherwise be typed as a domain:

validin registration '[email protected]' --as string
validin pivots 'nginx/1.18.0 (Ubuntu)' --as string --category SERVER
validin pivots '2.4.41' --as string --category SERVER

An indicator of a type the command doesn't accept is reported as an unsupported_indicator error. The other indicators still run.

Reading from stdin

Leave out the indicators to read them from stdin, one per line. Blank lines and lines starting with # are skipped, and exact duplicates are removed. Passing - in place of the indicators does the same.

cat iocs.txt | validin reputation
validin reputation < iocs.txt
validin subdomains example.com -o list | validin dns

When you give indicators as arguments, stdin is not read. That keeps the CLI safe in while read loops, and in cron jobs or agents whose stdin stays open. Giving indicators and - together is a usage error (exit 2).

Commands that take other lists, such as alert row IDs, YARA match row IDs, project member emails, resource URLs and threat keys, also read stdin when the list is left out. yara add and yara edit read the rule source from stdin when the file is left out.

Limits and time windows

OptionDescription
--limit NMaximum records per indicator. Default 100. --limit 0 removes the CLI's limit and returns whatever the API returns. Maximum 20000 for most commands, 250 for lookalikes, 5000 for opendirs url.
--lookback NOnly records seen in the last N days.
--first-seen YYYY-MM-DDOnly records first seen on or after this date.
--last-seen YYYY-MM-DDOnly records last seen on or before this date.

When a result is capped, truncated is true in JSON output, and table output says so on stderr in a result count that starts with *.

Output

Use --json for records, errors and truncation status in one object. Output doesn't switch to JSON in a pipe, so scripts that parse it should always pass --json or -o FORMAT rather than rely on the saved default.

Formats

FormatOutputUse for
tableAligned columns for the most useful fields. A result count and any notes go to stderr.Reading in a terminal.
jsonThe full envelope. Indented on a terminal, one compact line in a pipe.jq, scripts, agents.
jsonlOne result object per line, no envelope.Streaming, large results, line-oriented tools.
csvOne result per row with a header. Nested values are JSON-encoded.Spreadsheets, pandas.
listOne unique value per line: the command's main answer (for example, the resolved values for dns, the domains for lookalikes).Piping into the next validin command.

The JSON envelope

{
  "command": "dns",
  "query": {"indicators": ["example.com"], "limit": 100},
  "count": 1,
  "truncated": false,
  "results": [
    {"key": "example.com", "key_type": "domain", "type": "A", "value": "93.184.215.14",
     "value_type": "ip", "first_seen": "2024-10-01T00:00:00+00:00", "last_seen": "2024-11-13T00:00:00+00:00"}
  ],
  "errors": []
}
FieldDescription
commandThe command that ran.
queryThe indicators and options that were sent.
countNumber of results.
truncatedtrue if the API capped any part of the result. Raise --limit or narrow the query.
resultsOne object per record. DNS rows have a key, type and value. See validin commands --json for fields used by other commands.
errorsPer-indicator failures: {"indicator", "code", "status", "message"}.

DNS timestamps use ISO 8601.

stdout and stderr

Results go to stdout. In JSON output, per-indicator failures appear in the envelope’s errors array. Other formats write those failures to stderr. Fatal errors go to stderr in every format.

In json and jsonl mode, errors on stderr are JSON lines:

{"error":{"code":"auth_failed","status":401,"message":"bad key","hint":"Check the key with `validin ping`, or run `validin setup`."}}

In other modes they are prose:

error: bad key [auth_failed]
hint: Check the key with `validin ping`, or run `validin setup`.

Set NO_COLOR to turn off colour.

Exit codes

CodeMeaning
0Success, including zero results.
1API or network error (or every indicator failed).
2Invalid arguments or input. No request was made.
3Missing or rejected API key.
4Rate limited or quota exhausted (after retries).
5Partial result. Check the records and errors.

Error codes

CodeMeaning
usage_errorBad arguments.
invalid_indicatorA value couldn't be parsed.
unsupported_indicatorThe command doesn't accept this indicator type.
no_api_keyNo key in flags, environment, or config.
auth_failedThe key was rejected.
forbiddenThe key can't access this resource or feature.
not_foundNothing exists for this indicator or id.
bad_requestThe API rejected the request.
rate_limitedToo many requests, or quota exhausted.
timed_outAn open-directory search returned incomplete results.
connection_failedThe CLI couldn’t connect to the endpoint.
timeoutThe request or wait timed out.
server_errorThe API returned a 5xx error.
not_interactivevalidin setup was run without a terminal.

Command reference

Run validin commands for a one-line summary of everything, or validin COMMAND --help for full details.

Lookups

validin dns INDICATOR...

DNS resolution history (A, AAAA, NS, CNAME, ...) for domains, IPs, CIDRs, or strings.

OptionDescription
--extraExtra record types instead: TXT, MX, SOA, SRV, HTTPS, ...
--ptrReverse DNS (PTR) history instead.
--types A,AAAA,NSOnly these record types.
--exclude-nxDrop NXDOMAIN observations.
--wildcardInclude subdomains of a domain, or substring-match a string.
--annotateAdd reputation intel (key_intel, value_intel) to each result.
--limit, --lookback, --first-seen, --last-seenSee Limits and time windows.

-o list prints the record values (resolved IPs, name servers, TXT strings, or domains for an IP query).

validin reputation INDICATOR... (alias: enrich)

Reputation score, verdict, reasons, and threat-intel annotations for domains and IPs. -o list prints the indicators.

validin subdomains DOMAIN...

Known subdomains of a registered domain. Results are alphabetical, so --limit cuts A–Z, not by recency. Use --limit 0 for the API default. Options: --limit, --annotate.

validin lookalikes TARGET

Newly registered domains that resemble a target domain. TARGET is a domain such as acme.com, or a /regex/.

OptionDescription
--lookback NNewly observed in the last N days (1–90, default 3).
--similarity NMaximum edit distance (0–4, default 2). Not for regex targets.
--depthlabels, subdomains, or fqdns.
--exclude VALUEDomains or keywords to leave out. Repeatable or comma-separated.
--limit NUp to 250.

-o list prints the lookalike domains.

validin crawl INDICATOR...

HTTP(S) responses Validin's crawler recorded on a domain, IP, or CIDR, or every host that served a fingerprint (body, header, banner, or favicon hash). Shows titles, ports, banners, and hashes.

Searches the last 90 days unless --lookback or --first-seen is given. Rows aren't in date order, so --limit keeps an arbitrary subset. Narrow the time window for fewer matches. Options: --limit, --lookback, --first-seen, --last-seen, --annotate.

-o list prints the IPs that served the responses.

validin certs DOMAIN...

Certificate Transparency history. Each certificate is usually logged several times (precertificate and final, across logs). The table shows one row per certificate with an ENTRIES count. JSON and CSV show individual log entries. --limit counts log entries before deduplication.

Options: --wildcard (include subdomain certificates), --limit, --lookback, --first-seen, --last-seen. -o list prints SHA-256 fingerprints.

validin registration INDICATOR...

WHOIS/RDAP registration history, or a live registry lookup.

OptionDescription
--liveQuery the registry now instead of history. Domains, IPs, and CIDRs. The lookup can take 30 seconds. Validin caches the results for 24 hours.
--mode rdap|whoisLive protocol (default rdap).
--rawLive lookup. Read the registry response in .results[].raw.rdap or .results[].raw.whois with --json.
--wildcardHistory: include subdomains.
--field FIELDHistory: find domains whose registration has this value in one field, for example REGISTRANT_EMAIL, REGISTRAR, or TECH_ORG. Values are always searched as text, so --as string isn't needed. Tab completion lists known fields. The CLI sends other names as entered. Not with --live.
--annotate, --limit, --lookback, --first-seen, --last-seenAs above.

A string indicator (for example an email address with --as string) does a reverse search across all registration fields. Use --field to search one field. History covers domains and strings. For IPs and CIDRs, use --live. -o list prints registrars, or with --field the matching domains. An unknown --field name returns nothing, with a note on stderr ({"note": ...} in JSON modes).

validin content HASH...

What a hash points at.

--kindHashReturns
html (default)SHA-1 body hashThe HTML, its plain text, loaded resources, and referenced hosts.
certSHA-1 certificate fingerprintPEM, subject, issuer, and validity.
faviconMD5The image, base64-encoded.

--date YYYY-MM-DD picks a day the hash was observed. -o list prints the raw HTML, the PEM, or the base64 image, so you can redirect it to a file.

validin pivots INDICATOR...

Where a value was seen on other hosts: the IPs and hosts whose crawled responses contained it. Each row is one IP (relation is ip) or host (relation is host), and category says where the value was seen.

IndicatorWhere it was seen
DomainPages linking to it (ANCHORS_LINKS, JS_LINKS, LINKS_LINKS), certificates naming it (CERT_DOMAIN), redirects to it (LOCATION_DOMAIN).
HashHosts that served it (BODY_SHA1, HEADER_HASH, CERT_FINGERPRINT, ...).
StringHosts whose server banner, title, or certificate fields contain it (SERVER, TITLE, CERT_O, ...).
IP or CIDRHosts that redirect to it (LOCATION_IP4, from the Location: header). IPs also get rows for what the IP's own responses contained (server banner, title, hashes, certificate fields). Those rows have relation set to observed_on.
OptionDescription
--category NAMEOnly one kind of sighting, for example ANCHORS_LINKS, CERT_DOMAIN, BODY_SHA1, HEADER_HASH, SERVER, TITLE. Tab completion lists documented categories. The CLI sends other names as entered. An IP takes only LOCATION_IP4 (hosts that redirect to it). Leave --category off to also see what the IP itself served. Not for CIDRs.
--wildcardInclude subdomains of a domain.
--annotate, --limit, --lookback, --first-seen, --last-seenAs above.

Output fields: key, category, relation, value, value_type, first_seen, last_seen. -o list prints the values, so you can pipe them back into validin pivots to pivot again. An even-length hex value of 18 or more characters is looked up as a hash, including 20-character header hashes. Use --as string for text that looks like a domain or a hash. If an unfamiliar category returns no records, the CLI writes a note to stderr.

validin osint INDICATOR...

Open-source lists and feeds (block lists, popularity rankings, cloud provider ranges, and so on) that included a domain, IP, or CIDR, with tags and when it was seen there. Public suffixes such as co.uk are refused.

Options: --wildcard (include subdomains), --limit, --lookback, --first-seen, --last-seen. Output fields: key, source, url, tags, categories, types, first_seen, last_seen. -o list prints the sources.

validin context INDICATOR...

OSINT annotations for many domains and IPs at once, 1,000 per request: the feeds and lists each one is on. Faster than reputation for long lists, but there is no overall score or verdict. Needs the bulk role on your account.

Output fields: key, key_type, type, reasons, annotations, plus score and verdict (always null here) and informational (always {}). Rows have the same fields as reputation rows, so the two outputs can be combined. Values that aren't domains or IPs become unsupported_indicator errors. -o list prints the indicators.

Threat groups

validin threat SUBCOMMAND: named threat actors, groups, and malware families, with their reported indicators and reports. Needs the bulk or projects role on your account.

SubcommandDescription
listEvery named threat (several thousand): key, category, total_indicators, references_count, aliases, last_updated. --category malicious,malware,suspicious and --search TEXT (matches keys and aliases, case-insensitive) filter the list. -o list prints keys.
show KEY...A threat's summary: name, aliases, indicator counts by type, reference count, MITRE techniques, and activity (indicators reported per period, in JSON).
indicators KEY...Indicators reported for the threat, with key_type and date_added. -o list prints the indicators.
reports KEY...Public reports about the threat, newest first: date, source, display_key, url. -o list prints the URLs.

Keys are case-insensitive. Leave out the keys to read them from stdin. An unknown key produces a not_found error. If other keys succeed, the CLI returns their records and exits with code 5.

Domain submissions

validin submit DOMAIN...

Ask Validin to start scanning domains (DNS, crawling, certificates). This can't be undone. Duplicates are dropped, values that aren't domains become error rows, and the rest are sent 10,000 per request.

OptionDescription
--dry-runValidate and count the domains without sending them.

The summary row includes requested, valid, accepted, requests, and dry_run. The API skips names it can’t scan. With --dry-run, accepted is null. -o list prints the domains. Mixed valid and unsupported inputs produce exit 5, including with --dry-run. If all inputs are unsupported, the CLI exits 2 before submission. Submitting requires full API access.

Open directories (beta)

validin opendirs SUBCOMMAND. These need the open-directories role on your account.

SubcommandDescription
lookup INDICATOR...Open directories crawled on a domain, IP, or CIDR, newest first. Options: --wildcard, --annotate, --limit, time window.
query QUERYSearch crawls with open_dir.* clauses, for example 'open_dir.file.ext = "exe"'. On timeout, the command reports timed_out and exits with 5 if it found rows or 1 if it found none. --files includes up to 50 matching files per crawl (needs an open_dir.file.* clause). --field returns only some fields.
url URLEvery capture of one exact http(s) URL. An index lookup: the URL is not fetched. Trailing slashes matter.
files HASH...Captured files matching an MD5, SHA-1, or SHA-256, and where they were hosted. --limit caps crawls searched, not files returned.
ls IDList a directory (a 14-hex crawl id lists its starting directory). -R/--recursive (capped at 10,000), --type file|dir, --sort name|size|last_modified, --order asc|desc.
show IDMetadata for one crawl, directory, or file.
get FILE -O PATHDownload a captured file by 18-hex file id or hash. -O is required: a directory gets <sha256>.bin. --force overwrites. Files are never written to the terminal.

Treat downloaded files as malware. opendirs get only writes bytes to disk. Never execute or open them outside an isolated analysis environment.

Projects

validin project SUBCOMMAND. Project ids come from validin project list.

SubcommandDescription
listProjects you can see.
show PROJECTOne project's details.
create NAMECreate a project. --description, --tlp CLEAR|GREEN|AMBER|RED. -o list prints the new id.
edit PROJECT--name, --description, --tlp (none clears it), --auto-alerts on|off.
delete PROJECT --yesDelete a project and everything in it. Requires --yes.
indicators PROJECTIndicators with tags, notes, and alert state. Filter with --tag (repeatable) and --alerting.
add PROJECT INDICATOR...Add indicators. --note, --tag (repeatable).
remove PROJECT INDICATOR...Remove indicators.
update PROJECT INDICATOR...--tag, --untag (both repeatable), --note ('' clears it).
alerts PROJECTAlerts for the newest alert day, or --date YYYY-MM-DD. --dates lists the days that have alerts.
alert-prefs PROJECTShow alert preferences, or replace them with --set SOURCE=TYPE[,TYPE...] (repeatable) or --clear. Sources: dns, crawlr, rdap, osint, subdomains. Sources left out raise no alerts.
unalert PROJECT INDICATOR...Stop alerts for the selected indicators and keep them in the project.
delete-alerts PROJECT ROWID...Delete alert records by alert_rowid.
scans PROJECTLive scans linked to the project.
members PROJECTMembers and permissions (enterprise).
share PROJECT USER...Share with existing users by user id or email (enterprise). --permission edit|add-indicators|view (default view), --alert, --notify, --message.
unshare PROJECT--user USER removes a member. Use --leave to leave the project (enterprise).
permission PROJECT USER LEVELChange a member's level (enterprise).
resources PROJECTReference links and notes.
resource-add PROJECT URLSave a link. --note.
resource-note PROJECT URL NOTEReplace a link's note ('' clears it).
resource-delete PROJECT URL...Delete links.

Tags must be one of: ground truth, confirmed, unconfirmed, rejected, suspected, compromised. Quote tags that contain spaces: --tag "ground truth".

YARA

validin yara SUBCOMMAND -p PROJECT. Every subcommand needs -p/--project. Managing rules needs an enterprise account with YARA access.

SubcommandDescription
listRules in the project.
show RULEVersions, tracking state, and source. -o list prints only the source.
add [FILE]Create a rule from a YARA source file. Leave out FILE to read the source from stdin.
edit RULE [FILE]Save new source as a new version (leave out FILE to read stdin). --base-version (default latest), --name (default from the rule <name> line).
delete RULE --yesDelete a rule with all versions, runs, and matches.
matches RULEContent that matched. All pages are fetched. --first-seen, --last-seen, --sort match_time|response_date, --order asc|desc, --html.
delete-matches RULE ROWID...Delete matches by row id (the row_ids field of matches --json).
retrohunt RULEScan up to 168 hours of history. --hours (1–168, default 1), --version, --notify none|alert|alert_and_email, --source virtual_host|ip4 (repeatable).
cancel RULECancel running retrohunts, or only --run-id.
track RULEMatch new content as it's crawled. --version, --source.
untrack RULEStop live matching.

Live scans

validin scan SUBCOMMAND

SubcommandDescription
start URLFetch a URL now from Validin's crawlers. Returns a scan id. --country CC (repeatable), --refer, --user-agent, -p PROJECT (also link it to a project), --wait, --timeout SECONDS (default 120).
status SCAN_IDCurrent status.
results SCAN_IDResponses, certificates, redirects, and hashes. --wait, --timeout.
link SCAN_ID -p PROJECTLink a scan to a project, or --remove to unlink it.

Bulk searches

validin bulk SUBCOMMAND manages bulk searches started in the Validin web app.

SubcommandDescription
listYour bulk searches, newest first. --status queued|running|done|failed|killed (repeatable).
status JOBState, progress, and per-source result counts.
edit JOBSet --name (up to 128 characters) or --description (up to 1024). An empty name restores the default.
kill JOBStop a queued or running search. Results so far are kept.

Account and tooling

CommandDescription
validin setupSave an API key, endpoint and default output format, and set up tab completion. Interactive.
validin pingCheck the connection and API key. Show the active configuration.
validin usageQuota used, limit, and remaining, today and this month. --by-path gives one row per metered API path.
validin versionInstalled validin-sdk version.
validin commandsEvery command with a summary. --json gives the full machine-readable catalog: options, types, choices, examples, output fields, table columns, the list field, exit codes, and environment variables.

Scripting

Read the exit code before processing stdout. For exit 5, keep the returned records and check each error before retrying. A fatal error can leave stdout empty. The shell example handles both cases.

The repository also includes agent skills (skills/) that teach AI coding agents to investigate with the CLI. In Claude Code:

claude plugin marketplace add .
claude plugin install validin@validin

Did this page help you?