SOAR platforms
A playbook that handles reported emails or URL alerts can ask urlquery what a link does before anyone opens it. This page gives the steps in two forms: one Python action, for platforms that run scripts, and the HTTP calls behind it, for platforms that chain HTTP requests. Neither depends on a particular platform.
The playbook
URL from an alert or a reported email
│
├─ 1. A report of the URL from the last 7 days? ── yes ─┐
│ no │
├─ 2. Analyze it as a restricted report │
├─ 3. Wait for the analysis, up to a few minutes │
│ not finished → keep the IDs, check again later │
│ │
└─ 4. Overview and verdict ◄─────────────────────────────┘
│
├─ block malicious verdict, or a phishing or malware alert
├─ review suspicious verdict, or any other alert
└─ no_evidence nothing found in this visit
The decision comes from urlquery's verdict for the URL over the last 30 days and the urlquery alerts in the report:
| Verdict | urlquery alerts in the report | Decision |
|---|---|---|
malicious | any, or none | block |
suspicious, benign or unknown | a phishing or malware alert | block |
suspicious | other alerts, or none | review |
benign or unknown | other alerts | review |
benign or unknown | none | no_evidence |
| Decision | Typical actions |
|---|---|
block | Block the URL and its host at the proxy or mail gateway, remove the email from mailboxes, and open a case with the report link and screenshot. |
review | Give an analyst a task with the report, the screenshot and the alerts. |
no_evidence | Close or lower the alert, with the report linked. This doesn't mean safe: the page may cloak, or change later. |
Choose what blocks automatically for your environment. A compromised legitimate site, a shared host or a URL shortener can carry a phishing verdict while serving other content; blocking a whole host can hurt.
As a Python action
urlquery_enrich_url.py runs steps 1 to 4 with the Python library and prints one JSON object. Run it as a script action, or import find_or_analyze and decide into the platform's own Python action.
pip install urlquery-api
export URLQUERY_APIKEY='<urlquery API key>'
python urlquery_enrich_url.py 'https://login.example.com/verify' --case 1234
echo '{"url": "https://login.example.com/verify", "case": "1234"}' | python urlquery_enrich_url.py -
{
"decision": "block", "verdict": "malicious",
"report_id": "…", "report_url": "https://urlquery.net/report/…",
"date": "2026-11-29T08:18:26+00:00",
"final_url": "https://login.example.com/verify", "title": "Instagram",
"ip": "192.0.2.10", "asn": 64500, "as": "Example Hosting", "country": "HK",
"alerts": [{"severity": "medium", "verdict": "phishing", "alert": "Phishing - Instagram", "host": "login.example.com"}],
"tags": ["phishing", "instagram", "telegram_bot"]
}
| Exit status | Output | What to do |
|---|---|---|
| 0 | The decision | Act on it. |
| 3 | {"decision": "pending", "queue_id": …, "report_id": …} | The analysis is still running. Store the report ID in the case and run the action again later with --report <report_id>. Don't submit the URL again. |
| 2 | {"error": …} | A failure, such as a bad API key, an invalid URL or no network. Raise it to an analyst. With no JSON and a usage message on standard error instead, the action's arguments are wrong. |
| 1 | A traceback on standard error | An unexpected error in the script. Raise it to an analyst; the URL may have been submitted, so search for it before you run the action again. |
--case tags a new analysis with case_<id>, so submit.tags:case_1234 finds every report of the case. --timeout (default 240 seconds) bounds the wait, and --max-age (default 7 days) how old a reused report may be.
As HTTP steps
The same steps with any HTTP client. Every request sends the API key in the x-apikey header to https://api.urlquery.net/public/v2, and every answer has the result in data.
1. Find a recent report. Search for the URL without its scheme, in quotes:
curl -s --get -H "x-apikey: $URLQUERY_APIKEY" \
--data-urlencode 'query=url.addr:"login.example.com/verify" AND date:[now-7d TO now]' \
--data-urlencode 'limit=1' \
https://api.urlquery.net/public/v2/reports/search | jq '.data.items[0].report_id'
2. Analyze the URL when there is none:
curl -s -H "x-apikey: $URLQUERY_APIKEY" -H 'content-type: application/json' \
-d '{"url": "https://login.example.com/verify", "access": "restricted", "tags": ["case_1234"]}' \
https://api.urlquery.net/public/v2/submissions | jq '.data | {queue_id, report_id}'
Store both IDs in the case as soon as this returns.
3. Wait. Poll the submission every 5 to 10 seconds until status is done or failed. An analysis usually takes about a minute.
curl -s -H "x-apikey: $URLQUERY_APIKEY" \
https://api.urlquery.net/public/v2/submissions/<queue_id> | jq '.data.status'
4. Read the result. The overview has the final URL, title, IP, tags and alerts; the reputation lookup has the verdict; the screenshot is a PNG for the case.
curl -s -H "x-apikey: $URLQUERY_APIKEY" https://api.urlquery.net/public/v2/reports/<report_id>/overview \
| jq '.data | {final: .final.url.addr, title: .final.title, ip: .ip.addr, tags,
alerts: [.detection.urlquery[] | {severity, verdict, alert}]}'
curl -s -H "x-apikey: $URLQUERY_APIKEY" -H 'content-type: application/json' \
-d '{"url": "https://login.example.com/verify"}' \
https://api.urlquery.net/public/v2/reputation/lookup | jq '.data.verdict'
curl -s -H "x-apikey: $URLQUERY_APIKEY" -o screenshot.png \
https://api.urlquery.net/public/v2/reports/<report_id>/screenshot
Errors and retries
429. A quota or rate limit. Wait for theRetry-Afterheader's seconds and send the same request again; nothing was processed.5xxon a GET. Retry a few times, with a growing delay.5xxon the submission. Don't retry it: the URL may already be queued. Search for it again in a minute.- Waiting too long. When a wait gives up, keep the IDs and check the submission again from a later step or a scheduled job.
404on a report. The report doesn't exist, or your key can't see it.
See Errors and the Submission API.
Push alerts by webhook
The steps above pull: the playbook asks about a URL when an alert reaches it. urlquery can also push. A webhook channel sends a signed JSON message when one of your YARA rules matches a new report, a watchlist sees one of its indicators, or a page monitor sees a change, so a playbook can start from urlquery's side.
- In your SOAR platform, create a webhook trigger, and note its URL. Most platforms call it a webhook, HTTP or "incoming" trigger.
- On urlquery.net, under Settings → Notifications, add a Webhook channel with that URL, and choose the kinds:
yara.match,monitor.indicator_seenandmonitor.page_changedare the usual ones. - Store the channel's signing secret in the platform's credentials, and verify the signature as the playbook's first step. Reject the request when it fails.
- Drop repeats by the message's
id; a message can arrive twice. - Read what you need from
data. A YARA match carries thereport_id, the report'surlandip, and each matched rule'salert,severityandverdict; a watchlist hit carries thereport_idand the matched indicators. - For more, call the API with the
report_id, as in step 4 above, or run the action with--report <report_id>.
A webhook trigger usually has to answer within seconds, and urlquery waits at most 10. Let the trigger answer at once, then run the enrichment in the playbook.
Before you go live
- Quota. Each analysis and each poll counts against your account's quotas. Reusing recent reports, and polling every 5 to 10 seconds instead of every second, keeps a busy mailbox within them.
- Visibility. URLs from reported emails can carry the recipient's address or a token. Keep analyses
restrictedorprivate, and consider"sanitize_url": true; see Safe use. - The screenshot and content are hostile. Show the screenshot to analysts; don't open the URL or captured files outside an isolated environment.