# Search the web from code and get citable sources back as JSON

POST a query to web.search and get the ranked results as JSON: position, title, URL, domain and a snippet for each, ready to cite or to scrape next. site:, after: and before: in the query work as filters. The call routes across several search providers and moves on when one fails, all behind one key.

HTML page: https://www.routergrowth.com/tools/web-scraping/web-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-10-26: 9 records in 41.6 s for $0.007. Personal fields are masked. Nine results for open source vector database: vendor blogs, an AWS explainer, a Reddit list and community posts, each with its domain and snippet.

| position | domain | title |
|---|---|---|
| 1 | lakefs.io | Best 17 Vector Databases for 2026 [Top Picks] |
| 2 | aws.amazon.com | What is a Vector Database? - AWS |
| 7 | sqlpipe.com | Best Open-Source Vector Databases |

## How to do it

1. **Get a key.** One RouterGrowth key, sent as a Bearer token.
2. **POST the query.** Send capability web.search with input query and a limit to /v1/run.
3. **Read result.results.** Each result has position, title, url, domain and snippet.
4. **Scrape what you will quote.** Run web.scrape on the URLs you keep to get the full page text.

## Ask it like this

- Search the web for open source vector databases and list the names that come up most across the results. (`web.search`)
- Search for reviews of our three closest competitors, then scrape the top two results for each and summarize the complaints. (`web.search`, `web.scrape`)
- Find what was published about our category in the last month, on the web and in the news, and split press from blogs. (`web.search`, `news.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": "open source vector database", "limit": 8}'
```

```bash
curl -X POST https://api.routergrowth.com/v1/run \
  -H "Authorization: Bearer $ROUTERGROWTH_API_KEY" \
  -d '{"capability": "web.search", "input": {"query": "open source vector database", "limit": 8}}'
```

## Worth knowing

- **Mixed sources.** Results include forums and social pages next to blogs and docs. Filter on domain if you only want some.
- **The limit is a target.** This run asked for eight and returned nine. Cap the list in code when the count matters.
- **Time depends on the provider.** A search takes from about a second to under a minute, depending on which provider answers. This one took 42 seconds.

## Questions

### Which search providers are behind it?

Several are wired, and the run reports which one answered. This example ran on Apify.

### Can I limit results to one site?

Yes. Add site:domain to the query or pass include_domains with up to 10 domains.

### Can I filter by date?

Yes. start_date and end_date remove results dated outside the range; undated results are kept and counted.

### Does it return the full page?

No. It returns snippets. Use web.scrape on a URL for the page text.

## Related

- [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)
- [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)
