Back to all posts

How to Summarize YouTube Videos at Scale - AI-Powered Summaries

Jonathan Geiger
YouTube APIAI SummariesVideo AnalysisYouTube ShortsAutomation

Need to summarize YouTube videos at scale? Whether you're building content curation tools, research platforms, or automated content pipelines, generating video summaries programmatically is a game-changer.

In this guide, we'll show you how to generate AI-powered summaries from YouTube videos and Shorts at scale using the YouTube Summary API - no need to watch hours of video content manually.

What Can You Generate?

The YouTube Summary API provides AI-powered video analysis:

  • Smart Summaries - Concise overviews of video content
  • Key Takeaways - Main points and insights extracted automatically
  • Timestamps - Important moments with precise timings
  • Custom Fields - Define your own summary structure (quotes, action items, etc.)
  • Flexible Length - Control summary length based on your needs
  • YouTube Shorts Support - Works with both regular videos and Shorts
  • Batch Processing - Summarize hundreds of videos efficiently

Video Tutorial

Watch this comprehensive tutorial on scraping and analyzing YouTube video data:

The Easy Way: YouTube Summary API

The simplest and most powerful method is using the YouTube Summary API. Here's why:

AI-Powered - GPT-powered summaries that understand context
Customizable - Define your own summary structure and fields
Fast & Reliable - Summarize videos in seconds
No Manual Work - Eliminate hours of watching and note-taking
Scalable - Process thousands of videos automatically
YouTube Shorts Compatible - Works seamlessly with Shorts

API Endpoint

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

Parameters

ParameterTypeRequiredDescription
urlstringYesYouTube video URL (regular or Shorts)
access_keystringYesYour API access key
custom_responseobject/stringNoDefine custom fields for the AI response
custom_promptstringNoAdd your own instructions to guide the AI's analysis

Example Request

GET https://api.socialkit.dev/youtube/summarize?access_key=<your-access-key>&url=https://www.youtube.com/watch?v=dQw4w9WgXcQ

Example Response

{
  "success": true,
  "data": {
    "url": "https://youtube.com/watch?v=dQw4w9WgXcQ",
    "summary": "The video features the song 'Never Gonna Give You Up' by Rick Astley, which expresses themes of love, commitment, and reassurance in a romantic relationship.",
    "mainTopics": [
      "Love",
      "Commitment",
      "Reassurance"
    ],
    "keyPoints": [
      "The singer emphasizes unwavering commitment to a partner.",
      "The lyrics convey a sense of understanding and mutual feelings.",
      "The repetition of key phrases reinforces the message of loyalty."
    ],
    "tone": "Uplifting and reassuring",
    "targetAudience": "Fans of 80s music and pop culture enthusiasts",
    "quotes": [
      "Never gonna give you up.",
      "Your heart's been aching but you're too shy to say it."
    ],
    "timeline": "The song follows a structured verse-chorus format, alternating between expressions of commitment and emotional connection."
  }
}

Code Examples

JavaScript / Node.js

const axios = require('axios');

async function summarizeYouTubeVideo(videoUrl, accessKey, customPrompt = null) {
  try {
    const params = {
      access_key: accessKey,
      url: videoUrl
    };
    
    if (customPrompt) {
      params.prompt = customPrompt;
    }
    
    const response = await axios.get('https://api.socialkit.dev/youtube/summarize', {
      params: params
    });
    
    return response.data;
  } catch (error) {
    console.error('Error summarizing video:', error);
    throw error;
  }
}

// Basic usage
const videoUrl = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
// Also works with Shorts
const shortsUrl = 'https://www.youtube.com/shorts/abc123def';

const accessKey = 'your-access-key';

summarizeYouTubeVideo(videoUrl, accessKey)
  .then(data => {
    console.log('Summary:', data.data.summary);
    console.log('\nMain Topics:', data.data.mainTopics);
    console.log('Key Points:', data.data.keyPoints);
    console.log('Tone:', data.data.tone);
  });

// With custom prompt for structured output
const customPrompt = `
Summarize this video in the following JSON format:
{
  "overview": "brief overview",
  "key_points": ["point 1", "point 2", "point 3"],
  "target_audience": "who this is for",
  "difficulty": "beginner/intermediate/advanced"
}
`;

summarizeYouTubeVideo(videoUrl, accessKey, customPrompt)
  .then(data => {
    const structured = JSON.parse(data.data.summary);
    console.log('Overview:', structured.overview);
    console.log('Key Points:', structured.key_points);
  });

Python

import requests
import json

def summarize_youtube_video(video_url, access_key, custom_prompt=None):
    endpoint = 'https://api.socialkit.dev/youtube/summarize'
    
    params = {
        'access_key': access_key,
        'url': video_url
    }
    
    if custom_prompt:
        params['prompt'] = custom_prompt
    
    response = requests.get(endpoint, params=params)
    response.raise_for_status()
    
    return response.json()

