Overview
Searches YouTube for videos on a topic, extracts metadata (title, channel, views, description), and creates formatted Markdown notes in an Obsidian vault with interlinks and tags.
Trigger
Manual trigger or daily cron for tracked topics
Schedule
Manual or daily for tracked topics
Workflow Steps
Define research topic
Specify the topic to research on YouTube and the Obsidian vault path for output notes.
Search YouTube via API
Query Scavio's YouTube search endpoint for the topic. Retrieve top 10-20 results with metadata.
Extract video metadata
For each result, extract title, channel name, view count, publish date, description snippet, and URL.
Generate Obsidian notes
Create a Markdown file per video with YAML frontmatter (tags, date, channel) and body content with the video details.
Create index note
Generate a topic index note that links to all individual video notes for the research session.
Add to vault
Write all generated Markdown files to the Obsidian vault directory.
Python Implementation
import requests, os, json
from datetime import date
H = {"x-api-key": os.environ["SCAVIO_API_KEY"]}
VAULT = os.path.expanduser("~/Documents/Obsidian/Research")
def youtube_to_obsidian(topic, max_results=10):
r = requests.post("https://api.scavio.dev/api/v1/search", headers=H,
json={"platform": "youtube", "query": topic}, timeout=10).json()
notes = []
for video in r.get("organic", [])[:max_results]:
title = video.get("title", "Untitled")
slug = title.lower().replace(" ", "-")[:50]
note = f"""---
title: "{title}"
channel: "{video.get('channel', 'Unknown')}"
date: {date.today()}
tags: [youtube, {topic.replace(' ', '-')}]
---
# {title}
- **Channel:** {video.get('channel', 'Unknown')}
- **Views:** {video.get('views', 'N/A')}
- **URL:** {video.get('link', '')}
## Summary
{video.get('snippet', 'No description available.')}
"""
filepath = os.path.join(VAULT, f"{slug}.md")
with open(filepath, "w") as f:
f.write(note)
notes.append(slug)
print(f"Created {len(notes)} notes for topic: {topic}")
youtube_to_obsidian("search api tutorial")JavaScript Implementation
import fs from "fs";
import path from "path";
const H = {"x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json"};
const VAULT = path.join(process.env.HOME, "Documents/Obsidian/Research");
async function youtubeToObsidian(topic, maxResults = 10) {
const r = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST", headers: H,
body: JSON.stringify({platform: "youtube", query: topic})
}).then(r => r.json());
for (const video of (r.organic || []).slice(0, maxResults)) {
const slug = (video.title || "untitled").toLowerCase().replace(/ /g, "-").slice(0, 50);
const note = "---\ntitle: " + video.title + "\nchannel: " + video.channel +
"\ntags: [youtube]\n---\n\n# " + video.title +
"\n\n" + (video.snippet || "");
fs.writeFileSync(path.join(VAULT, slug + ".md"), note);
}
}Platforms Used
YouTube
Video search with transcripts and metadata