Healthchecks
Keyword Checks
Check that a page contains, or doesn't contain, a piece of text.
Overview
A keyword check reads the response of an HTTP check and looks for a piece of text in it. Use it when a page can answer 200 OK and still be wrong: a shop without its Add to cart button, a login page without its form, a maintenance banner left on.
A keyword monitor is an HTTP monitor with a Response body check. There is no separate monitor type, so a keyword check sits next to the status code, JSON field, header and response time checks of the same monitor, and every check must pass for the monitor to be up.
Adding a keyword check
- In New healthcheck, pick HTTP(s) and enter the page's URL. For an existing HTTP monitor, open its Configuration.
- Under Checks, click + Keyword and type the text the page must contain.
- Choose regions and save.
Conditions
| Condition | The monitor is down when |
|---|---|
| contains | the text is missing from the response |
| does not contain | the text appears, e.g. Maintenance or Out of stock |
| matches regex | no part of the response matches the regular expression |
| does not match regex | some part of the response matches it |
Matching is case-sensitive. Tick Ignore case on the check to match any case. Regular expressions use the RE2 syntax: lookahead, lookbehind and backreferences aren't supported.
What the check reads
The check reads the HTML or JSON the server sends, after following redirects, up to the first 1 MiB. It doesn't run JavaScript: for text that only appears after scripts run, use a browser check.
When a check fails
The result and the incident list the failed checks, such as Response body contains “Add to cart”, next to the status code and timing of the request. As with every check, the monitor goes down once the failure is confirmed from the number of regions set under Alerting (a majority by default).
Config
Through the API, uptimyctl or the MCP server, a keyword check is a body assertion in the HTTP check's config:
{
"uri": "https://shop.example.com",
"assertions": [
{ "source": "status", "op": "eq", "value": 200 },
{ "source": "body", "op": "contains", "value": "Add to cart" },
{ "source": "body", "op": "not_contains", "value": "maintenance", "caseSensitive": false }
]
}With the MCP server, ask your assistant to add a keyword monitor; its add_monitors tool takes a keyword and keywordMode (contains or absent).