Use case

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.

Prepaid, no subscriptionREST or MCPOne key for models, data and agents
WebYouTubeGoogle NewsRedditGoogle Trendslovelyjsonsources[0]"title": "EV prices fall as…""site": "reuters.com""date": "2026-10-14""summary": "Average EV prices…""transcript": "…in the third quarter…"trend": [42, 57, 71, 88]

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>
01

How it works

010203
  1. 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: and before:.

  2. 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.

  3. 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.

02

Connect your agent

search_toolsrun_toolget_run

The MCP server gives Claude Code, Cursor and any MCP client web_search, web_fetch and the full data catalog with one command:

Shell
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.

03

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.

04

The tools

JobToolInputs to know
Find sourcesweb-searchquery with operators, count, need_content, question
Read one pageweb-fetchurl
Index a site for RAGwebsite-crawlstartUrls, maxCrawlPages, maxCrawlDepth, includeUrlGlobs, excludeUrlGlobs, useSitemaps
Learn from videosyoutube-transcriptstartUrls, lang: full transcripts with timestamps
Check what a TikTok saystiktok-transcriptvideos: spoken-word transcripts
Current eventsgoogle-newsquery with operators, openEndedDateRange, dateFrom, dateTo, language
Interest over timegoogle-trendsmode keyword, keyword, predefinedTimeframe, geo, fetchRegionalData
What people askreddit-searchqueries, 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.

05

Recipes

Cited market brief

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.

RAG index of a docs site

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.

Research from talks and interviews

Send conference talk URLs to youtube-transcript with "lang": "en". The timestamps let the agent cite the moment a speaker said something.

Is demand growing?

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.

Check product claims in short videos

Pass TikTok video URLs to tiktok-transcript and have the model compare what creators say with the product's spec sheet.

06

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.

07

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.

One prepaid key for models, data and agents

No subscription. Top up, use what you need, see every charge in your logs.