All examples use BASE_URL — set it to your deployment URL.
POST/api/youtube/info
Extract metadata, thumbnails, and embed info from a YouTube video.
const BASE_URL = "http://localhost:3000";
const res = await fetch(`${BASE_URL}/api/youtube/info`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
})
});
const data = await res.json();
// → { success: true, videoId: "dQw4w9WgXcQ", title: "...",
// author: "...", thumbnail: "https://img.youtube.com/...",
// embedUrl: "https://youtube.com/embed/...", ... }