Lee Foot

H1 to Query Simplifier

Turn promotional H1 headings into the plain search queries behind them, using Claude.

View the source

#about

Rewrites each H1 as the plain Google search query behind it, so "10 Proven Ways to Boost Your Rankings Fast!" becomes "how to improve search rankings".

Each H1 is one Anthropic API call, on Claude Haiku by default, or Claude Sonnet.

Rows that already have an H1_Simplified value are skipped, so re-uploading a partial file resumes the run.

A rate limit, bad key or unknown model stops the run and keeps what is done.

Run it locallyRequires an API key

Platform
Streamlit app you run on your own machine (needs Python 3.x)
Input
Anthropic API keyCSV with a column of H1 headings (Screaming Frog H1-1 auto-detected)
Output
CSV with all original columns plus an H1_Simplified column containing a natural search query for each H1.

Use cases

  • Pre-processing H1 exports before SERP clustering
  • Building keyword-to-page matching datasets from crawl data
  • Normalising promotional headings for search intent analysis

#features

  • Anthropic API: Claude Haiku by default, or Claude Sonnet
  • Resume support: existing H1_Simplified values are skipped
  • Partial results checkpointed every 10 rows
  • Configurable delay between requests (0-2s, default 0.1s)
  • Graceful stop on fatal errors (auth, rate limit, model not found)
  • Auto-detects H1 columns (any column with "h1" in the name)

#how-to-use

  1. Enter your Anthropic API key in the sidebar
  2. Optionally switch the model from Claude Haiku to Claude Sonnet
  3. Upload your CSV and select the H1 column
  4. Click Simplify H1s
  5. Download the CSV with the H1_Simplified column

#faq

Which Anthropic model does it use?
Claude Haiku by default. The sidebar dropdown switches to Claude Sonnet if quality matters more than cost (on the command line, use --model claude-sonnet-5-5). Each H1 is one API call at low effort, with up to 4,000 output tokens including the model's thinking, and only the first line of the reply is kept.
Can I resume a partially completed run?
Yes. If your CSV already has an H1_Simplified column with values, those rows are skipped. Upload the same file (or the partial output from a failed run) and only blank rows will be processed. Results are checkpointed to session state every 10 rows.
What happens if the API rate-limits me?
The tool stops immediately on a rate limit error and preserves all partial results processed so far. You can download what was completed, increase the delay slider (0-2 seconds, default 0.1), and re-upload the file to resume from where it stopped.
Does it work with non-English H1s?
The prompt asks for a natural Google search query without specifying a language, so non-English H1s will typically produce English queries. If you need the output in the original language, edit the prompt in the script.
How does it handle empty or null H1 values?
Rows where the H1 column is NaN or an empty string are skipped entirely and left blank in the output. They do not consume an API call.

/contact

Want me to run this for you? I run this tool as a managed service, or build something custom around your data. You get the insights without touching the code.