Skip to main content

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​

FlagMeaning
--apikeyAPI key; default from URLQUERY_APIKEY or the config file.
--base-urlAPI address; default https://api.urlquery.net.
--outputDirectory for downloaded files; default the current directory.
-v, --versionPrint the version.
-h, --helpHelp for any command.

config​

Saved settings, in ~/.urlquery-cli.yaml. Keys: apikey, base_url, output, access, useragent, device_type. No API calls.

CommandDoes
config set <key> <value>Save a setting.
config showShow 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.

FlagMeaning
--accesspublic, restricted or private; default the access setting, then public.
--tagsComma-separated tags, each 1–64 letters, digits or underscores; at most 20.
--metakey=value metadata only you and your team see; repeatable, at most 20.
--useragentUser-Agent the browser sends.
--device-typedesktop, mobile or tablet.
--run-timeSeconds the page runs, 20–200 (default 26).
--sanitize-urlReplace a base64-encoded email address at the end of the URL path with a placeholder.
--waitWait until the analysis is done or failed.
--wait-timeoutHow long --wait waits; default 5m.
--fileFile with one URL per line (batch).
--parallelBatch: URLs submitted at the same time, 1–8; default 1.
--max-quota-waitBatch: longest wait for the submit quota before stopping; default 5m.
--summaryTable 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​

CommandDoesRoute (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 recentRecent 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)
FlagCommandsMeaning
--summaryoverview, compare, recent, related, searchTable output.
--filescreenshot, resourceFile to save to; - for standard output.
--beautifydiffFormat minified JavaScript before diffing.
--scoperecentall (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).
--limitrecent, relatedResults per page; default from the API (25).
--cursorrecent, relatedCursor from the previous page.
--limitsearchResults per page, 1–100; default 25.
--offsetsearchResults to skip; --offset plus --limit at most 10,000.
--yesdeleteDon'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​

CommandDoesRoute (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 exportEvery 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)
FlagCommandsMeaning
--summarylookupTable output.
--timeframeexportHow far back: a number followed by h or d, or all; default from the API.
--typeexportIndicator type to include; repeatable; default all.
--as-ofexportRFC 3339 time the export is evaluated at; default now.
--fileexportFile to save to; default standard output.

host​

Host Profile: what urlquery has observed about host names and IP addresses.

CommandDoesRoute (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 searchHosts 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:

PivotValue
--domainA registrable domain and its subdomains; --include-apex set to false leaves out the domain itself.
--ipAn IP address.
--asnAn AS number, such as 13335.
--countryA two-letter country code.
--technologyA technology name, such as WordPress.
--certificateA certificate SHA-256, or an issuer or subject organization or common name.
--cookieA cookie name; filter with --secure, --http-only, --partitioned, --host-only, --persistent (each true or false), --same-site (strict, lax, none or unspecified) and --path.
--headerA response header name.
--mimeA 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.

CommandDoesRoute
yara set listThe 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
FlagCommandsMeaning
--nameset update, rule updateNew name.
--descriptionset create, set update, rule create, rule updateDescription.
--visibilityset create, set update, rule create, rule updateWho sees it: private or team.
--alert-visibilityrule create, rule updateWho sees its matches: private or team.
--can-team-editrule create, rule updateLet teammates change a team rule.
--filerule updateNew source file; - for standard input.
--enabledrule updatefalse switches the rule off, true on.
--sourcerule getPrint only the source.
--daysrule statsDays to look back, 1–90; default 30.
--daysrule matchesDays to look back, 1–730; default every stored match.
--limit, --cursorrule matchesPaging.
--yesset delete, rule deleteDon't ask for confirmation.
--summaryall but deletionsTable 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​

CommandDoesRoute
monitoring watchlist listYour 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.

FlagCommandsMeaning
--filecreate, addFile of indicators; - for standard input.
--nameupdateNew name.
--enabledupdatefalse pauses the watchlist, true resumes it.
--daysstats7, 30 or 90; default 30.
--limit, --cursorreportsPaging.
--yesdeleteDon't ask for confirmation.
--summaryall but remove and deleteTable output.

Page monitors​

CommandDoesRoute
monitoring page listYour 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}
FlagCommandsMeaning
--namecreate, updateName; default the report's title.
--intervalcreate, updatehourly, 6h, daily or weekly; a new monitor defaults to daily.
--accesscreate, updateAccess of the scans' reports: public, restricted or private.
--checkscreate, updatePage checks: redirect, http_status, new_hosts, certificate, new_detections.
--newcreate, updateResource types whose new URLs count: script, style, image, font, media, frame.
--changedcreate, updatetype=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.
--scopecreate, updatesite compares the site's own resources, all every resource.
--ignorecreate, updateResource 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.
--onlycreate, updateThe only resource URLs compared: exact URLs, without *.
--enabledupdatefalse pauses the monitor, true resumes it.
--limitrunsRuns to show; default from the API.
--yesdeleteDon't ask for confirmation.
--summaryall but deleteTable 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.