Skip to main content
Search operators are special commands you embed directly inside the q parameter value. They act as surgical filters that tell Google precisely where to look — restricting results to a specific domain, a particular file format, pages whose titles contain a keyword, and more. Unlike the separate API parameters (exactTerms, siteSearch, fileType), search operators live inside the query string itself, which makes them ideal for dynamically constructed queries and power-user search experiences.

How search operators work

You append an operator to your query string in the format operator:value — no spaces between the colon and the value. You can mix operators freely with regular keywords and boolean logic in the same q value.
Not all operators are officially documented as supported by the Custom Search JSON API in all configurations. site:, filetype:, intitle:, inurl:, and intext: have the broadest support. Results from related:, cache:, and link: may be inconsistent or return no results depending on your engine’s scope and the query. Test each operator with your specific engine configuration.

Operator reference

site: — Restrict to a domain or subdomain

Returns only results from the specified domain, subdomain, or URL prefix. This is the most commonly used search operator.
Use site: inline when you need per-query domain scoping on top of an engine that already searches the full web. For permanent domain restrictions, configure sites in the Programmable Search Engine Control Panel and use the siteSearch API parameter instead — it is more reliable.

filetype: — Restrict to a file type

Returns only documents with the specified file extension. Useful for surfacing PDFs, spreadsheets, presentations, and other non-HTML documents.
Commonly supported file types: pdf, doc, docx, xls, xlsx, ppt, pptx, txt, rtf, csv, xml, json
You can achieve the same effect using the dedicated fileType API parameter: &fileType=pdf. The API parameter is generally more reliable than the inline operator for programmatic use. Use the inline operator when you want to let users type it directly into a search box.

intitle: — Require a word in the page title

Returns only pages whose HTML <title> tag contains the specified word.
allintitle: — All listed words must appear in the title (alternative form):

inurl: — Require a word in the URL

Returns only pages whose URL contains the specified string. This is particularly effective for targeting blog posts, documentation paths, and structured URL schemes.
allinurl: — All listed words must appear in the URL:

intext: — Require a word in the page body

Returns only pages whose body text contains the specified word. Because most searches already look at body text, intext: is most useful when you want to ensure a specific technical term actually appears in the content rather than just in metadata or links.
allintext: — All listed words must appear in the body text:

Returns pages that Google considers topically similar to the specified URL. This is most effective with well-known, high-traffic domains.
related: works best as a standalone operator without additional keywords. Results depend entirely on Google’s internal page similarity scores and may be limited or absent for less prominent sites.

cache: — Retrieve Google’s cached version info

Returns the Google-cached version of a URL. In the API context, this appears as search results linking to Google’s cache of the specified page rather than performing a keyword search.
cache: is primarily a browser/search UI concept. In the Custom Search JSON API, its behavior may vary — the returned result links to Google’s cached snapshot if one exists. Do not rely on this operator for production cache-fetching workflows.

Returns pages that contain at least one link to the specified URL. Note that Google has substantially reduced the scope of link: results in recent years, so results may be sparse.

Combining operators

You can stack multiple operators and keywords in a single q value. Each additional operator narrows the result set further.

Full operator reference table


Operators vs. dedicated API parameters

Some operators have direct API-parameter equivalents. When generating queries programmatically, prefer the dedicated parameter — it is more explicit and easier to validate.