Turn YouTube videos into a searchable knowledge base with transcripts
Get full YouTube transcripts with timestamps as JSON, one per video link, to feed a RAG index, summaries, quotes or content repurposing.
The answer you need is in a two-hour talk, a conference playlist or a founder's weekly video, and nobody is going to watch it all. Transcripts make that content searchable, quotable and usable by a model. Lovely Router fetches them for you. Send video links, get one JSON object per transcript with timestamps, pay per transcript from a prepaid balance. Feed the result to a vector store, a summarizer 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.
Turn YouTube videos into a searchable knowledge base with transcripts. 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>How it works
Collect the video links
Gather the
youtube.com/watch?v=oryoutu.be/links you want to index: a course, a conference, a competitor's channel, your own back catalog.Run the tool with a cap
Send the links in
startUrlstoPOST /v1/tools/youtube-transcript/run, withlangif you want a specific caption language, andmax_resultsas the run cap. The run holds its maximum cost from your balance and returns the transcripts as JSON.Index or summarize
Split each transcript into chunks that keep their timestamps, embed them, and store them. A search hit can then link to the exact moment in the video.
Get a transcript with one request
Get a YouTube transcript takes video links in startUrls, one transcript per link, and an optional lang caption language code such as en, es, de or pt-BR. Auto-generated captions count. With lang empty you get the video's default track. One run reads up to 50 videos:
curl https://lovelyrouter.com/v1/tools/youtube-transcript/run \
-H "Authorization: Bearer $LOVELY_API_KEY" \
-H "content-type: application/json" \
-d '{
"input": {
"startUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
"lang": "en"
},
"max_results": 1
}'A run still going after 60 seconds returns 202; Run a tool shows how to poll.
What each transcript holds
| Field group | What you get |
|---|---|
| Text | The full transcript (captions) of the video |
| Timing | Timestamps for the text |
| Language | The language you asked for, when the video has it |
Shorts, live and playlist links are not accepted: pass single video links. A video without captions in the language you ask for cannot return that language.
Recipes
List a channel's videos with youtube-channel, send the links here, chunk the transcripts and answer questions with links to the timestamp.
Run every talk of an event, ask a model for a five-bullet summary of each, and publish one page.
Search the transcripts for a name, a product or a claim, and cite the video and moment.
Turn transcripts into blog posts, newsletters or show notes, with a model doing the rewrite.
Ask for es or de captions where the video has them, instead of translating from English.
Prefer plain words? Connect the MCP server and tell Claude Code or Cursor: "Get the English transcripts for the 12 links in talks.txt, summarize each in five bullets with the timestamp of the main point, and put them in one markdown file. Set max_results to 12."
Pair it with other sources
A transcript says what was spoken. Around it:
Full transcripts (captions) of YouTube videos, with timestamps: one per video link, in the language you ask for when the video has it.
Videos from YouTube channels (handles such as @MrBeast, or channel URLs): title, views, likes, comments count, duration, date.
YouTube videos for search keywords, or from YouTube links (search results, channel, playlist or video URLs): title, views, likes, comments count, duration, channel, date.
Comments on YouTube videos or Shorts: text, likes, replies count, author, date. Sorted by top or latest.
youtube-channellists the videos of a channel, so you can index it end to end.youtube-searchfinds the videos on a topic by keyword.youtube-commentsadds what viewers said about each video.
Agents that read and cite sources are covered in research agents.
What you pay
You pay per transcript: starting a run holds its maximum cost, the per-call fee plus the per-transcript 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 transcripts it delivered, and a run refused at the start costs nothing.
Indexing 200 videos is billed as 200 transcripts. 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.
Frequently asked questions
Does it work for videos without captions?+
It returns the captions the video has, and auto-generated captions count. If a video has no captions in the language you asked for, there is nothing to return in that language.
Can I choose the language?+
Yes, with lang (for example en, es, de or pt-BR), when the video has that track. Leave it empty for the default track.
Do transcripts have timestamps?+
Yes, the transcript comes with timestamps.
Can I send a playlist or a Shorts link?+
No. Playlist, live and Shorts links are not supported. Send single video links, in youtube.com/watch?v= or youtu.be/ form.
How many videos per run?+
Up to 50. For a longer list, start several runs.
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.
Building an agent that reads sources? See research agents, social listening and the tool catalog.