Sub topic 5
Expanding a seed with modifiers, question words, and letters
This chapter assumes you know what a seed keyword is, how autocomplete suggestions are produced, and that you can read basic Python. Expansion turns one seed into many candidate queries. Every candidate is a lead to check later. None of them is a proven keyword yet.
The three expansion methods
Autocomplete shows only a handful of suggestions per query. To see more, you change the query so that Google returns a different set. Three changes work well.
| Method | What you add | What it surfaces |
|---|---|---|
| Modifiers | A word before or after the seed, such as "for", "vs", "without", "near me" | Comparisons, audiences, constraints, local intent |
| Question words | "what", "why", "how", "when", "can", "is" before the seed | Informational questions |
| Letters | One letter a to z after the seed | Long-tail completions you would not think of |
Build the query list
Modifiers and question words are fixed lists, so you can generate the queries and then type them into Google by hand or pass them to a function.
QUESTION_WORDS = ["what", "why", "how", "when", "can", "is"]
MODIFIERS = ["for", "vs", "without", "near me"]
def build_queries(seed):
queries = [f"{word} {seed}" for word in QUESTION_WORDS]
queries += [f"{seed} {modifier}" for modifier in MODIFIERS]
return queries
print(build_queries("cold brew"))Question words go before the seed and modifiers go after it. Try both positions. "for cold brew" and "cold brew for" can produce different suggestions.
Alphabet expansion
Alphabet expansion appends each letter to the seed, with a space, and records what autocomplete offers. Typing "cold brew a" may suggest "cold brew at home", and "cold brew b" may suggest "cold brew bags".
The function below takes a fetch function that returns a list of suggestions for a query. That keeps the expansion logic separate from the way you collect suggestions. A set removes duplicates, and the sleep keeps the request rate low.
import string
import time
def expand_with_letters(seed, fetch):
ideas = set()
for letter in string.ascii_lowercase:
for suggestion in fetch(f"{seed} {letter}"):
ideas.add(suggestion.lower().strip())
time.sleep(1) # pause between requests
ideas.discard(seed.lower())
return sorted(ideas)
# Example: expand_with_letters("cold brew", suggest)You can run the same loop by hand. Type the seed, a space, and one letter, then copy the suggestions into a spreadsheet. It is slow, but it needs no code and no automated requests.
Common errors
- Forgetting the space. "cold brewa" is read as a single misspelled word. Without the space, you get spelling corrections instead of continuations.
- Treating every suggestion as a keyword. Some suggestions are brand names, misspellings, or one-off phrases. Expansion gives you volume of ideas, not quality.
- Skipping deduplication. Different expanded queries often return the same suggestion. Normalize case and whitespace before you count anything.
- Expanding only forward. Putting the letter or word in front of the seed finds suggestions that appending never reaches.
- Over-expanding a broad seed. A seed like "coffee" returns a wide mix of intents. A narrower seed gives a list you can classify.
- Ignoring result variation. Location, language, and personalization change what autocomplete shows. Note the settings you used so a later run is comparable.
What to do with the output
After pooling and deduplicating, you will have tens or hundreds of phrases. Do not filter them by gut feeling yet. The next steps are to sort them by search intent, check them against the search results, and gather them into topic clusters.
Exercise
You run alphabet expansion on the seed "cold brew" and get the same suggestion, "cold brew coffee", from the queries "cold brew c", "cold brew co", and a question-word query. What should you do with these duplicates, and why does the code call discard(seed.lower())?
Show answer
Keep one copy of the suggestion. A set in Python does this automatically, after you lowercase and strip each suggestion so that small differences in case or spacing do not create false duplicates. discard(seed.lower()) removes the seed itself from the results, because autocomplete can echo the original query, and the seed is not a new idea. Use discard rather than remove because it does not raise an error when the seed is absent.