# Basic usage - works with regular videos and Shorts
video_url = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
# shorts_url = 'https://www.youtube.com/shorts/abc123def'

access_key = 'your-access-key'

data = summarize_youtube_video(video_url, access_key)

print(f"Summary: {data['data']['summary']}")
print(f"\nMain Topics: {', '.join(data['data']['mainTopics'])}")
print(f"Tone: {data['data']['tone']}")
print(f"\nKey Points:")
for point in data['data']['keyPoints']:
    print(f"  • {point}")

# Custom prompt for structured data
custom_prompt = """
Summarize this video in JSON format:
{
  "overview": "one paragraph overview",
  "key_takeaways": ["takeaway 1", "takeaway 2", "takeaway 3"],
  "timestamps": [{"time": "MM:SS", "description": "what happens"}],
  "recommended_for": "target audience"
}
"""

data = summarize_youtube_video(video_url, access_key, custom_prompt)
structured = json.loads(data['data']['summary'])

print("\nKey Takeaways:")
for takeaway in structured['key_takeaways']:
    print(f"  • {takeaway}")

PHP

<?php

function summarizeYouTubeVideo($videoUrl, $accessKey, $customPrompt = null) {
    $endpoint = 'https://api.socialkit.dev/youtube/summarize';
    
    $params = [
        'access_key' => $accessKey,
        'url' => $videoUrl
    ];
    
    if ($customPrompt) {
        $params['prompt'] = $customPrompt;
    }
    
    $url = $endpoint . '?' . http_build_query($params);
    
    $response = file_get_contents($url);
    return json_decode($response, true);
}

// Usage - supports regular videos and YouTube Shorts
$videoUrl = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
$accessKey = 'your-access-key';

$data = summarizeYouTubeVideo($videoUrl, $accessKey);

echo "Summary:\n" . $data['data']['summary'] . "\n\n";
echo "Main Topics: " . implode(", ", $data['data']['mainTopics']) . "\n";
echo "Tone: " . $data['data']['tone'] . "\n";

cURL

# Basic summary
curl -X GET "https://api.socialkit.dev/youtube/summarize?access_key=your-access-key&url=https://www.youtube.com/watch?v=dQw4w9WgXcQ"

# With custom prompt (URL encoded)
curl -X GET "https://api.socialkit.dev/youtube/summarize?access_key=your-access-key&url=https://www.youtube.com/watch?v=dQw4w9WgXcQ&prompt=Summarize%20in%203%20sentences"

Advanced Use Cases

1. Batch Video Summarization

Process multiple videos at scale:

async function batchSummarizeVideos(videoUrls, accessKey) {
  const summaries = [];
  
  // Process in batches of 5 to avoid rate limits
  for (let i = 0; i < videoUrls.length; i += 5) {
    const batch = videoUrls.slice(i, i + 5);
    
    const batchResults = await Promise.all(
      batch.map(url => summarizeYouTubeVideo(url, accessKey))
    );
    
    summaries.push(...batchResults);
    
    // Optional: Add delay between batches
    if (i + 5 < videoUrls.length) {
      await new Promise(resolve => setTimeout(resolve, 1000));
    }
  }
  
  return summaries;
}

// Usage
const videoUrls = [
  'https://www.youtube.com/watch?v=video1',
  'https://www.youtube.com/shorts/short1',
  'https://www.youtube.com/watch?v=video2',
  // ... hundreds more
];

batchSummarizeVideos(videoUrls, 'your-key')
  .then(summaries => {
    console.log(`Processed ${summaries.length} videos`);
    
    // Save to database or file
    summaries.forEach(s => {
      console.log(`${s.data.title}: ${s.data.summary.substring(0, 100)}...`);
    });
  });

2. Content Curation with Custom Fields

Create structured summaries for content curation:

def curate_educational_content(video_urls, access_key):
    """Generate structured summaries for educational content"""
    
    curation_prompt = """
    Analyze this educational video and provide:
    {
      "title": "video title",
      "topic": "main topic",
      "difficulty_level": "beginner/intermediate/advanced",
      "duration_category": "quick (< 5 min) / medium / comprehensive",
      "key_concepts": ["concept 1", "concept 2", "concept 3"],
      "prerequisites": ["what viewers should know"],
      "best_quote": "most impactful quote from the video",
      "recommended_for": "who should watch this",
      "tldr": "one sentence summary"
    }
    """
    
    curated_content = []
    
    for video_url in video_urls:
        try:
            data = summarize_youtube_video(video_url, access_key, curation_prompt)
            summary_json = json.loads(data['data']['summary'])
            
            curated_content.append({
                'url': video_url,
                'metadata': summary_json
            })
        except Exception as e:
            print(f"Error processing {video_url}: {e}")
            continue
    
    return curated_content

