Back to Blog
YouTube

YouTube SEO: Reverse-Engineer the Tags & Keywords of Top-Ranking Videos

December 13, 2025
7 min read
S
By SociaVault Team
YouTubeSEOKeyword ResearchRanking Strategy

YouTube SEO: Reverse-Engineer the Tags & Keywords of Top-Ranking Videos

Here's the thing about YouTube SEO that makes it different from web SEO: the videos already ranking for your keyword are openly broadcasting what works. Their titles, descriptions, and tags are all there in the page metadata. If a video is sitting at #1 for "how to bake sourdough," its keyword targeting is — by definition — aligned with what the algorithm rewards for that query. You don't have to guess. You can read it.

Tools like TubeBuddy and VidIQ are built around this idea, and they're good. But if you have a little code in you, you can pull the same raw signal directly from the API and analyze it exactly how you want. This guide builds a small keyword extractor that searches your target term, looks at the top results, and aggregates the tags and title patterns the winners share. JavaScript and Python below.

A quick reality check first

Copying the top videos' tags will not, on its own, vault you to #1. YouTube ranking is dominated by watch time, click-through rate, and audience retention — things tags can't fake. Tags and keyword alignment are a tiebreaker and a relevance signal, not the main event.

So use this the right way: to understand the language and framing that ranks for a topic (which informs your title, your description, your spoken intro, and yes, your tags), not as a magic spell. Great metadata on a video nobody watches still goes nowhere. Good metadata on a genuinely watchable video helps it surface in search and suggested. That's the realistic win.

Step 1: Find who's winning

The search endpoint takes a query and an optional sortBy (relevance or popular).

const API_KEY = process.env.SOCIAVAULT_API_KEY;
const BASE = "https://api.sociavault.com/v1/scrape/youtube";

async function getTopVideos(query) {
  const res = await fetch(
    `${BASE}/search?query=${encodeURIComponent(query)}&sortBy=relevance`,
    { headers: { "x-api-key": API_KEY } },
  );
  const json = await res.json();
  if (!json.success) throw new Error(json.error);
  // Log json.data once to confirm the exact shape of the results list.
  return json.data.videos || [];
}

Step 2: Pull each video's metadata

The video endpoint takes the watch url and returns full metadata, including the keywords/tags YouTube stores but hides from the public UI.

async function getVideoTags(videoUrl) {
  const res = await fetch(`${BASE}/video?url=${encodeURIComponent(videoUrl)}`, {
    headers: { "x-api-key": API_KEY },
  });
  const json = await res.json();
  if (!json.success) return [];
  // YouTube exposes tags as "keywords" in the metadata; read defensively.
  return json.data.keywords || json.data.tags || [];
}

Step 3: Aggregate the winners' tags

Loop the top results, collect every tag, and rank by how many of the top videos use each one. Tags shared across several ranking videos are the strongest relevance signals for that topic.

async function keywordStrategy(targetKeyword) {
  const videos = await getTopVideos(targetKeyword);
  const counts = {};

  for (const v of videos.slice(0, 10)) {
    const url = `https://www.youtube.com/watch?v=${v.videoId || v.id}`;
    const tags = await getVideoTags(url);
    for (const tag of tags) {
      const key = tag.toLowerCase().trim();
      counts[key] = (counts[key] || 0) + 1;
    }
    await new Promise((r) => setTimeout(r, 300));
  }

  return Object.entries(counts)
    .sort(([, a], [, b]) => b - a)
    .slice(0, 20);
}

keywordStrategy("sourdough for beginners").then((tags) => {
  console.log("Most-used tags among top videos:");
  tags.forEach(([tag, n]) => console.log(`  ${tag}${n} videos`));
});

The output is a ranked list of the vocabulary the top videos agree on. That's your keyword shortlist: the phrases worth working into your own title, description, and tags — naturally, not stuffed.

The same idea in Python

import os, time, requests
from collections import Counter

API_KEY = os.environ["SOCIAVAULT_API_KEY"]
BASE = "https://api.sociavault.com/v1/scrape/youtube"
HEADERS = {"x-api-key": API_KEY}

def top_videos(query):
    r = requests.get(f"{BASE}/search",
                     params={"query": query, "sortBy": "relevance"},
                     headers=HEADERS).json()
    return r.get("data", {}).get("videos", [])

def video_tags(url):
    r = requests.get(f"{BASE}/video", params={"url": url}, headers=HEADERS).json()
    if not r.get("success"):
        return []
    d = r["data"]
    return d.get("keywords") or d.get("tags") or []

def keyword_strategy(keyword):
    counts = Counter()
    for v in top_videos(keyword)[:10]:
        vid = v.get("videoId") or v.get("id")
        for tag in video_tags(f"https://www.youtube.com/watch?v={vid}"):
            counts[tag.lower().strip()] += 1
        time.sleep(0.3)
    return counts.most_common(20)

print(keyword_strategy("sourdough for beginners"))

How to actually use the output

Once you've got the ranked tag list, don't just paste all 20 into your tags field. Better:

  1. Title: work the one or two highest-frequency phrases into a title that a human would actually click. Relevance + a compelling hook beats keyword stuffing every time.
  2. Description: use the related phrases naturally in the first two or three sentences, where they carry the most weight.
  3. Tags: add the genuinely relevant ones. Tags are a minor signal, so don't agonize — just don't leave them empty.
  4. Spoken content: YouTube transcribes your audio. Saying your target phrases out loud in the video reinforces the topic better than any tag.

For deeper analysis, you can pull the video transcripts of the top results to see how they actually cover the topic, not just how they tag it.

Frequently Asked Questions

Can you still see YouTube video tags in 2025?

Not in the public UI — YouTube removed tags from the visible page years ago. But the tags still exist in the video's metadata, which is why a tool or API can retrieve them. The code above reads them from the metadata as the keywords field.

Do YouTube tags still matter for ranking?

They're a minor relevance signal, not a major ranking factor. Watch time, click-through rate, and retention dominate. Tags help YouTube understand and disambiguate your topic (useful for less common terms), but they won't rank a video that people don't watch. Treat them as a small, easy win, not a strategy.

How do I find the best keywords for my YouTube video?

Search your target topic, look at the videos already ranking, and extract the tags and title patterns they share — as the code here does. The vocabulary common to the top results is your keyword shortlist. Then build a genuinely watchable video around those terms rather than stuffing them.

Is copying competitors' tags against YouTube's rules?

Tags aren't secret or proprietary, and reading public video metadata is standard SEO research — the same thing TubeBuddy and VidIQ do. The line you shouldn't cross is misleading tagging (tagging your video with unrelated popular terms to hijack traffic), which YouTube's policies prohibit.

How many videos should I analyze per keyword?

The top 10 results is a solid sample — enough to spot the tags and patterns that repeat, without burning excess credits. If a niche is small or the results are inconsistent, widen to 15–20.

Will this work for YouTube Shorts too?

Yes. The search endpoint supports a Shorts filter, and the video endpoint returns metadata for Shorts the same way. The tag and title patterns that work for Shorts often differ from long-form, so analyze them separately rather than mixing the two.

The bottom line

The videos ranking for your keyword are a free, honest answer key for how to target that topic. Extract their tags and title patterns, learn the language that ranks, and fold it into a video people actually want to watch. The metadata gets you found; the watch time keeps you ranked.

Want to run your first analysis? Start free with SociaVault with 50 credits and pull the top results for your keyword.

Found this helpful?

Share it with others who might benefit

Ready to Try SociaVault?

Start extracting social media data with our powerful API. No credit card required.