Command reference
Each command lists its arguments, its flags, and the v2 API route it calls with its quota class. Routes are relative to https://api.urlquery.net/public/v2. urlquery-cli <command> --help shows the same arguments and flags.
--summary prints a short table instead of JSON; see Configuration and output.
Global flags
| Flag | Meaning |
|---|---|
--apikey | API key; default from URLQUERY_APIKEY or the config file. |
--base-url | API address; default https://api.urlquery.net. |
--output | Directory for downloaded files; default the current directory. |
-v, --version | Print the version. |
-h, --help | Help for any command. |
config
Saved settings, in ~/.urlquery-cli.yaml. Keys: apikey, base_url, output, access, useragent, device_type. No API calls.
| Command | Does |
|---|---|
config set <key> <value> | Save a setting. |
config show | Show the settings in effect; the API key is masked. |
config unset <key> | Remove a saved setting. |
submit
submit <url | ->
Submit a URL for analysis, or a list of URLs with - (standard input) or --file. Route: POST /submissions (submission_create), and GET /submissions/{queue_id} (submission_lookup) every 5 seconds with --wait; a check that fails on a quota answer, a server error or a network failure is repeated until --wait-timeout.
| Flag | Meaning |
|---|---|
--access | public, restricted or private; default the access setting, then public. |
--tags | Comma-separated tags, each 1–64 letters, digits or underscores; at most 20. |
--meta | key=value metadata only you and your team see; repeatable, at most 20. |
--useragent | User-Agent the browser sends. |
--device-type | desktop, mobile or tablet. |
--run-time | Seconds the page runs, 20–200 (default 26). |
--sanitize-url | Replace a base64-encoded email address at the end of the URL path with a placeholder. |
--wait | Wait until the analysis is done or failed. |
--wait-timeout | How long --wait waits; default 5m. |
--file | File with one URL per line (batch). |
--parallel | Batch: URLs submitted at the same time, 1–8; default 1. |
--max-quota-wait | Batch: longest wait for the submit quota before stopping; default 5m. |
--summary | Table output. |
See Submit a list of URLs for batch behaviour, and Submitting URLs for the options.
submit status <queue_id>
A submission's progress: queued, processing, analyzing, done or failed, with its report ID. Route: GET /submissions/{queue_id} (submission_lookup). Flags: --wait, --wait-timeout, --summary.
report
| Command | Does | Route (quota class) |
|---|---|---|
report overview <report_id> | The report's overview: URLs, IP, title, tags, settings, alerts and hosts. | GET /reports/{id}/overview (report_lookup) |
report get <report_id> | The full report document. | GET /reports/{id} (report_lookup) |
report screenshot <report_id> | Save the screenshot as <report_id>.png. | GET /reports/{id}/screenshot (report_lookup) |
report resource <report_id> <sha256> | Save captured content as <sha256>.bin; it may be malicious. | GET /reports/{id}/resources/{sha256}/content (report_lookup) |
report compare <report_a> <report_b> | What changed from A, the earlier or baseline, to B. | GET /reports/{a}/compare/{b} (report_lookup, counted twice) |
report diff <report_a> <sha256_a> <report_b> <sha256_b> | Unified diff of a text resource from A to B. | Two resource downloads (report_lookup each) |
report recent | Recent reports, newest first. | GET /reports/recent (report_collection) |
report related <ip|asn|domain> <value> | Recent reports for the same target IP, ASN or domain. | GET /reports/related (report_collection) |
report search <query> | Search the last year, in the search syntax. | GET /reports/search (report_search) |
report delete <report_id> | Delete a report you own; asks first. | DELETE /reports/{id} (report_lookup) |
| Flag | Commands | Meaning |
|---|---|---|
--summary | overview, compare, recent, related, search | Table output. |
--file | screenshot, resource | File to save to; - for standard output. |
--beautify | diff | Format minified JavaScript before diffing. |
--scope | recent | all (default: yours and the others your key may see), user, team, or alerted (reports from the last year your or your team's YARA rules matched). |
--limit | recent, related | Results per page; default from the API (25). |
--cursor | recent, related | Cursor from the previous page. |
--limit | search | Results per page, 1–100; default 25. |
--offset | search | Results to skip; --offset plus --limit at most 10,000. |
--yes | delete | Don't ask for confirmation. |
report related returns public reports, and for ip, also restricted ones when your account has restricted access. report diff needs text of at most 5 MiB and 20,000 lines on both sides, and shows at most 5,000 diff lines. See Comparing two reports.
reputation
| Command | Does | Route (quota class) |
|---|---|---|
reputation lookup <url> | urlquery's verdict for the URL over the last 30 days: malicious, suspicious, benign or unknown; applied_to says whether it is for the exact URL or its host name. | POST /reputation/lookup (reputation_lookup) |
reputation export | Every reputation indicator as NDJSON: a meta record, indicator records, and a complete record last. Without the complete record the export is incomplete; discard it. Needs the reputation_export capability. | GET /reputation/export (reputation_export) |
| Flag | Commands | Meaning |
|---|---|---|
--summary | lookup | Table output. |
--timeframe | export | How far back: a number followed by h or d, or all; default from the API. |
--type | export | Indicator type to include; repeatable; default all. |
--as-of | export | RFC 3339 time the export is evaluated at; default now. |
--file | export | File to save to; default standard output. |
host
Host Profile: what urlquery has observed about host names and IP addresses.
| Command | Does | Route (quota class) |
|---|---|---|
host get <host> | A host's profile: IPs, technologies, certificates, cookies, headers, MIME types, and relation counts. A host name, or an IP address pages were loaded from directly. | GET /hosts/{host} (host_lookup) |
host list --<pivot> <value> | Hosts sharing one fact. | GET /hosts (host_collection) |
host relations [host] | A host's relations, or relations across hosts. | GET /hosts/{host}/relations or GET /hosts/relations (host_collection) |
host search | Hosts by observation time and relation metrics. | GET /hosts/search (host_search) |
host get flags: --limit (entries per fact list; default from the API) and --summary.
host list takes exactly one pivot:
| Pivot | Value |
|---|---|
--domain | A registrable domain and its subdomains; --include-apex set to false leaves out the domain itself. |
--ip | An IP address. |
--asn | An AS number, such as 13335. |
--country | A two-letter country code. |
--technology | A technology name, such as WordPress. |
--certificate | A certificate SHA-256, or an issuer or subject organization or common name. |
--cookie | A cookie name; filter with --secure, --http-only, --partitioned, --host-only, --persistent (each true or false), --same-site (strict, lax, none or unspecified) and --path. |
--header | A response header name. |
--mime | A MIME type, type/subtype. |
host relations flags: with a host, --direction (incoming, outgoing or both); without one, --source and --target (a host name or IP). Both take --type (redirects_to, loads_from, calls or embeds).
host search flags: --first-seen-after, --first-seen-before, --last-seen-after, --last-seen-before (inclusive RFC 3339 times), --incoming-relation-type and --outgoing-relation-type (redirects_to, loads_from, calls or embeds), and the numeric filters --min-incoming-relation-count, --max-incoming-relation-count, --min-incoming-relation-ratio, --max-incoming-relation-ratio, --min-incoming-total, --max-incoming-total, and the same for outgoing: --min-outgoing-relation-count, --max-outgoing-relation-count, --min-outgoing-relation-ratio, --max-outgoing-relation-ratio, --min-outgoing-total, --max-outgoing-total. Relation count and ratio filters need the matching relation type.
host list, host relations and host search also take --sort (first_seen or last_seen; host search also the relation metrics), --order (asc or desc), --limit, --cursor and --summary.
yara
YARA rules scan every new analysis. Rule sources are read from a file, or standard input with -. Reads count as yara_read; writes, validate and test as yara_write.
| Command | Does | Route |
|---|---|---|
yara set list | The rule sets you can see. | GET /detection/yara/sets |
yara set get <set_id> | One rule set. | GET /detection/yara/sets/{id} |
yara set create <name> | Create a rule set. | POST /detection/yara/sets |
yara set update <set_id> | Change a set you own; fields you don't give keep their values. | GET, then PUT /detection/yara/sets/{id} |
yara set delete <set_id> | Delete a set and its rules; asks first. | DELETE /detection/yara/sets/{id} |
yara rule list <set_id> | The rules in a set. | GET /detection/yara/sets/{id}/rules |
yara rule get <rule_id> | A rule; --source prints only its source. | GET /detection/yara/rules/{id} |
yara rule create <set_id> <name> <file> | Create a rule from a source file. New rules are enabled. | POST /detection/yara/sets/{id}/rules |
yara rule update <rule_id> | Change a rule; fields you don't give keep their values. | GET, then PUT /detection/yara/rules/{id} |
yara rule delete <rule_id> | Delete a rule; asks first. | DELETE /detection/yara/rules/{id} |
yara rule stats <rule_id> | Matches, hosts, severities, top rules and matches per day. | GET /detection/yara/rules/{id}/stats |
yara rule matches <rule_id> | The reports a rule matched. | GET /detection/yara/rules/{id}/matches |
yara validate <file> | Check that a source compiles. | POST /detection/yara/validate |
yara test <file> <report_id> | Run a source against a report's final DOM, scripts and stored responses, without saving it. | POST /detection/yara/test |
| Flag | Commands | Meaning |
|---|---|---|
--name | set update, rule update | New name. |
--description | set create, set update, rule create, rule update | Description. |
--visibility | set create, set update, rule create, rule update | Who sees it: private or team. |
--alert-visibility | rule create, rule update | Who sees its matches: private or team. |
--can-team-edit | rule create, rule update | Let teammates change a team rule. |
--file | rule update | New source file; - for standard input. |
--enabled | rule update | false switches the rule off, true on. |
--source | rule get | Print only the source. |
--days | rule stats | Days to look back, 1–90; default 30. |
--days | rule matches | Days to look back, 1–730; default every stored match. |
--limit, --cursor | rule matches | Paging. |
--yes | set delete, rule delete | Don't ask for confirmation. |
--summary | all but deletions | Table output. |
See Testing YARA rules for what a test scans.
monitoring
Watchlists and page monitors, yours and your team's. Reads count as monitoring_read, changes as monitoring_write. Routes are under /monitoring.
Watchlists
| Command | Does | Route |
|---|---|---|
monitoring watchlist list | Your watchlists. | GET /monitoring/watchlists |
monitoring watchlist get <watchlist_id> | One watchlist. | GET /monitoring/watchlists/{id} |
monitoring watchlist create <name> [indicator…] | Create a watchlist with indicators. | POST /monitoring/watchlists; past 500 indicators, also POST …/indicators per 500 and GET the watchlist |
monitoring watchlist add <watchlist_id> [indicator…] | Add indicators. | POST /monitoring/watchlists/{id}/indicators, once per 500 |
monitoring watchlist indicators <watchlist_id> | List its indicators. | GET /monitoring/watchlists/{id}/indicators |
monitoring watchlist remove <watchlist_id> <kind> <value> | Remove an indicator; the reports it matched stay listed. | DELETE /monitoring/watchlists/{id}/indicators |
monitoring watchlist reports <watchlist_id> | The reports it matched, newest first. | GET /monitoring/watchlists/{id}/reports |
monitoring watchlist stats <watchlist_id> | Activity over 7, 30 or 90 days. | GET /monitoring/watchlists/{id}/stats |
monitoring watchlist update <watchlist_id> | Rename, pause or resume. | PATCH /monitoring/watchlists/{id} |
monitoring watchlist delete <watchlist_id> | Delete it, its indicators and its reports list; asks first. | DELETE /monitoring/watchlists/{id} |
Indicators are SHA256 hashes, IPs, domains (which also match their subdomains), FQDNs, URLs, or URL patterns with * such as */gate.php; defanged values are accepted. Give them as arguments or with --file (whitespace separated; - for standard input); they are sent 500 at a time. Values not added are listed under skipped with why: invalid, exists, or limit. The kind for remove is sha256, ip, domain, fqdn, url or url_pattern.
| Flag | Commands | Meaning |
|---|---|---|
--file | create, add | File of indicators; - for standard input. |
--name | update | New name. |
--enabled | update | false pauses the watchlist, true resumes it. |
--days | stats | 7, 30 or 90; default 30. |
--limit, --cursor | reports | Paging. |
--yes | delete | Don't ask for confirmation. |
--summary | all but remove and delete | Table output. |
Page monitors
| Command | Does | Route |
|---|---|---|
monitoring page list | Your page monitors. | GET /monitoring/pages |
monitoring page get <monitor_id> | One page monitor. | GET /monitoring/pages/{id} |
monitoring page create <report_id> | Rescan the report's URL on a schedule, compared with the report. The first scan runs within a minute. | POST /monitoring/pages |
monitoring page update <monitor_id> | Change, pause or resume; flags you don't give keep their values, and a list flag replaces the list. | PATCH /monitoring/pages/{id} |
monitoring page runs <monitor_id> | The latest scans and how they differ from the baseline. | GET /monitoring/pages/{id}/runs |
monitoring page baseline <monitor_id> <report_id> | Make another report of the same URL the baseline. | POST /monitoring/pages/{id}/baseline |
monitoring page delete <monitor_id> | Delete the monitor and its runs; the reports are kept; asks first. | DELETE /monitoring/pages/{id} |
| Flag | Commands | Meaning |
|---|---|---|
--name | create, update | Name; default the report's title. |
--interval | create, update | hourly, 6h, daily or weekly; a new monitor defaults to daily. |
--access | create, update | Access of the scans' reports: public, restricted or private. |
--checks | create, update | Page checks: redirect, http_status, new_hosts, certificate, new_detections. |
--new | create, update | Resource types whose new URLs count: script, style, image, font, media, frame. |
--changed | create, update | type=level of changed content that counts, such as page=moderate,script=minor; levels exact, minor, moderate, major. page can't be exact, and image, font and media can only be exact. |
--scope | create, update | site compares the site's own resources, all every resource. |
--ignore | create, update | Resource URLs never compared: http or https URLs that name a host, with * for any text, such as https://www.google-analytics.com/*; '' clears the list. |
--only | create, update | The only resource URLs compared: exact URLs, without *. |
--enabled | update | false pauses the monitor, true resumes it. |
--limit | runs | Runs to show; default from the API. |
--yes | delete | Don't ask for confirmation. |
--summary | all but delete | Table output. |
Every scan of a page monitor is a submission on your account.
completion
urlquery-cli completion bash|zsh|fish|powershell prints a shell completion script; see Shell completion.