API ReferenceYouTube Video Download API

YouTube Video Download API

The YouTube Video Download API allows you to download YouTube videos in multiple formats and qualities, providing a temporary download URL for offline access and content archival.

Endpoint

https://api.socialkit.dev/youtube/download

Example Request

POST https://api.socialkit.dev/youtube/download
 
{
  "access_key": "<your-access-key>",
  "url": "https://youtube.com/watch?v=dQw4w9WgXcQ",
  "format": "mp4",
  "quality": "360p"
}

Response

{
  "success": true,
  "data": {
    "title": "Video Title",
    "duration": "3:45",
    "durationSeconds": 225,
    "thumbnail": "https://i.ytimg.com/vi/.../hqdefault.jpg",
    "downloadUrl": "https://socialkit-downloads.s3.amazonaws.com/...",
    "fileSize": 4200000,
    "fileSizeMB": "4.00 MB",
    "format": "mp4",
    "quality": "360p",
    "expiresIn": "1 hour"
  }
}

Parameters

url string Required
The YouTube URL of the video to download. Supports various YouTube URL formats.


access_key string Required
Your API access key. Can be provided via the access_key query parameter, x-access-key header, or request body.


format string Optional Defaults to mp4
Output format for the download. Supported formats: mp4, mp3, avi, webm, m4a, ogg, wav.


quality string Optional Defaults to 360p
Video quality for the download. Supported qualities: 240p, 360p, 480p, 720p, 1080p.

Response Fields

The API returns the following data fields:

  • title: The video title
  • duration: Human-readable video duration (MM:SS format)
  • durationSeconds: Video duration in seconds
  • thumbnail: URL to the video thumbnail image
  • downloadUrl: Temporary URL to download the file (expires after 1 hour)
  • fileSize: File size in bytes
  • fileSizeMB: Human-readable file size in megabytes
  • format: The output format used
  • quality: The video quality used
  • expiresIn: Time until the download URL expires

Supported Formats

FormatTypeDescription
MP4VideoStandard video format
AVIVideoAVI video format
WebMVideoWebM video format
MP3AudioMP3 audio format
M4AAudioM4A audio format
OGGAudioOGG audio format
WAVAudioWAV audio format

Use Cases

  • Offline Viewing: Download YouTube videos for offline access
  • Audio Extraction: Convert YouTube videos to MP3 or other audio formats
  • Educational Archives: Archive educational content for later reference
  • Content Backup: Back up important video content
  • Social Media Repurposing: Download and repurpose content for other platforms

Notes

  • Maximum file size per download is 10MB
  • Download URLs expire after 1 hour
  • Audio-only formats (mp3, m4a, ogg, wav) will extract the audio track from the video
  • The quality parameter applies to video formats only