Skip to content
Tutorials Center
My learning

Topics

Lesson 13 of 36 ยท Keyword Research

Competitor Analysis and TF-IDF Content Gap Analysis

Learn to identify real search competitors, compare their pages, find topic and keyword gaps with a TF-IDF analysis in Python, and turn findings into a content outline.

Your competitors in search are not always your business competitors. They are the sites that currently occupy the results you want. Studying them shows what searchers and search engines already accept as a good answer: which topics are covered, in what order, with what depth. The aim is not to copy, which would be both unhelpful and risky, but to find what is missing and do it better.

This lesson shows how to pick competitors, what to compare, and how to run a simple content gap analysis using TF-IDF in Python.

Who are your search competitors?

For each important keyword, take the sites on page one. A site that appears for many of your target phrases is a strong competitor. List them in three groups:

  • Direct competitors: sell the same thing to the same audience.
  • Content competitors: publishers, blogs, forums and reference sites that rank for your informational queries, even though they sell nothing like you.
  • Platform competitors: marketplaces and big directories that dominate transactional queries.

Different groups need different strategies. You can out-write a content competitor on a narrow topic, but you will not out-link a marketplace on a head term.

What to compare

For each top-ranking page, note:

Aspect Questions
Format Guide, list, video, tool, product grid?
Depth Word count is a clue, but check sections and subtopics covered
Structure Headings, tables, steps, FAQ, summary
Freshness Published or updated date
Evidence Original data, images, quotes, citations
Experience Page speed, layout, ads, mobile use
Links How many sites link to it (tool data)
Titles How they phrase the promise

Write the findings into a table. After five to ten pages, patterns appear: "all of them have a pricing table", "none mention safety", "everyone is out of date".

A content gap with TF-IDF

One way to see which terms top pages emphasize is to compute TF-IDF across them. Terms that are important in several of the competitor pages but missing from your page are candidates for a gap: subtopics you may need to cover. Treat the result as a prompt for editorial judgment; never as a list of words to paste in.

Try it: find missing terms

The program uses three short competitor texts and one of your own (all invented). It computes TF-IDF for each competitor, averages the scores, and lists high-scoring terms that your page lacks.

Python TF-IDF content gap

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Read the output as questions: Do you cover repotting depth, drainage, root burn, burying the stem? A term used by all three competitors ("repotting", "stem", "mix") is probably expected by searchers; a term used by one may be a differentiator or a quirk.

Term lists are a research aid. Do not add words to "match" a competitor, and do not chase a target score. The page must read well, be accurate and answer the reader's question; then the right terms appear naturally.

Compare topics, not just words

Gaps are often topics, not single words. Take the headings of the top pages and combine them into one outline, noting how many pages cover each topic.

Python Topic coverage matrix

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Topics covered by most competitors are the baseline; topics few cover are chances to stand out. Add original value on top: a tested comparison, a photo series, a checklist, a tool.

Turning findings into an outline

  1. List the baseline topics every good page covers.
  2. Add two or three differentiators competitors lack.
  3. Put the direct answer first and detail after it, in the format the intent needs.
  4. Write the page with your own experience, examples and evidence.
  5. Check your page against the list at the end, and for the quality questions in E-E-A-T and content quality.

Ethics and limits

Analyze, do not copy. Reusing text, images or structure too closely is unhelpful and may break copyright. Competitor analysis tells you what the field looks like; the value you add must be your own.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Who are your search competitors?

    Search competitors are defined by the results pages, which may include sites outside your industry.
  2. 2. How should a list of high TF-IDF terms missing from your page be used?

    Term lists show potential gaps. The goal is complete, natural coverage, not word matching.
  3. 3. A topic covered by three of three top pages and not by yours is best described as what?

    Topics that every good page includes are usually expected by searchers.
  4. 4. Which is a legitimate way to stand out from competitors?

    Original value is what makes a page worth ranking.

Summary

  • Search competitors are whoever ranks for your target queries, not only business rivals.
  • Compare format, depth, structure, freshness, evidence, experience and links.
  • TF-IDF gap analysis and heading matrices reveal missing topics; use them as editorial prompts.
  • Cover the baseline topics, add original value, and never copy.

Next: Title Tags and Meta Descriptions