n8n

How to Extract YouTube Peaks for Video Engagement?

Turn a YouTube video ID into a short list of high energy moments that your team can use for clips, hooks, and thumbnails. Great for marketing and content teams that want quick highlights without watching full videos.

A webhook receives a request with a ytID query. The ID flows into an HTTP request that pulls most replayed markers. A check confirms if intensity data exists. If not, the response returns a clean no results message. If data is present, markers are split, filtered by intensity above 0.6, converted from milliseconds to seconds, and de duplicated so close moments do not stack. The flow then builds human friendly lines with ready to click youtu.be links and timestamps, aggregates them, and returns a compact JSON payload.

Setup is simple and needs no API keys. Activate the workflow, copy the production webhook URL, and call it with a video ID. Expect faster content picks, less guessing, and quick handoff to editors or social managers. This is useful for teams that cut shorts, pull hooks, or mark chapters based on where viewers rewatch.

What are the key features?

  • Webhook input accepts a query parameter named ytID for the video ID.
  • HTTP Request pulls most replayed markers from a public endpoint using the provided ID.
  • If check routes either to a no results response or to the processing path when data exists.
  • Split Out expands all marker items so each moment can be filtered and shaped.
  • Filter keeps only moments with intensity greater than 0.6 to focus on strong peaks.
  • Set converts start time from milliseconds to seconds for easy sharing.
  • Filter removes moments that are too close to each other to avoid duplicates.
  • Set builds human readable lines with youtu.be links and start times.
  • Aggregate collects all cleaned moments into a single engagingMoments array and returns JSON.

What are the benefits?

  • Reduce manual review from 15 minutes per video to under 2 minutes.
  • Automate up to 90 percent of scanning for highlight timestamps.
  • Improve clip selection consistency by using objective replay data.
  • Cut duplicate moments by de duplicating timestamps that are too close.
  • Deliver ready to share links that speed handoff to editors and social teams.

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. Open the Webhook node. Copy the Production URL and activate the workflow so the URL is live.
  3. In the Set node named Input variables, confirm youtubeVideoID is set to {{$json.query.ytID}}.
  4. Open the HTTP Request node and verify the URL is https://yt.lemnoslife.com/videos?part=mostReplayed&id={{ $json.youtubeVideoID }}. This call does not require credentials.
  5. Run a quick test in a browser or Postman: {your production URL}?ytID={a valid YouTube video ID}. Check the execution to confirm data returns.
  6. Inspect the If node labeled has intensity data. If it goes to the no results path, the final JSON will return engagingMoments as null.
  7. Adjust the intensity threshold in the filter node intensity > 0.6 if you want more or fewer moments. Lower values return more moments.
  8. Fine tune the Filter out moments close to each other node to change how closely timed moments are merged.
  9. Open the Set node Create each moment and change the message format if you want different link text or labels.
  10. Trigger the endpoint again and check the Respond with moments output. You should see engagingMoments and youtubeID in the JSON.
  11. If results are empty, confirm the video has public data and most replayed markers. Try a different video ID to verify behavior.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.