Deep research agent API with web data for RAG
Give your research agent web search, clean page text, whole-site crawls, video transcripts, news and trends over MCP or REST. Pay per search or page.
A research agent is only as good as what it can read. Give yours web search with summaries written for models, any page as clean Markdown, whole sites crawled for a RAG index, YouTube and TikTok transcripts, Google News, Google Trends and Reddit threads. Your agent calls them over MCP, or your pipeline calls them over REST, with the same key that pays for the model.
Hand it to your AI agent
Copy this prompt into Claude Code, Cursor, Codex or any coding agent. It tells the agent where the docs are and how to use your API key.
Do grounded research for me with web search, clean page text, whole-site crawls, video transcripts, news and trends, and cite your sources. Use the Lovely Router data tools: each returns JSON and is billed per result.
- Docs (read first): https://lovelyrouter.com/docs/tools/mcp.md and https://lovelyrouter.com/docs/tools/run.md
- Plan first: POST https://lovelyrouter.com/v1/tools/suggest with `{"task": "<my task in plain words>"}` (free). It returns the tools to run in order, each with an example `input`, the `input_required` fields, an estimated cost and a ready-made `run` request. Replace the example values with my task's; if a field is unclear, read the tool with GET https://lovelyrouter.com/v1/tools/<id>. To browse instead, POST https://lovelyrouter.com/v1/tools/discover searches the catalog.
- Show me the plan and its estimated cost (`total_est_cost_usd`) before running anything large.
- Run: POST https://lovelyrouter.com/v1/tools/<id>/run with `{"input": {...}, "max_results": N}`. A 200 has the finished run with `items`; a 202 means it is still running, so poll the `poll` path until `status` is `succeeded`, `failed`, `timed_out` or `stopped`.
- Only delivered results are billed. Keep max_results small on the first run, check the output, then scale up.
- If you support MCP, connect https://lovelyrouter.com/mcp instead (Streamable HTTP, same key; https://lovelyrouter.com/docs/tools/mcp.md) and use suggest_tools, get_tool and run_tool.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.
My task: <the research question and the format of the answer>How it works
Search
Web search returns up to 50 results, each with title, URL, date, site, a short snippet and a long summary written for models. Narrow it with
site:,-site:,"exact phrase",-word,lang:,after:andbefore:.Read
Read a web page returns one page as clean Markdown: its title and text, without menus or ads. Crawl a website does the same for a whole site or section.
Ground the answer
The agent writes its answer from what it read and cites the URLs. For RAG, you chunk the crawled Markdown into your own index.
Connect your agent
The MCP server gives Claude Code, Cursor and any MCP client web_search, web_fetch and the full data catalog with one command:
claude mcp add --transport http lovely-tools https://lovelyrouter.com/mcp \
--header "Authorization: Bearer $LOVELY_API_KEY"Then ask: "Research which carmakers started producing solid-state batteries in 2026. Search with after:2026-01-01, read the five most relevant sources, check Google News for the last 7 days, and write a brief that cites the URL of every claim."
Over MCP, web_fetch returns long pages in parts of about 12,000 characters, and reading on is free.
Call it from your own pipeline
The same tools run over REST. A search is one run of web-search:
curl https://lovelyrouter.com/v1/tools/web-search/run \
-H "Authorization: Bearer $LOVELY_API_KEY" \
-H "content-type: application/json" \
-d '{
"input": {
"query": "solid-state battery production site:reuters.com OR site:bloomberg.com after:2026",
"count": 10,
"question": "Which carmakers produce solid-state batteries in 2026?"
}
}'count sets the number of results, 1 to 50, at the same price per search. question passes the user's original question to rank results better, and need_content adds each page's text when the summaries aren't enough. The web search API page covers search and page reading in more depth.
The tools
Search the web: up to 50 results with title, URL, date, site, a short snippet and a long summary written for models (and the page text if asked). Operators: site:, -site:, "exact phrase", -word, lang:, after:, before:.
Read any public web page as clean Markdown: its title and text, without navigation or ads. For one page you already have the URL of.
Crawl a whole website (or a section of it) and return each page as clean, LLM-ready markdown. Good for RAG and documentation sites.
Full transcripts (captions) of YouTube videos, with timestamps: one per video link, in the language you ask for when the video has it.
Spoken-word transcripts of TikTok videos by URL.
News articles from Google News for a search (operators work: "exact phrase", OR, -word, site:, intitle:), optionally within a time window: title, source, date and the article's link on the publisher's site.
Google Trends interest over time and by region for a keyword.
Reddit posts for a query or subreddit: title, body, score, comments count, author, date.
| Job | Tool | Inputs to know |
|---|---|---|
| Find sources | web-search | query with operators, count, need_content, question |
| Read one page | web-fetch | url |
| Index a site for RAG | website-crawl | startUrls, maxCrawlPages, maxCrawlDepth, includeUrlGlobs, excludeUrlGlobs, useSitemaps |
| Learn from videos | youtube-transcript | startUrls, lang: full transcripts with timestamps |
| Check what a TikTok says | tiktok-transcript | videos: spoken-word transcripts |
| Current events | google-news | query with operators, openEndedDateRange, dateFrom, dateTo, language |
| Interest over time | google-trends | mode keyword, keyword, predefinedTimeframe, geo, fetchRegionalData |
| What people ask | reddit-search | queries, subredditName, sort, timeframe |
Tip
Let the summaries do the first pass. Each web-search result carries a long summary written for a model, so the agent usually needs web-fetch only for the few pages it quotes.
Recipes
web-search with after: for recent sources, web-fetch on the best three, google-news with "openEndedDateRange": "7d" for the week's news, then a model writes the brief with links.
Run website-crawl with "startUrls": [{"url": "https://docs.example.com/"}], "useSitemaps": true and "excludeUrlGlobs": ["https://docs.example.com/changelog/**"]. Each page comes back as LLM-ready Markdown to chunk and embed in your own pipeline.
Send conference talk URLs to youtube-transcript with "lang": "en". The timestamps let the agent cite the moment a speaker said something.
Run google-trends with "mode": "keyword", "predefinedTimeframe": "today 5-y", a country in geo and "fetchRegionalData": true, then reddit-search for what buyers ask about the topic.
Pass TikTok video URLs to tiktok-transcript and have the model compare what creators say with the product's spec sheet.
What you pay
Web search and page reading cost $0.0009 per search or page. A search with no results, or a page that can't be read, costs nothing. The other tools bill per result: per crawled page (plus a per-call fee), per transcript, per article or per post; Google Trends bills per call. The cards above show today's prices. Each run holds its maximum cost and settles to what it returned. The model that does the reasoning is billed per token at its own price, from the same prepaid balance; compare them on models. No subscription. See pricing.
Frequently asked questions
What is the difference between web search and reading a page?+
Web search finds pages for a query and returns titles, URLs, dates and summaries written for a model. Reading a page takes one URL and returns its full text as clean Markdown, without menus or ads.
How do I build a RAG index from a website?+
Run the website-crawl tool on the site or section you want, with URL globs to include or exclude paths. It returns each page as Markdown, ready to chunk and embed in your own index.
Which search operators does web search support?+
site:, -site:, "exact phrase", -word, lang:, after: and before:. You can combine several sites with OR, and dates can be years or full dates.
Can my agent read YouTube videos?+
Yes. The youtube-transcript tool, a YouTube transcript API for agents, returns the full captions of a video with timestamps, in the language you ask for when the video has it, including auto-generated captions.
Which model should run the research agent?+
Any chat model on your key works, such as claude-sonnet-5.5, gpt-6.1-sol or gemini-3.1-pro. The tools cost the same whichever model calls them.
Related: web data extraction for structured JSON, social listening for conversations, and the MCP server docs for setup in other clients.