Tutorial

How to Build a YouTube-to-Slack Summary Bot

Build a bot that posts YouTube video summaries to Slack using Scavio's transcript endpoint and an LLM. Full Python walkthrough.

An r/Slack user built a bot that posts YouTube summaries and people actually read them. This tutorial walks the full pipeline: YouTube URL → transcript → LLM summary → Slack post.

Prerequisites

  • Scavio API key
  • Slack app with chat:write + channels:history permissions
  • OpenAI or Anthropic API key for summarization

Walkthrough

Step 1: Get the YouTube transcript

Use Scavio's YouTube transcript endpoint to extract text.

Python
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}

def get_transcript(video_url):
    r = requests.post('https://api.scavio.dev/api/v1/search',
        headers=H,
        json={'platform': 'youtube', 'query': video_url, 'type': 'transcript'})
    return r.json()

Step 2: Summarize with an LLM

Feed the transcript to an LLM with a summary prompt.

Python
from anthropic import Anthropic
client = Anthropic()

def summarize(transcript_text):
    msg = client.messages.create(
        model='claude-sonnet-4-6',
        max_tokens=300,
        messages=[{'role': 'user', 'content': f'Summarize this video transcript in 3-4 bullet points. Be specific about key claims and numbers.\n\n{transcript_text}'}])
    return msg.content[0].text

Step 3: Post to Slack

Use Slack's Web API to post the summary.

Python
from slack_sdk import WebClient
slack = WebClient(token=os.environ['SLACK_BOT_TOKEN'])

def post_summary(channel, video_title, summary, url):
    slack.chat_postMessage(
        channel=channel,
        text=f'*{video_title}*\n{summary}\n<{url}|Watch video>')

Step 4: Handle auto-caption gotchas

Add a disclaimer when transcripts are auto-generated (they can mangle names and numbers).

Python
# Add after summarization:
disclaimer = '(Summary from auto-generated captions - names/numbers may be approximate)'

Step 5: Wire up the trigger

Listen for YouTube URLs posted in Slack channels and auto-summarize.

Python
# Use Slack Events API: subscribe to message events
# Filter for youtube.com or youtu.be URLs
# Rate limit: one summary per URL per channel

Python Example

Python
import requests, os
from anthropic import Anthropic
from slack_sdk import WebClient

H = {'x-api-key': os.environ['SCAVIO_API_KEY']}
client = Anthropic()
slack = WebClient(token=os.environ['SLACK_BOT_TOKEN'])

def youtube_to_slack(video_url, channel):
    transcript = requests.post('https://api.scavio.dev/api/v1/search',
        headers=H, json={'platform': 'youtube', 'query': video_url, 'type': 'transcript'}).json()
    summary = client.messages.create(model='claude-sonnet-4-6', max_tokens=300,
        messages=[{'role': 'user', 'content': f'Summarize in 3-4 bullets:\n{transcript}'}]).content[0].text
    slack.chat_postMessage(channel=channel, text=f'{summary}\n<{video_url}|Watch>')

JavaScript Example

JavaScript
const resp = await fetch('https://api.scavio.dev/api/v1/search', {
  method: 'POST', headers: {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'},
  body: JSON.stringify({platform: 'youtube', query: videoUrl, type: 'transcript'})
});
const transcript = await resp.json();

Expected Output

JSON
Slack bot that auto-posts 3-4 bullet summaries of YouTube videos shared in channels. Includes auto-caption disclaimer.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Scavio API key. Slack app with chat:write + channels:history permissions. OpenAI or Anthropic API key for summarization. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Build a bot that posts YouTube video summaries to Slack using Scavio's transcript endpoint and an LLM. Full Python walkthrough.