# Ground an agent in sources from the domains you trust

An agent that answers from the web needs sources it can cite and you can trust. web.search takes a query plus include_domains (up to 10) or start_date and end_date, removes results outside them whichever provider answered, and returns title, URL, domain and snippet per result for the model to quote.

HTML page: https://www.routergrowth.com/tools/web-scraping/web-search-api-for-llm
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-10-26: 10 records in 57.4 s for $0.007. Personal fields are masked. Ten results for logical replication limited to postgresql.org, all from the PostgreSQL 18 docs; the filter removed none because the provider had applied it already.

| position | title | url |
|---|---|---|
| 1 | Documentation: 18: Chapter 29. Logical Replication | https://www.postgresql.org/docs/current/logical-replication.html |
| 2 | Documentation: 18: 26.1. Comparison of Different Solutions | https://www.postgresql.org/docs/current/different-replication-solutions.html |
| 3 | Documentation: 18: 29.8. Restrictions | https://www.postgresql.org/docs/current/logical-replication-restrictions.html |

## How to do it

1. **Give the agent the tool.** Connect RouterGrowth as an MCP server, or call /v1/run from your tool code.
2. **Set the allowed domains.** Pass include_domains for trusted sources, or start_date for recent pages only.
3. **Search, then read.** Run web.scrape on the top URLs so the model quotes the page, not the snippet.
4. **Cite the URL.** Return each claim with the url it came from, so the answer can be checked.

## Ask it like this

- Explain how PostgreSQL logical replication handles schema changes, using only postgresql.org, and cite each page you use. (`web.search`, `web.scrape`)
- Find pages on our category published since the first of this month and summarize them with links. (`web.search`)

## 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": "logical replication", "include_domains": ["postgresql.org"], "limit": 6}'
```

```bash
curl -X POST https://api.routergrowth.com/v1/run \
  -H "Authorization: Bearer $ROUTERGROWTH_API_KEY" \
  -d '{"capability": "web.search", "input": {"query": "logical replication", "include_domains": ["postgresql.org"], "limit": 6}}'
```

## Worth knowing

- **Filters run on the results.** include_domains and the dates are applied to what comes back, so an off list result is removed even when a provider ignores the filter. filters in the response counts the removals.
- **Undated pages stay.** With start_date, pages without a date are kept and counted in filters.kept_undated. Drop them when freshness matters.
- **Snippets are not the page.** A snippet is a line or two. Scrape the URL before the model quotes it.

## Questions

### Does it work with Claude or ChatGPT agents?

Yes. Connect it as an MCP server or call the REST endpoint from a tool; the agent sends the query and the filters.

### How many domains can I allow?

Up to 10 in include_domains, and their subdomains count.

### Can I exclude a domain?

There is no exclude field. Name the domains you want, or drop results in code.

### Is the limit exact?

No. This run asked for six and returned ten, so trim the list before it reaches the model.

## Related

- [Convert a web page into clean markdown your model can read](https://www.routergrowth.com/tools/web-scraping/website-to-markdown.md)
- [Search the web from code and get citable sources back as JSON](https://www.routergrowth.com/tools/web-scraping/web-search-api.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)
- [Pull news articles on any topic into your code as JSON](https://www.routergrowth.com/tools/web-scraping/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)
- [Read a public Amazon product page from your agent, with no scraper to maintain](https://www.routergrowth.com/tools/web-scraping/amazon.md)
