automations / n8n · updated 2026-07-20
Keyword search → transcript corpus
One keyword in, the transcripts of its top-ranking videos out — the search actor collects what ranks, the transcript actor turns each video into plain text ready for summarization, embedding, or competitor research. Videos without captions exit as typed rows and cost nothing.
20 videos per keyword cost at most $0.07 — $0.004 for the search results and $0.06 for the transcripts; misses are $0.
What's inside
- 1.Run workflow (manual trigger)
- 2.Search YouTube (HTTP Request → search scraper, type: video, one item per result)
- 3.Split search rows (IF on {{ $json.success }}; a query with no results exits as a typed row)
- 4.Collect video IDs (Code node: gathers the IDs and batches them 50 per transcript run)
- 5.Get transcripts (HTTP Request → transcript scraper, one item per video)
- 6.Split transcript rows (IF on {{ $json.success }})
- 7.Transcript text (true branch: video_id, title, plain text)
- 8.Transcript / search failure rows (false branches: code, request_id — not billed)
Set it up
Open the workflow on GitHub (button above), click Raw and copy that URL, then in n8n: Workflow → Import from URL. Replace YOUR_APIFY_TOKEN in BOTH HTTP nodes (Search YouTube and Get transcripts). Put ONE keyword in queries and tune maxResults, sortBy, and uploadDate to shape the sample. The actor itself accepts up to 50 queries per run, but this template merges everything downstream into one deduplicated corpus — duplicate the workflow per keyword to keep results separate. The token comes from Apify Console → Settings → API tokens; the free tier works, and the run bills per delivered row on your Apify account.
Ways to extend it
- Add an OpenAI node to summarize what the top-ranking videos actually say about your keyword.
- Duplicate the workflow per keyword and append its Transcript text rows to Google Sheets — one workflow, one tab.
- Schedule it weekly and diff against last week's video_ids to spot new entrants in the ranking.
Going deeper: the n8n transcripts guide — the full HTTP-node walkthrough, the async pattern for big batches, and the community-node alternative. Actor pricing: what a YouTube Search Scraper run costs, what a YouTube Transcript Scraper run costs. Error codes the failure branch can carry: the error-code reference.