Use case

Research what a topic is worth on YouTube before you make a video

Search YouTube by keyword and get videos as JSON with views, likes, comments, duration, channel and date, to size demand and see who owns a topic.

Prepaid, no subscriptionREST or MCPOne key for models, data and agents
YouTubelovelyjsonitems[0]"title": "Espresso tutorial for…"views": 1250000"likes": 38400"comments": 2100"duration": "9:32""channel": "Daily Grind""date": "2025-03-04"

Before you plan a video series, a course or a content campaign, you want to know whether people watch the topic, how long the winning videos run and which channels already own it. YouTube's own search shows ten results at a time and no numbers side by side. Lovely Router runs the search for you. Send keywords, get one JSON object per video, pay per video from a prepaid balance. Run it from a script or an AI agent with one API key.

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.

Research what a topic is worth on YouTube before you make a video. Use the Lovely Router data tools: each returns JSON and is billed per result.

- Docs (read first): https://lovelyrouter.com/docs/tools/find.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 inputs (links, keywords or accounts) and how many results you need>
01

How it works

010203
  1. List the topics

    Write the keywords you consider, one per entry: the topic itself, the question people ask, the product name plus "review".

  2. Run the tool with a cap

    Send them to POST /v1/tools/youtube-search/run, with maxItems for the number of videos and max_results as the run cap. The run holds its maximum cost from your balance and returns the videos as JSON.

  3. Compare the topics

    For each keyword, look at the median views, the share of videos from small channels, and the typical length. A topic with high views from small channels is open; one dominated by a few big channels is not.

02

Search a topic with one request

Search YouTube videos takes search terms in keywords, one search per entry. Instead of keywords you can pass YouTube links in startUrls: search results, channel, playlist or video URLs. Filters sort, uploadDate and duration apply to keyword searches:

curl https://lovelyrouter.com/v1/tools/youtube-search/run \
  -H "Authorization: Bearer $LOVELY_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "input": {
      "keywords": ["espresso tutorial"],
      "maxItems": 5
    },
    "max_results": 5
  }'

A run still going after 60 seconds returns 202; Run a tool shows how to poll. One run can return up to 200 videos.

03

What each video holds

Field groupWhat you get
IdentityVideo title
ReachViews
EngagementLikes and comments count
FormatDuration
SourceThe channel that published it
TimingPublication date
04

Recipes

Size a topic

Search five variants of a keyword with 50 videos each, and compare the median views per variant to choose the one with the most demand.

Find open topics

Keep the videos with high views that come from channels you have not heard of; that is a sign a small channel can win here.

Choose a length

Group the top videos by duration. If the winners run 8 to 12 minutes, plan for that rather than 30.

Spot rising topics

Use the uploadDate filter to look only at recent uploads, and see which keywords still produce videos with strong views.

Build a competitor list

Count which channels appear most across your keywords, then follow them with youtube-channel.

Prefer plain words? Connect the MCP server and tell Claude Code or Cursor: "Search YouTube for 'espresso tutorial', 'home espresso setup' and 'best espresso grinder', 30 videos each, and tell me which keyword has the most views per video and which channels show up most. Set max_results to 90."

06

What you pay

You pay per video: starting a run holds its maximum cost, the per-call fee plus the per-video fee times max_results, and the run settles to what it returned. The rest of the hold goes back to your balance. A run that fails or times out pays only for the videos it delivered, and a run refused at the start costs nothing.

Researching 10 keywords at 30 videos each is billed as 300 videos. There is no subscription and no monthly minimum: top up from $5, and one balance pays for tools and models. The card above shows today's price; pricing lists every tool.

07

Frequently asked questions

?
Can I search several keywords in one run?+

Yes. keywords is a list and each entry runs as its own search.

Can I filter by upload date or video length?+

Yes. uploadDate and duration filter keyword searches, and sort changes the order. They do not apply when you pass startUrls.

Can I start from a playlist or a channel instead of a keyword?+

Yes. Put the link in startUrls: search result, channel, playlist or video URLs are accepted.

How many videos can one run return?+

Up to 200. Use maxItems to ask for fewer.

Does it give search volume?+

No. It returns the videos and their views, likes, comments, duration, channel and date. Demand is something you judge from those numbers.

Do I need a subscription?+

No. You add credit to a prepaid balance and each run draws it down. Failed runs pay only for the results they delivered, and nothing renews automatically.

Planning content around a market? See social listening, influencer research and the tool catalog.

One prepaid key for models, data and agents

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