canonical: https://jentic.com/apis/googleapis.com/customsearch

# Google Custom Search API

Google Custom Search API (Programmable Search Engine) returns Google web search results scoped to one or more sites or to the wider web. It exposes a single endpoint that accepts a query, a custom search engine ID, and optional filters such as result language, safe-search level, country restriction, and start offset for pagination. A site-restricted variant returns only results from the configured engine's domains. Output includes title, snippet, link, and rich result metadata that match what end users would see on google.com.

## For AI agents

Run Google web searches scoped to a Programmable Search Engine and return ranked results with titles, snippets, and links so an agent can answer questions or feed retrieval pipelines.

## Scope

Does not crawl, index, or modify search results - use only to query a Programmable Search Engine and read ranked results.

## Capabilities

- Run a query against a custom search engine and return ranked web results
- Restrict results to the sites configured on the engine using the siterestrict variant
- Paginate through up to 100 results per query using start and num parameters
- Filter by language, country, safe-search, and date range
- Return image search results when the engine is configured for image search
- Surface rich result metadata such as snippet, displayLink, and pagemap structured data

## Use cases

### Site-Scoped Knowledge Lookup

A documentation chatbot uses Custom Search API with a Programmable Search Engine restricted to docs.example.com. The chatbot calls cse.siterestrict.list, takes the top three snippets, and grounds its response in the matching docs pages. Results return in well under a second per query.

Example prompt: Run a siterestrict search with cx='abc123' and q='refund policy', return the top 3 results' title, snippet, and link.

### Web Retrieval for RAG

A retrieval-augmented generation pipeline calls the open Custom Search endpoint to fetch the latest web pages relevant to a user's question. The pipeline scrapes the returned links, embeds them, and supplies the chunks to a language model. Custom Search keeps freshness and ranking aligned with google.com results.

Example prompt: Search the web for 'gke 1.30 release notes', return the top 5 result links and snippets to feed into a RAG indexer.

### Brand Monitoring Snapshot

A marketing team runs the Custom Search API daily for a list of brand and competitor terms, recording the top results' rank, link, and snippet in a warehouse. Trends in who appears for each term feed a brand-visibility dashboard. The 100-query free quota covers most small brand programmes.

Example prompt: For each term in ['acme cloud', 'acme storage'], retrieve the top 10 organic results and store rank, link, and snippet in BigQuery.

### AI Agent Web Search Tool

An AI agent that needs current information about an external topic asks Jentic for the Custom Search API operation, supplies the cx and query, and receives results. Jentic isolates the API key in its vault, so the agent never holds the long-lived key directly.

Example prompt: Search the web for the current Kubernetes stable release using cx='abc123' and return the top 3 result snippets.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /customsearch/v1 | Run a search query against a custom search engine |
| GET | /customsearch/v1/siterestrict | Run a search restricted to the engine's configured sites |

## Key resources

- **Custom Search Engine (cse)** — Programmable Search Engine that defines which sites the query targets and what result settings apply
- **Search Results** — Ranked list of items with title, link, snippet, displayLink, and pagemap structured data

## Why Jentic

- **Setup:** Wiring the Custom Search API by hand means obtaining an API key, keeping it out of source, and appending it to the 'key' query parameter on every request to customsearch.googleapis.com along with your Programmable Search Engine cx. Through Jentic you install once, import the Custom Search API from the API Directory, store the API key once, and your agent calls it.
- **Permission scoping:** This API reads ranked results and does not expose write or delete operations, so scoping is about the operations you allow: limit the agent to the operations it needs, such as running a web search or a site-restricted search. Both are read-only queries against your configured search engine.
- **Credential handling:** Your Custom Search API key is stored once, encrypted, by your own Jentic One instance and injected into the key query parameter at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'run a Google web search', and Jentic returns the matching Custom Search operation with its input schema, including cx, q, num, start, and safe, so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Bing Search API** — Microsoft's web search API with similar query and result semantics
- **Algolia Search API** — Search infrastructure for indexing and querying your own content
- **Google Search Console API** — Reports how your site performs in google.com results, complementing live search lookups

## FAQ

### What authentication does the Custom Search API use?

The Custom Search API uses an API key passed as the 'key' query parameter. Through Jentic the API key is stored encrypted in your Jentic One instance and injected into requests at execution time, so the raw key never appears in the agent's context.

### Can I get more than 10 results per query from the Custom Search API?

Yes, in pages. Each call returns at most 10 results; set the 'start' parameter (1, 11, 21...) and 'num' (max 10) to paginate. The API supports retrieving the first 100 results for a given query.

### What are the rate limits for the Custom Search API?

The Custom Search API allows 100 free queries per day per project, with paid tiers available for higher volume up to 10,000 queries per day per engine. Per-second QPS limits also apply; check the Programmable Search Engine pricing page for current ceilings.

### How do I run a Google web search through Jentic?

Run pip install jentic, search Jentic for 'google custom search query', load the schema for the cse.list operation on customsearch.googleapis.com, and execute it with your cx (engine ID) and q (query) parameters.

### Does the Custom Search API let me search the entire web like google.com?

Only when the linked Programmable Search Engine is configured to search the whole web. By default an engine targets a specific list of sites; toggle 'Search the entire web' in the Programmable Search Engine console to widen the scope.

### Can I limit what my agent is allowed to do with the Google Custom Search API?

Yes. Because you run Jentic One yourself, your own rules decide which operations and credentials the agent may use. The Custom Search API is read-only with just two operations, so you can restrict the agent to only what it needs: a general web search or the site-restricted search against your configured Programmable Search Engine. You allow both, one, or neither, and the agent can call nothing else since there are no write or delete operations to expose.
