Automation & Workflow

YouTube Video Downloader with n8n

Use YouTube Video Downloader with n8n with Hunt
n8n workflow automation interface

Build powerful video download automation using n8n workflow automation platform and Hunt API. Archive content, extract audio for podcasts, and create intelligent media workflows without coding.

Quick Start with Hunt API

The Video Download API works asynchronously. You initiate a download job and then retrieve the results using the job ID.

Step 1: Initiate Download

Use the Hunt API in your n8n workflows to start a video download:

GET https://huntapi.com/api/v1/video/download
x-api-key: YOUR_API_KEY

Query Parameters:

  • query: The URL of the video to download (required)
  • video_quality: best (default), 1080p, 720p, etc.
  • download_type: audio_video (default), audio (extract audio only), or video

Response Example:

{
    "job_id": "0193443f-fb80-9d19-29ba-82bc77c7cd84"
}

Step 2: Get Job Result

After waiting for the job to complete, fetch the result:

GET https://huntapi.com/api/v1/jobs/0193443f-fb80-9d19-29ba-82bc77c7cd84
x-api-key: YOUR_API_KEY

Response Example (Completed):

{
    "id": "0193305e-e144-a995-3acc-6703bb48e13a",
    "success": true,
    "status": "CompletedJob",
    "endpoint": "/api/video/download",
    "created_at": "2024-11-15T15:09:04.709497Z",
    "started_at": "2024-11-15T15:09:04.714422Z",
    "duration_ms": 99592,
    "args": {
        "query": "https://yt.com/watch?v=..."
    },
    "result": {
        "metadata": {
            "ext": "webm",
            "title": "The New Claude 3.5 Sonnet",
            "thumbnail": "https://i.ytimg.com/vi/...",
            "view_count": 82398,
            "upload_date": 1729641600
        },
        "response": "https://s3.huntapi.com/videos/32f88fc4-e728-4c45-b27c-6ee539575595.webm"
    }
}

Key Features

  • Universal Downloader: Support for multiple video platforms
  • Format Options: Download full video, video only, or extract audio
  • Quality Control: Select from 360p up to Best available quality
  • Metadata Extraction: Get titles, thumbnails, view counts, and descriptions
  • Asynchronous Processing: Handle large files reliably with job-based architecture

n8n Workflow Example

Since the API is asynchronous, the best practice is to implement a polling loop:

1. Initiate Download

  • Node: HTTP Request
  • Action: Call GET /video/download
  • Output: Returns job_id

2. Wait Loop

  • Node: Wait
  • Settings: Wait for 5-10 seconds

3. Check Status

  • Node: HTTP Request
  • Action: Call GET /jobs/:id using job_id from step 1

4. Condition (If)

  • Node: If
  • Condition: {{$json.status}} equal to CompletedJob
  • True: Proceed to process file
  • False: Connect back to Wait node (Step 2)

Common Use Cases

Podcast Automation

Convert video content to audio automatically. Set download_type to audio to extract MP3s from video links for your podcast feed.

Brand Monitoring

Automatically download and archive videos that mention your brand or products for compliance and record-keeping.

Social Media Repurposing

Download high-quality versions (video_quality: "1080p") of your content to edit and repost across different platforms.

Detailed Configuration Guide

Step 1: Configure the Initiate Request 🎬

  1. Drag an HTTP Request node to your canvas (rename it to "Initiate Download").
  2. Method: Select GET.
  3. URL: Enter https://huntapi.com/api/v1/video/download.
  4. Authentication:
    • Add Header: Name x-api-key, Value YOUR_API_KEY.
  5. Query Parameters:
    • Add Parameter: Name query, Value https://www.youtube.com/watch?v=....

Step 2: Create a Polling Loop 🔄

To handle varying processing times, create a loop that checks the status until it's done:

  1. Add a Wait Node: Connect it after your Initiate Request. Set it to wait for 5 seconds.
  2. Add Check Status Node: Add an HTTP Request node after the Wait node.
    • URL: https://huntapi.com/api/v1/jobs/{{ $node["Initiate Download"].json.job_id }} (reference the first node).
    • Header: x-api-key.
  3. Add an If Node: Connect it after the Check Status node.
    • Condition: String {{ $json.status }} Equal to CompletedJob.
  4. Close the Loop:
    • Connect the False output of the If node back to the Wait node input.
    • Connect the True output to your next steps (e.g., Upload to Drive).

Step 3: Process the File 💾

Connected to the True output of your If node, you can now use the result:

  • The download URL is in {{ $json.result.response }}.
  • Metadata is in {{ $json.result.metadata }}.

VIDEO API

Discover why Hunt is the preferred API provider for developers.