# Search only the sites you choose and get web results as JSON

The usual reason to look for a custom search API is to search a chosen set of sites from code. web.search does that: pass a query and up to 10 include_domains, and get position, title, URL, domain and snippet back. RouterGrowth is independent. This is not Google's API, and there is no search engine to configure first.

HTML page: https://www.routergrowth.com/tools/web-scraping/google-custom-search-api
Part of: [Web search and scraping tools](https://www.routergrowth.com/tools/web-scraping.md)

## The call

[`web.search`](https://www.routergrowth.com/catalog/web.search): Semantic or keyword web search returning sources an agent can cite.

Price on this network: $0.0035 per search. The exact quote is shown before every run.

## What a real run returned

Run on 2026-11-02: 3 records in 47.9 s for $0.007. Personal fields are masked. A search limited to nist.gov and cisa.gov kept three results after removing seven elsewhere; the first provider had none inside the domains, so the next answered and the run took 47.9 seconds.

| position | domain | title |
|---|---|---|
| 5 | cisa.gov | Zero Trust Maturity Model |
| 6 | csrc.nist.gov | NIST Guidance on Implementing a ZTA / CSRC |
| 7 | pages.nist.gov | Implementing a Zero Trust Architecture: Full Document |

## How to do it

1. **List the sites.** Put up to 10 domains in include_domains. Subdomains count: nist.gov also matched csrc.nist.gov and pages.nist.gov in the example.
2. **Send the query.** Call web.search with query, include_domains and limit. site: in the query is read the same way.
3. **Read filters.** result.filters says how many results were removed for being off domain, so you can tell a thin site list from a thin search.
4. **Open what matters.** Results hold a snippet, not the page. Pass the URLs you want to web.scrape for the full text.

## Ask it like this

- Search only these four vendor documentation sites for how each one handles single sign-on and cite the pages. (`web.search`)
- Find what nist.gov and cisa.gov published on zero trust, then read the top two pages and summarize the differences. (`web.search`, `web.scrape`)

## Connect

MCP server: `https://api.routergrowth.com/mcp`

```bash
claude mcp add --transport http routergrowth https://api.routergrowth.com/mcp
```

```bash
npm install -g routergrowth && routergrowth setup
routergrowth run -c web.search -i '{"query": "zero trust architecture guidance", "include_domains": ["nist.gov", "cisa.gov"], "limit": 6}'
```

```bash
curl -X POST https://api.routergrowth.com/v1/run \
  -H "Authorization: Bearer $ROUTERGROWTH_API_KEY" \
  -d '{"capability": "web.search", "input": {"query": "zero trust architecture guidance", "include_domains": ["nist.gov", "cisa.gov"], "limit": 6}}'
```

## Worth knowing

- **The filter runs after the search.** Off-domain results are removed from what a provider returned, so you can get fewer than limit. The example asked for six and kept three.
- **Narrow filters can take longer.** If a provider has nothing inside your domains, the next one tries. In the example that pushed the run to 47.9 seconds, so leave room in your timeouts.
- **Not every search option is here.** The input is query, limit, include_domains and dates. There is no image search and no paging parameter.

## Questions

### Is this Google's Custom Search API?

No. RouterGrowth is independent and web.search is its own call, with its own input and response.

### Are the results from Google?

web.search routes across search providers, and the run's provider field says which answered. For Google's own results page in a chosen location, seo.serp is the call.

### Do I need a search engine ID?

No. Domains go in the request, so each call can search a different set of sites.

### Can I filter by date?

Yes. start_date and end_date take YYYY-MM-DD; undated results are kept and counted in filters.kept_undated.

## Related

- [Search the web from code and get citable sources back as JSON](https://www.routergrowth.com/tools/web-scraping/web-search-api.md)
- [Pull news articles on any topic into your code as JSON](https://www.routergrowth.com/tools/web-scraping/news-api.md)
- [Name your spreadsheet columns, then fill them from any web page](https://www.routergrowth.com/tools/web-scraping/website-to-excel.md)
- [What a web search costs here: one quoted charge per search](https://www.routergrowth.com/tools/web-scraping/google-custom-search-api-price.md)
- [Turn one web page into records, each with the sentence that proves it](https://www.routergrowth.com/tools/web-scraping/extract-data-from-website.md)
- [Convert a web page into clean markdown your model can read](https://www.routergrowth.com/tools/web-scraping/website-to-markdown.md)
- [Ground an agent in sources from the domains you trust](https://www.routergrowth.com/tools/web-scraping/web-search-api-for-llm.md)
- [Turn a public page into agent ready text with a single request](https://www.routergrowth.com/tools/web-scraping/api.md)
- [Scrape public pages from a Python script with one POST request](https://www.routergrowth.com/tools/web-scraping/api-python.md)
- [Get the latest headlines on a listed company from its name and ticker](https://www.routergrowth.com/tools/web-scraping/stock-news-api.md)
- [Fetch news articles into a Python script with one POST](https://www.routergrowth.com/tools/web-scraping/news-api-python.md)
- [Get the articles Google News lists for a query, in one API call](https://www.routergrowth.com/tools/web-scraping/google-news-api.md)
