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.
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.
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].textStep 3: Post to Slack
Use Slack's Web API to post the summary.
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).
# 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.
# Use Slack Events API: subscribe to message events
# Filter for youtube.com or youtu.be URLs
# Rate limit: one summary per URL per channelPython Example
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
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
Slack bot that auto-posts 3-4 bullet summaries of YouTube videos shared in channels. Includes auto-caption disclaimer.