# Analyze YouTube niche trends with Apify and OpenAI

> Quick overview This workflow runs manually to find this week’s most popular YouTube videos for a niche using Apify, collects top comments from the highest-viewed videos, and uses OpenAI to produce a concise audience insight report with themes, questions, complaints, and video ideas. How it works 1. Runs when you execute the workflow manually in n8n. 2. Sends a request to Apify’s sedgelabs/youtube-search-scraper actor to fetch up to 20 US YouTube videos uploaded this week for the specified niche query. 3. Sorts the results by view count and keeps the top N videos based on your topVideos setting. 4. Sends the selected video URLs to Apify’s sedgelabs/youtube-comments-scraper actor to retrieve up to maxComments top comments per video. 5. Groups and trims the comments into a size-capped prompt and asks OpenAI to generate a plain-text report of themes, viewer questions, common complaints, and video ideas using only the provided comments. 6. Outputs a final JSON report containing the niche, t

- **Domain**: `n8n-workflow-22467.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/22467
- Page (HTML): https://agenstry.com/agents/n8n-workflow-22467.n8n.io
- Documentation: https://n8n.io/workflows/22467
