How to add metadata to youtube video

Contents

  1. Why updating metadata matters
  2. How to add metadata with YouTube Data API
  3. Tips for good metadata
  4. Conclusion

Why updating metadata matters

When you upload a video, the title, description, and tags help viewers find it. Good metadata can boost views. It also tells YouTube what your video is about.

How to add metadata with YouTube Data API

You can use the YouTube Data API v3. You need an API key or OAuth 2.0 client. Here is a Node.js example.

const { google } = require("googleapis");
const youtube = google.youtube("v3");
async function updateVideo() {
  const auth = await google.auth.getClient({
    scopes: ["https://www.googleapis.com/auth/youtube.force-ssl"],
  });

  const requestBody = {
    id: "VIDEO_ID",
    snippet: {
      title: "New Title",
      description: "Updated description of my video",
      tags: ["tag1", "tag2"],
      categoryId: "22",
    },
  };

  const response = await youtube.videos.update({
    auth,
    part: ["snippet"],
    requestBody,
  });

  console.log("Video updated:", response.data);
}

updateVideo().catch(console.error);

This code sets the title, description, tags, and category.

Tips for good metadata

  • Use clear and honest titles.
  • Write a concise description.
  • Include relevant tags.
  • Keep the category correct.
  • Update metadata if content changes.

Conclusion

Adding metadata is easy with the API. Good metadata helps viewers and search. Follow these steps to keep your videos organized.