Skip to main content
The ruleContexts parameter lets you specify which contextual rules to activate for a given search query. A rule context is a string that acts as a trigger for rules with the same context string. Contexts define the conditions under which a rule applies. For an example, see Customize search results by platform.

Usage

  • Contexts must contain only alphanumeric characters, hyphens, or underscores.
  • If ruleContexts is empty, only non-contextual rules are considered.
  • You can pass up to 10 contexts in a single query.

Example

Current API clients

Last modified on May 19, 2026