YouTube Video Downloader with n8n
Use YouTube Video Downloader with n8n with HuntBuild 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), orvideo
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/:idusingjob_idfrom step 1
4. Condition (If)
- Node: If
- Condition:
{{$json.status}}equal toCompletedJob - 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 🎬
- Drag an HTTP Request node to your canvas (rename it to "Initiate Download").
- Method: Select
GET. - URL: Enter
https://huntapi.com/api/v1/video/download. - Authentication:
- Add Header: Name
x-api-key, ValueYOUR_API_KEY.
- Add Header: Name
- Query Parameters:
- Add Parameter: Name
query, Valuehttps://www.youtube.com/watch?v=....
- Add Parameter: Name
Step 2: Create a Polling Loop 🔄
To handle varying processing times, create a loop that checks the status until it's done:
- Add a Wait Node: Connect it after your Initiate Request. Set it to wait for 5 seconds.
- 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.
- URL:
- Add an If Node: Connect it after the Check Status node.
- Condition: String
{{ $json.status }}Equal toCompletedJob.
- Condition: String
- 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.
