cd /news/ai-agents/give-your-ai-agent-live-web-search-s… · home › topics › ai-agents › article
[ARTICLE · art-177840] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Give Your AI Agent Live Web Search - Search Results as Clean Markdown with Token Limits (Standby API + MCP)

A developer built RAG Web Browser, an Apify-hosted tool that takes a search query and returns the top web pages as clean, LLM-ready Markdown with token estimates and truncation flags, so agents can ground answers in fresh sources with citations. The tool runs in Apify's always-on Standby mode as an HTTP endpoint, uses Google search with automatic DuckDuckGo fallback, and can be wired into LangChain, CrewAI, OpenAI or Anthropic tool-calling APIs, n8n, or any MCP client via the Apify MCP server. Pricing is $1.80 per 1,000 pages read plus $0.003 per Google search, with no search fee on DuckDuckGo — roughly $5.40 for 1,000 questions reading three pages each.

key takeaway

Wrapping a search-plus-scrape-plus-Markdown pipeline as a single tool call with a maxContentTokens cap and a truncated flag keeps retrieved pages inside the context window and lets the model cite sources by URL.

by read2 min views2 publishedNov 28, 2026

LLMs don't know what happened yesterday, and they make things up when they don't know. The fix is grounding: let the model search the web, read the top pages and answer with citations.

Doing that yourself means stitching together a search API, a scraper, HTML-to-Markdown conversion, boilerplate removal and a way to keep pages inside your context window. This guide shows a single tool that does all of it in one call. Send a question and get the top results as clean, LLM-ready Markdown with token estimates and truncation flags.

{
  "query": "best vector database for RAG",
  "rank": 1,
  "url": "https://www.braintrust.dev/articles/best-vector-databases-for-rag-2026",
  "title": "Best vector databases for RAG in 2026",
  "markdown": "# Best vector databases for RAG in 2026\n\nTL;DR...",
  "tokenEstimate": 1500,
  "truncated": true,
  "renderedWith": "http",
  "searchEngine": "duckduckgo"
}

maxContentTokens`` truncated tells you when it happened.url + rank Open RAG Web Browser on Apify:

{
  "query": "best vector database for RAG",
  "maxResults": 3,
  "maxContentTokens": 1500,
  "outputFormat": "markdown"
}

Output can be markdown, text or html. For batch research, pass many questions at once in queries.

The tool runs in Standby mode, an always-on HTTP endpoint, so your agent gets answers in seconds without waiting for a container to start:

GET https://<standby-url>/search?query=...&maxResults=3&maxContentTokens=2000
Authorization: Bearer <YOUR_APIFY_TOKEN>

It returns a JSON array of pages. Wrap it as a tool in LangChain, CrewAI, the OpenAI or Anthropic tool-calling APIs, or an n8n HTTP node.

Add it through the Apify MCP server, and Claude Desktop, Cursor or any MCP client can call "search the web and read the top 3 pages" as a native tool.

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
question = "What changed in the EU AI Act timeline this year?"

run = client.actor("karioski/rag-web-search-browser").call(run_input={
    "query": question,
    "maxResults": 3,
    "maxContentTokens": 1500,
})
pages = list(client.dataset(run["defaultDatasetId"]).iterate_items())

context = "\n\n".join(f"[{i+1}] {p['url']}\n{p['markdown']}" for i, p in enumerate(pages))
prompt = f"Answer using only the sources below and cite them as [n].\n\nQuestion: {question}\n\nSources:\n{context}"

The tool uses Google with automatic DuckDuckGo fallback, so searches don't come back empty. You can also force one engine.

What Price on paid Apify plans
Page read and converted $1.80 per 1,000
Google search (only when Google results are used) $0.003 per search

DuckDuckGo queries have no search fee, so you pay only for pages read. Example: 1,000 agent questions reading 3 pages each cost about $5.40 with DuckDuckGo.

Try it: RAG Web Browser on Apify →

Disclosure: I built this tool. Questions or feature requests are welcome on the Actor page.

── more in #ai-agents 4 stories · sorted by recency
── more on @apify 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/give-your-ai-agent-l…] indexed:0 read:2min 2026-11-28 · —