Configuration and output
Settings
| Setting | Flag | Environment variable | Config key | Default |
|---|---|---|---|---|
| API key | --apikey | URLQUERY_APIKEY | apikey | none; required |
| API address | --base-url | URLQUERY_BASE_URL | base_url | https://api.urlquery.net |
| Download directory | --output | URLQUERY_OUTPUT | output | the current directory |
| Submission visibility | submit --access | URLQUERY_ACCESS | access | the API's default, public |
| Submission User-Agent | submit --useragent | URLQUERY_USERAGENT | useragent | the API's default, a current desktop Firefox |
| Submission device | submit --device-type | URLQUERY_DEVICE_TYPE | device_type | the API's default, desktop |
A flag overrides the environment variable, which overrides the config file. The file is ~/.urlquery-cli.yaml, written readable only by you:
urlquery-cli config set apikey <your-api-key>
urlquery-cli config set access restricted
urlquery-cli config set output ~/urlquery-downloads
urlquery-cli config show # the settings in effect, with the key masked
urlquery-cli config unset output
For automation, prefer URLQUERY_APIKEY from your secret store over a config file, and never pass the key with --apikey where the command line is logged or shared.
Output
Every command prints the API's data as indented JSON on standard output, unchanged (monitoring watchlist create and add combine the answers for each 500 indicators into one result with the same fields), so the Report document and the API reference describe every field. Progress, prompts and errors go to standard error, so standard output stays valid JSON for jq and other tools.
--summary prints a short table instead, on the commands where one fits: lists, overviews, comparisons, submissions, statistics and test results. It shows the key fields only; use JSON to see everything. These have no summary: the full report (report get), report diff (which prints the diff), yara rule get --source, downloads, the reputation export, deletions, monitoring watchlist remove, and settings.
$ urlquery-cli report recent --limit 2 --summary
DATE REPORT ID ALERTS IP URL
2026-11-28 19:31:47 4c7eda2d-65eb-42ab-9a0b-a4b3531717c3 1 172.67.215.28 login.example.com/
2026-11-28 19:31:46 c0fe96ed-7c74-4b3d-b118-f600002b19be 0 104.21.35.60 example.net/
more: --cursor eyJ2IjoxLCJsaXN0Ijoi…
Hostile content on your terminal
Report content comes from the analyzed sites, and a page can plant escape sequences in its title, scripts or URLs that recolor, rewrite or hide what your terminal shows. When standard output or standard error is a terminal, the CLI shows control characters, invalid bytes and bidirectional overrides as visible escapes, such as \x1b or \u202e; line breaks and tabs are kept, so diffs and scripts keep their layout. In --summary tables, line breaks and tabs inside a value are escaped too, so a value can't add rows to the table. Output to a file or a pipe is passed on unchanged, so scripts get the exact data.
Downloads
report screenshot saves <report_id>.png and report resource saves <sha256>.bin, in the download directory, or where --file says; --file - writes to standard output. Captured resources come from the analyzed site and may be malicious, so they are saved without an extension that would open them. Don't open or run them outside an isolated environment. --file - to a terminal shows the content with control characters escaped; redirect it to a file to keep the exact bytes.
Paging
| Lists | How to page |
|---|---|
report recent, report related, host list, host relations, host search, yara rule matches, monitoring watchlist reports | Cursor pages: pass page.next_cursor from the JSON, or the more: --cursor … line of a summary, as --cursor, with the same other flags. A page can be short, or empty, while more remain; stop when page.has_more is false. |
report search | Offset pages: --limit (1–100, default 25) and --offset, up to 10,000 results in total. A page can hold fewer reports than page.total_hits suggests when a matching report was removed or changed access since it was indexed. |
monitoring page runs | The latest runs only: --limit, default 25, at most 100. |
| YARA sets and rules, watchlists and their indicators, page monitors | No paging; every item is returned. |
IDs
| Thing | Format | Example |
|---|---|---|
| Report, page monitor, watchlist | UUID | 4c7eda2d-65eb-42ab-9a0b-a4b3531717c3 |
| Submission (queue ID) | UUID | 672db9a7-3a06-48cf-b4bb-8369b844ea9a |
| YARA rule set and rule | 26-character ULID | 01JZX3FRVZETBJ8SKCDKXBJSRR |
| Resource | SHA-256 of its content | a0fec0856c1e97a1… |
A submission returns both its queue ID, for submit status, and the ID its report will have.
Errors and exit status
Errors print to standard error with the HTTP status, the API's error code and its message, and the exit status is 1:
Error: 404 NOT_FOUND: the requested resource was not found
Error: 429 RATE_LIMIT_EXCEEDED: rate limit exceeded (retry after 12s)
The exit status is 0 on success and 1 on any error, including a usage error, a batch submission in which any URL failed, and a --wait that timed out. Only batch submission retries on its own; see Batch submission. See Troubleshooting for what the common errors mean.
Scripting
-
Use JSON and
jq, not summaries: the JSON is stable API data, while summaries are for people and may change.# IDs of the newest reports your YARA rules matched.urlquery-cli report recent --scope alerted --limit 50 | jq -r '.items[].report_id'# Final URL and title of a report.urlquery-cli report overview "$id" | jq -r '[.final.url.addr, .final.title] | @tsv' -
Page through a list until
has_moreis false:cursor=""while :; dopage=$(urlquery-cli report recent --scope user --limit 100 ${cursor:+--cursor "$cursor"})echo "$page" | jq -c '.items[]'[ "$(echo "$page" | jq -r '.page.has_more')" = true ] || breakcursor=$(echo "$page" | jq -r '.page.next_cursor')done -
Deletes ask for confirmation and fail when nobody answers. In scripts, pass
--yes, and only for objects the script created. -
submit --waitexits 0 when the analysis ends, whether itsstatusisdoneorfailed: check.status. A status check that fails on a quota answer, a server error or a network failure is repeated, after theRetry-Afterfor a quota answer; other failures, such as404, end the wait. If--wait-timeout(default 5 minutes) passes first, or polling fails, it prints the last state it saw, with the queue and report IDs, and exits 1; the URL is still queued. -
Batch submission prints one JSON line per URL; see Submit a list of URLs.
-
Mind the quotas. Every call counts against your key's rate limits. Back off on
429for the time the error gives.
Shell completion
urlquery-cli completion bash > /etc/bash_completion.d/urlquery-cli # bash
urlquery-cli completion zsh > "${fpath[1]}/_urlquery-cli" # zsh
urlquery-cli completion fish > ~/.config/fish/completions/urlquery-cli.fish
urlquery-cli completion powershell | Out-String | Invoke-Expression # PowerShell, this session