> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uptimeio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Keyword Monitoring

> Check that web pages and API responses contain the text you expect, and do not contain text you forbid

A keyword monitor makes the same HTTP request as an [HTTP monitor](/monitors/http) and then checks the response body for text. Use it to confirm a page shows the right content, to catch error messages that are served with a `200` status, or to detect defacement.

## When to use it

* Confirm "Welcome" or "Sign in" appears on your homepage
* Check that an API response contains `"status":"ok"`
* Alert when an error message such as `Database connection failed` appears
* Detect unwanted text such as `hacked by` or `Out of stock`

## Create a keyword monitor

<Steps>
  <Step title="Set the basics">
    Enter the **Website URL**, **Check Interval** and **Timeout** exactly as for an HTTP monitor. See [HTTP settings](/monitors/http#settings).
  </Step>

  <Step title="Add keywords">
    In **Keyword Configuration**, type the text, choose **Contains** or **Excludes**, and click **Add**. Click the **contains** / **excludes** tag on a keyword to switch it.
  </Step>

  <Step title="Choose matching rules">
    With more than one keyword, pick **Match all** or **Match any**. Use the **Case sensitive** switch if letter case matters.
  </Step>
</Steps>

### Settings

| Setting | What it does | Default / options |
| - | - | - |
| **Keywords** | Text to look for in the response. Up to 20 keywords, each up to 500 characters | At least one is required |
| **Contains / Excludes** | **Contains**: the text must be in the response. **Excludes**: the check fails if the text is in the response | Contains |
| **Match all / Match any** | How several **Contains** keywords combine. Shown when you have more than one keyword | Match all |
| **Case sensitive** | Match letter case exactly. Applies to all keywords | Off |

The request itself (method, expected status, headers, request body, redirects, timeout) is configured under **HTTP Configuration** and works as on [HTTP monitors](/monitors/http#settings), including the default that **only status `200` passes** unless you change **Expected Status**. Use a method that returns a body: `HEAD` has nothing to search.

### Example

* **Website URL**: `https://www.yourcompany.com`
* **Keywords**: **Contains** `Welcome to YourCompany`, **Excludes** `Database connection failed`
* **Match all**, **Case sensitive** off

## How matching works

1. The HTTP request is checked first (status code, timeout, TLS).
2. The keywords are checked against the **response body**.

| Keyword type | Check fails when |
| - | - |
| Contains | **Match all**: any such keyword is missing. **Match any**: none of them is present. |
| Excludes | **Any** such keyword is present. Match all / any does not apply. |

Matching is plain text matching. Regular expressions are not supported: add a separate keyword for each phrase.

<Warning>
  Only the response body is searched, not the response headers.
</Warning>

## Case sensitivity

| Case sensitive | Example |
| - | - |
| Off (default) | `error` matches `Error` and `ERROR` |
| On | `Error` matches only `Error` |

## Examples

| Keywords | Result |
| - | - |
| **Excludes** `Out of stock` | Alerts when a product page says it is out of stock. |
| **Contains** `"status":"ok"`, with **Case sensitive** on | Alerts when the API stops returning the success indicator. |
| **Contains** `Sign in` and **Contains** `Log in`, with **Match any** | Passes when either phrase is on the page. |

## SSL, domain expiry and slow responses

Keyword monitors support the same options under **SSL, domain & performance alerts** as HTTP monitors:

* [SSL certificate monitoring](/monitors/http#ssl-certificate-monitoring): warnings at 30, 15, 7 and 1 days; an expired or invalid certificate opens an incident.
* [Domain expiry monitoring](/monitors/http#domain-expiry-monitoring)
* [Slow response alerts](/monitors/http#slow-response-alerts)

## Best practices

* Choose text that is stable and specific. `Database connection timeout` beats `Error`.
* Monitor a lightweight endpoint. The whole response body is downloaded and searched.
* Test your keywords against the real page source before relying on them.
* Remember that UptimeIO sees the HTML your server returns, not content rendered later by JavaScript.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Keyword reported missing but it is on the page">
    Check spelling and the **Case sensitive** switch. View the page source (not the rendered page): content added by JavaScript is not in the response. If the content depends on cookies or the user agent, the monitor may receive a different page.
  </Accordion>

  <Accordion title="False alarms from a must-not-contain keyword">
    The phrase may also appear in navigation, scripts or comments. Use a more specific phrase.
  </Accordion>

  <Accordion title="Cannot save the monitor">
    Add at least one keyword (up to 20, each up to 500 characters), and use a method other than `HEAD`.
  </Accordion>

  <Accordion title="Check fails on status code">
    Only `200` passes unless you add other codes to **Expected Status** under **HTTP Configuration**.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="HTTP Monitoring" icon="globe" href="/monitors/http">
    All request options
  </Card>

  <Card title="Notifications" icon="bell" href="/notifications/overview">
    Configure alerts for keyword monitors
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.