Daily anomalies (weekday-robust)
detect_anomaliesFlags days in the period whose clicks (or impressions, ctr, position) deviate from what the same weekday did in the previous baselineWeeks weeks (default 8): expected = median of those weekdays, scale = scaled MAD, zScore = (value − expected) / scale; anomaly when |z| >= threshold (sensitivity low 4, medium 3, high 2.5). Robust to outliers in the baseline and to the weekly cycle (weekends are compared with weekends). Each anomaly has direction (drop/spike; for position, drop = visibility loss), severity, deviationPct and the baseline size. Use for "did anything unusual happen", to date a drop before looking at causes (get_annotations), or to check a release day. / Dias anômalos comparados com o mesmo dia da semana nas semanas anteriores.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Window length in days (default 28). Ignored when startDate and endDate are both given. / Janela em dias. | |
| site | Yes | Property: displayName ("example.com"), Search Console siteUrl ("sc-domain:example.com", "https://www.example.com/") or numeric id. A unique substring among visible properties also works ("exam"). list_sites shows the options. The value "demo" selects a demonstration site with fictional data: it works without signing in and is read-only. / Propriedade por nome, siteUrl ou id; "demo" é um site de demonstração com dados fictícios, sem login e só leitura. | |
| brand | No | all (default); branded = only queries containing one of the property's branded_terms; non-branded = the rest. Needs branded terms set on the property in the Organiq panel, otherwise invalid_argument with the panel URL. / Marca × sem marca. | |
| query | No | Only queries containing this text, or a regex as /…/ (e.g. "/^how to/"; no flag = case-insensitive). | |
| device | No | Device. | |
| metric | No | Metric (default clicks). | |
| country | No | Country as ISO-3166-1 alpha-3, as in Search Console: bra, usa, prt, arg. | |
| endDate | No | End yyyy-mm-dd. Default: last synced date of the property (Search Console lags ~3 days; never "today"). Every response states the period used. / Fim; padrão = última data sincronizada. | |
| startDate | No | Start yyyy-mm-dd. Default: endDate − (days − 1). | |
| searchType | No | Search type (default web). | |
| sensitivity | No | low = only extreme, medium (default), high = more alerts. | |
| pageContains | No | Only pages whose URL contains this text (case-insensitive), e.g. "/blog/". | |
| baselineWeeks | No | Weeks of same-weekday history used as baseline (default 8). |