Web search
searchRuns web queries against a Google Programmable Search Engine, returning ranked results, snippets, metadata, and pagination. Supports language, country, date, site, and safety filters.
Instructions
Web search through your Google Programmable Search Engine (Custom Search JSON API). Returns query, total_results (Google's estimate — it can shrink while paging), search_time_seconds, corrected_query (spelling suggestion; results are still for the original query), next_start/previous_start page cursors, and items[] with title, url, display_link, snippet, mime/file_format and (with include_pagemap) pagemap metadata. Coverage is the engine's configuration: an engine listing specific sites searches only those; open-web search needs "Search the entire web" enabled in its control panel — results still differ from google.com. Max 10 results per call and 100 per query: paginate by passing next_start as start. Each call costs one unit of the daily quota (free tier 100/day), so prefer one precise query over many broad ones. Note: this is Programmable Search, NOT Google Search Console — it cannot report how your own site is indexed or ranked.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| num | No | Results per page, 1..10 (API maximum 10; default 10). | |
| safe | No | Safe search: active filters adult content, off (the API default) does not. | |
| sort | No | Sort expression, e.g. "date" for newest-first. Omit for relevance (usually better). | |
| query | Yes | The search query, Google syntax included (quotes, site:, filetype:, OR, -exclusions). | |
| start | No | 1-based index of the first result — use next_start/previous_start from the previous page. The API serves at most 100 results per query, so start + num - 1 must stay <= 100 (enforced: a wider window is rejected without spending quota). | |
| rights | No | License filter: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived (combine with |). | |
| country | No | Geolocation bias — rank results as if searching from this country, e.g. "de". Soft signal. | |
| language | No | Only results in this language, e.g. "en", "de", "zh-CN". | |
| or_terms | No | Space-separated words — each result must contain at least one of them. | |
| engine_id | No | Programmable Search Engine id (cx) to search with, overriding the configured GOOGLE_CUSTOM_SEARCH_ENGINE_ID. Omit to use the configured engine. | |
| file_type | No | Only files of this type, e.g. "pdf", "xlsx", "svg". | |
| exact_terms | No | A phrase every result must contain. | |
| site_search | No | A site or domain to include or exclude, e.g. "example.com" — pair with site_search_filter. | |
| date_restrict | No | Only results from the last N days/weeks/months/years: "d7", "w2", "m6", "y1", ... | |
| exclude_terms | No | A word or phrase no result may contain. | |
| include_pagemap | No | Attach each result's raw pagemap (OpenGraph/metatags/thumbnails and other structured page data). Verbose — leave off unless you need page metadata. | |
| country_restrict | No | Hard filter — only documents Google attributes to this country, e.g. "DE". | |
| filter_duplicates | No | Google's duplicate-content filter (default on). false returns near-duplicate results too. | |
| interface_language | No | Interface language used to interpret the query, e.g. "de". Improves non-English relevance. | |
| site_search_filter | No | include = only results from site_search, exclude = everything but it. Default include. |