# Usage
educational_videos = [
    'https://www.youtube.com/watch?v=tutorial1',
    'https://www.youtube.com/shorts/quicktip',
    'https://www.youtube.com/watch?v=tutorial2'
]

curated = curate_educational_content(educational_videos, 'your-key')

# Filter by difficulty
beginner_videos = [c for c in curated if c['metadata']['difficulty_level'] == 'beginner']

3. YouTube Shorts Digest

Create daily digests of Shorts content:

async function createShortsDigest(shortsUrls, accessKey) {
  const digestPrompt = `
  Summarize this YouTube Short in one compelling sentence that captures the main point.
  Then add 2-3 relevant hashtags.
  Format: "Summary sentence #hashtag1 #hashtag2"
  `;
  
  const summaries = await Promise.all(
    shortsUrls.map(async (url) => {
      const data = await summarizeYouTubeVideo(url, accessKey, digestPrompt);
      return {
        url: url,
        digest: data.data.summary,
        title: data.data.title
      };
    })
  );
  
  // Create digest email/newsletter
  let digest = '📱 Today\'s Top YouTube Shorts\n\n';
  summaries.forEach((s, i) => {
    digest += `${i + 1}. ${s.title}\n`;
    digest += `   ${s.digest}\n`;
    digest += `   Watch: ${s.url}\n\n`;
  });
  
  return digest;
}

4. Competitive Analysis

Analyze competitor video content:

def analyze_competitor_videos(channel_videos, access_key):
    """Analyze competitor video strategy"""
    
    analysis_prompt = """
    Analyze this video's content strategy:
    {
      "main_topic": "primary subject",
      "content_angle": "unique perspective or approach",
      "target_pain_point": "what problem it solves",
      "cta": "call to action if any",
      "engagement_hooks": ["techniques used to engage viewers"],
      "production_quality": "assessment of video quality",
      "key_differentiators": ["what makes it stand out"]
    }
    """
    
    analyses = []
    
    for video_url in channel_videos:
        data = summarize_youtube_video(video_url, access_key, analysis_prompt)
        analysis = json.loads(data['data']['summary'])
        
        analyses.append({
            'url': video_url,
            'title': data['data']['title'],
            'analysis': analysis
        })
    
    # Aggregate insights
    all_topics = [a['analysis']['main_topic'] for a in analyses]
    all_angles = [a['analysis']['content_angle'] for a in analyses]
    
    return {
        'videos_analyzed': len(analyses),
        'common_topics': list(set(all_topics)),
        'content_angles': list(set(all_angles)),
        'detailed_analyses': analyses
    }

Custom Prompt Examples

For Blog Post Generation

const blogPrompt = `
Create a blog post outline from this video:

Title: [Catchy blog title]

Introduction: [2-3 sentences]

Main Points:
- Point 1: [explanation]
- Point 2: [explanation]  
- Point 3: [explanation]

Key Quotes:
- "[Quote 1]"
- "[Quote 2]"

Conclusion: [2-3 sentences]

SEO Keywords: [5 relevant keywords]
`;

For Social Media Posts

social_media_prompt = """
Create social media posts from this video:

Twitter/X (280 chars max):
[Engaging tweet with key insight]

LinkedIn (professional tone):
[2-3 paragraph professional post]

Instagram Caption:
[Casual, engaging caption with emojis]
[3-5 relevant hashtags]

TikTok/Shorts Description:
[Punchy one-liner that hooks viewers]
"""

For Meeting Notes

const meetingNotesPrompt = `
Extract meeting notes in this format:

📋 Meeting Summary
Attendees: [if mentioned]
Date: [if mentioned]

🎯 Key Decisions:
- Decision 1
- Decision 2

📝 Action Items:
- [ ] Action 1 - Owner: [name]
- [ ] Action 2 - Owner: [name]

💡 Important Discussions:
- Topic 1: Summary
- Topic 2: Summary

⏭️ Next Steps:
- Step 1
- Step 2
`;

YouTube Shorts Support

The API works perfectly with YouTube Shorts:

// Regular video
const regularVideo = 'https://www.youtube.com/watch?v=abc123';

// YouTube Shorts
const shortsVideo = 'https://www.youtube.com/shorts/abc123';

// Both work identically
const regularSummary = await summarizeYouTubeVideo(regularVideo, accessKey);
const shortsSummary = await summarizeYouTubeVideo(shortsVideo, accessKey);

