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-sdkTo install it as a standalone tool, isolated from your other Python packages, use pipx:
pipx install validin-sdkCheck it works:
validin versionTo upgrade: pip install --upgrade validin-sdk (or pipx upgrade validin-sdk).
Setup
validin setupsetup 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:
- Command-line flag:
--api-key,--endpoint - Environment variable:
VALIDIN_API_KEY,VALIDIN_BASE_URL - Config file:
~/.validin/config.json - Default endpoint:
https://app.validin.com
Verify
validin pingping 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.bashor~/.validin/completion.zsh, and onesourceline is added to~/.bashrcor~/.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 --jsonPut 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 --helpGlobal options
Lookup and management commands accept these options after the command or subcommand.
| Option | Description |
|---|---|
-o, --output FORMAT | table, 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. |
--json | Shorthand for -o json. |
--api-key KEY | API key for this command. |
--endpoint URL | API base URL for this command. |
-h, --help | Show help. |
Indicators
Lookup commands take one or more indicators. The type is inferred:
| Value | Type |
|---|---|
203.0.113.7, 2001:db8::1 | IP |
203.0.113.0/24 | CIDR |
| 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 labels | domain |
| anything else | string |
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 SERVERAn 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 dnsWhen 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
| Option | Description |
|---|---|
--limit N | Maximum 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 N | Only records seen in the last N days. |
--first-seen YYYY-MM-DD | Only records first seen on or after this date. |
--last-seen YYYY-MM-DD | Only 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
| Format | Output | Use for |
|---|---|---|
table | Aligned columns for the most useful fields. A result count and any notes go to stderr. | Reading in a terminal. |
json | The full envelope. Indented on a terminal, one compact line in a pipe. | jq, scripts, agents. |
jsonl | One result object per line, no envelope. | Streaming, large results, line-oriented tools. |
csv | One result per row with a header. Nested values are JSON-encoded. | Spreadsheets, pandas. |
list | One 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": []
}| Field | Description |
|---|---|
command | The command that ran. |
query | The indicators and options that were sent. |
count | Number of results. |
truncated | true if the API capped any part of the result. Raise --limit or narrow the query. |
results | One object per record. DNS rows have a key, type and value. See validin commands --json for fields used by other commands. |
errors | Per-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
| Code | Meaning |
|---|---|
0 | Success, including zero results. |
1 | API or network error (or every indicator failed). |
2 | Invalid arguments or input. No request was made. |
3 | Missing or rejected API key. |
4 | Rate limited or quota exhausted (after retries). |
5 | Partial result. Check the records and errors. |
Error codes
| Code | Meaning |
|---|---|
usage_error | Bad arguments. |
invalid_indicator | A value couldn't be parsed. |
unsupported_indicator | The command doesn't accept this indicator type. |
no_api_key | No key in flags, environment, or config. |
auth_failed | The key was rejected. |
forbidden | The key can't access this resource or feature. |
not_found | Nothing exists for this indicator or id. |
bad_request | The API rejected the request. |
rate_limited | Too many requests, or quota exhausted. |
timed_out | An open-directory search returned incomplete results. |
connection_failed | The CLI couldn’t connect to the endpoint. |
timeout | The request or wait timed out. |
server_error | The API returned a 5xx error. |
not_interactive | validin 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...
validin dns INDICATOR...DNS resolution history (A, AAAA, NS, CNAME, ...) for domains, IPs, CIDRs, or strings.
| Option | Description |
|---|---|
--extra | Extra record types instead: TXT, MX, SOA, SRV, HTTPS, ... |
--ptr | Reverse DNS (PTR) history instead. |
--types A,AAAA,NS | Only these record types. |
--exclude-nx | Drop NXDOMAIN observations. |
--wildcard | Include subdomains of a domain, or substring-match a string. |
--annotate | Add reputation intel (key_intel, value_intel) to each result. |
--limit, --lookback, --first-seen, --last-seen | See 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)
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...
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
validin lookalikes TARGETNewly registered domains that resemble a target domain. TARGET is a domain such as acme.com, or a /regex/.
| Option | Description |
|---|---|
--lookback N | Newly observed in the last N days (1–90, default 3). |
--similarity N | Maximum edit distance (0–4, default 2). Not for regex targets. |
--depth | labels, subdomains, or fqdns. |
--exclude VALUE | Domains or keywords to leave out. Repeatable or comma-separated. |
--limit N | Up to 250. |
-o list prints the lookalike domains.
validin crawl INDICATOR...
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...
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...
validin registration INDICATOR...WHOIS/RDAP registration history, or a live registry lookup.
| Option | Description |
|---|---|
--live | Query 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|whois | Live protocol (default rdap). |
--raw | Live lookup. Read the registry response in .results[].raw.rdap or .results[].raw.whois with --json. |
--wildcard | History: include subdomains. |
--field FIELD | History: 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-seen | As 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...
validin content HASH...What a hash points at.
--kind | Hash | Returns |
|---|---|---|
html (default) | SHA-1 body hash | The HTML, its plain text, loaded resources, and referenced hosts. |
cert | SHA-1 certificate fingerprint | PEM, subject, issuer, and validity. |
favicon | MD5 | The 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...
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.
| Indicator | Where it was seen |
|---|---|
| Domain | Pages linking to it (ANCHORS_LINKS, JS_LINKS, LINKS_LINKS), certificates naming it (CERT_DOMAIN), redirects to it (LOCATION_DOMAIN). |
| Hash | Hosts that served it (BODY_SHA1, HEADER_HASH, CERT_FINGERPRINT, ...). |
| String | Hosts whose server banner, title, or certificate fields contain it (SERVER, TITLE, CERT_O, ...). |
| IP or CIDR | Hosts 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. |
| Option | Description |
|---|---|
--category NAME | Only 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. |
--wildcard | Include subdomains of a domain. |
--annotate, --limit, --lookback, --first-seen, --last-seen | As 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...
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...
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.
| Subcommand | Description |
|---|---|
list | Every 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...
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.
| Option | Description |
|---|---|
--dry-run | Validate 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.
| Subcommand | Description |
|---|---|
lookup INDICATOR... | Open directories crawled on a domain, IP, or CIDR, newest first. Options: --wildcard, --annotate, --limit, time window. |
query QUERY | Search 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 URL | Every 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 ID | List 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 ID | Metadata for one crawl, directory, or file. |
get FILE -O PATH | Download 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 getonly 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.
| Subcommand | Description |
|---|---|
list | Projects you can see. |
show PROJECT | One project's details. |
create NAME | Create 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 --yes | Delete a project and everything in it. Requires --yes. |
indicators PROJECT | Indicators 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 PROJECT | Alerts for the newest alert day, or --date YYYY-MM-DD. --dates lists the days that have alerts. |
alert-prefs PROJECT | Show 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 PROJECT | Live scans linked to the project. |
members PROJECT | Members 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 LEVEL | Change a member's level (enterprise). |
resources PROJECT | Reference links and notes. |
resource-add PROJECT URL | Save a link. --note. |
resource-note PROJECT URL NOTE | Replace 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.
| Subcommand | Description |
|---|---|
list | Rules in the project. |
show RULE | Versions, 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 --yes | Delete a rule with all versions, runs, and matches. |
matches RULE | Content 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 RULE | Scan up to 168 hours of history. --hours (1–168, default 1), --version, --notify none|alert|alert_and_email, --source virtual_host|ip4 (repeatable). |
cancel RULE | Cancel running retrohunts, or only --run-id. |
track RULE | Match new content as it's crawled. --version, --source. |
untrack RULE | Stop live matching. |
Live scans
validin scan SUBCOMMAND
| Subcommand | Description |
|---|---|
start URL | Fetch 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_ID | Current status. |
results SCAN_ID | Responses, certificates, redirects, and hashes. --wait, --timeout. |
link SCAN_ID -p PROJECT | Link a scan to a project, or --remove to unlink it. |
Bulk searches
validin bulk SUBCOMMAND manages bulk searches started in the Validin web app.
| Subcommand | Description |
|---|---|
list | Your bulk searches, newest first. --status queued|running|done|failed|killed (repeatable). |
status JOB | State, progress, and per-source result counts. |
edit JOB | Set --name (up to 128 characters) or --description (up to 1024). An empty name restores the default. |
kill JOB | Stop a queued or running search. Results so far are kept. |
Account and tooling
| Command | Description |
|---|---|
validin setup | Save an API key, endpoint and default output format, and set up tab completion. Interactive. |
validin ping | Check the connection and API key. Show the active configuration. |
validin usage | Quota used, limit, and remaining, today and this month. --by-path gives one row per metered API path. |
validin version | Installed validin-sdk version. |
validin commands | Every 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@validinUpdated about 8 hours ago