// Shorts often need shorter, punchier summaries
const shortsPrompt = "Summarize this YouTube Short in one powerful sentence.";
const optimizedShortsSummary = await summarizeYouTubeVideo(
  shortsVideo, 
  accessKey, 
  shortsPrompt
);

Response Data Explained

Default Response Fields

{
  "success": true,
  "data": {
    "url": "https://youtube.com/watch?v=...",
    "summary": "AI-generated summary",
    "mainTopics": ["Topic 1", "Topic 2"],
    "keyPoints": ["Point 1", "Point 2"],
    "tone": "Overall tone of the video",
    "targetAudience": "Who the video is for",
    "quotes": ["Notable quote 1", "Notable quote 2"],
    "timeline": "How the video progresses"
  }
}

With Custom Response Fields

Use custom_response parameter to define your own fields:

const customResponse = {
  title: "Video title",
  sentiment: "Overall sentiment",
  isMusic: "Whether it's a music video",
  category: "Video category",
  language: "Primary language"
};

const params = {
  access_key: accessKey,
  url: videoUrl,
  custom_response: JSON.stringify(customResponse)
};

Error Handling & Retries

Implement robust error handling for production:

async function summarizeWithRetry(videoUrl, accessKey, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      const response = await axios.get('https://api.socialkit.dev/youtube/summarize', {
        params: { access_key: accessKey, url: videoUrl },
        timeout: 60000 // 60 second timeout for AI processing
      });
      
      if (response.data.success) {
        return response.data;
      }
      
      throw new Error('API returned unsuccessful response');
    } catch (error) {
      console.error(`Attempt ${i + 1} failed:`, error.message);
      
      // Don't retry on certain errors
      if (error.response?.status === 404) {
        throw new Error('Video not found');
      }
      
      if (i === maxRetries - 1) {
        throw error;
      }
      
      // Exponential backoff
      await new Promise(resolve => setTimeout(resolve, Math.pow(2, i) * 2000));
    }
  }
}

Performance Optimization

Caching Summaries

import hashlib
import json
from functools import lru_cache

# Simple in-memory cache
summary_cache = {}

def get_cached_summary(video_url, access_key, custom_prompt=None):
    """Cache summaries to avoid re-processing"""
    
    # Create cache key
    cache_key = hashlib.md5(
        f"{video_url}{custom_prompt}".encode()
    ).hexdigest()
    
    # Check cache
    if cache_key in summary_cache:
        print(f"Cache hit for {video_url}")
        return summary_cache[cache_key]
    
    # Generate summary
    print(f"Generating summary for {video_url}")
    data = summarize_youtube_video(video_url, access_key, custom_prompt)
    
    # Store in cache
    summary_cache[cache_key] = data
    
    return data

Parallel Processing

async function processManyVideosInParallel(videoUrls, accessKey, concurrency = 5) {
  const results = [];
  
  for (let i = 0; i < videoUrls.length; i += concurrency) {
    const batch = videoUrls.slice(i, i + concurrency);
    
    console.log(`Processing batch ${i / concurrency + 1}...`);
    
    const batchResults = await Promise.allSettled(
      batch.map(url => summarizeYouTubeVideo(url, accessKey))
    );
    
    batchResults.forEach((result, idx) => {
      if (result.status === 'fulfilled') {
        results.push(result.value);
      } else {
        console.error(`Failed to process ${batch[idx]}:`, result.reason);
      }
    });
  }
  
  return results;
}

Pricing

The YouTube Summary API is included in all SocialKit plans:

  • Free: 20 credits (20 video summaries)
  • Basic: $13/month (2,000 credits)
  • Pro: $27/month (10,000 credits)
  • Ultimate: $79/month (50,000 credits)

Each API request costs 1 credit. View full pricing →

Complete YouTube Data Toolkit

Beyond summaries, you might need other YouTube data:

YouTube APIs:

Free YouTube Tools:

Frequently Asked Questions

How accurate are the AI summaries?

The API uses GPT-4 models which provide highly accurate summaries. Quality depends on the video's audio quality and content structure.

Can I control the summary length?

Yes, use custom prompts to specify length: "Summarize in 3 sentences" or "Provide a detailed 2-paragraph summary".

Does it work with videos in other languages?

Yes, the API can summarize videos in multiple languages. You can also request summaries in a specific language.

What about very long videos (> 1 hour)?

The API handles videos of any length. For very long videos, consider requesting timestamped summaries or chapter breakdowns.

Can I extract specific information?

Absolutely! Use custom prompts to extract exactly what you need: quotes, action items, key statistics, etc.

Does it work with YouTube Shorts?

Yes! The API works seamlessly with both regular YouTube videos and Shorts.

Get Started

Ready to start summarizing YouTube videos at scale? Sign up for free and get 20 credits to test the API.

For complete API documentation, visit the YouTube Summary API docs.