Expands the topics you already rank for into related search terms with their monthly volumes, appended to a Google Sheet.
Uses
Claude
Google Sheets
Keyword ideas from your seed topics
At 08:00 on the first of each month, the topics you already rank for are sent to your own keyword data endpoint, and every related term it returns is appended to a Google Sheet with its monthly search volume. It finds the terms you have not written about yet rather than measuring the pages you have.
You end up with a 'Keyword ideas' tab with one row per idea: date collected, seed topic, keyword and monthly searches. Nothing is overwritten, so the sheet also shows how each term's volume moves month to month. An idea missing a keyword or a numeric volume is skipped rather than written as a blank row, a topic the endpoint cannot answer for is reported and passed over, and a cap per topic stops an endpoint flooding the sheet. Once the ideas are saved, AI picks the five worth writing about next and shows the shortlist on the run.
You need your seed topics, a keyword endpoint that returns related terms with search volumes and its key, and a Google Sheet for the history.
seedTopics to blank.Set seedTopics to blank.keywordApiUrl to blank.Set keywordApiUrl to blank.keywordApiKey to blank.Set keywordApiKey to blank.spreadsheetUrl to blank.Set spreadsheetUrl to blank.sheetTab to Keyword ideas.Set sheetTab to Keyword ideas.maxIdeasPerTopic to 25.Set maxIdeasPerTopic to 25.country to us.Set country to us.keywordApiUrl and save it as keywordApiUrl.Trim keywordApiUrl and save it as keywordApiUrl.keywordApiUrl is emptyIf keywordApiUrl is emptycollectedOn.Get today's date and save it as collectedOn.tabIsNew to false.Set tabIsNew to false.tabErrorIf a step below fails, save the error as tabErrorsheetTab in spreadsheetUrl.Create the tab sheetTab in spreadsheetUrl.tabIsNew to true.Change tabIsNew to true.tabIsNew is yesIf tabIsNew is yessheetTab in spreadsheetUrl.Add a row to sheetTab in spreadsheetUrl.seedTopics by , and save it as topics.Split seedTopics by , and save it as topics.ideasRecorded to 0.Set ideasRecorded to 0.ideaLines to an empty list.Set ideaLines to an empty list.topic in topics:For each topic in topics:topic and save it as seed.Trim topic and save it as seed.seed is emptyIf seed is emptyreply to an empty record.Set reply to an empty record.fetchOk to false.Set fetchOk to false.fetchErrorIf a step below fails, save the error as fetchErrorkeywordApiUrl and save it as reply.Send data to keywordApiUrl and save it as reply.fetchOk to true.Change fetchOk to true.fetchError.message with keywordApiUrl replaced by the endpoint address.Show in the output: Could not fetch keyword ideas for '@seed': fetchError.message with keywordApiUrl replaced by the endpoint address.fetchOk is noIf fetchOk is noideaList to reply.body.keywords.Set ideaList to reply.body.keywords.ideaCount to 0.Set ideaCount to 0.shapeErrorIf a step below fails, save the error as shapeErrorideaList and save it as ideaCount.Count the items in ideaList and save it as ideaCount.ideaCount is greater than 0If ideaCount is greater than 0recordedForTopic to 0.Set recordedForTopic to 0.idea in ideaList:For each idea in ideaList:recordedForTopic is greater than or equal to maxIdeasPerTopic If recordedForTopic is greater than or equal to maxIdeasPerTopicterm to blank. Set term to blank.volume to 0. Set volume to 0.entryOk to false. Set entryOk to false.entryError If a step below fails, save the error as entryErroridea.keyword and save it as term.Trim idea.keyword and save it as term.idea.search_volume to the nearest integer and save it as volume.Round idea.search_volume to the nearest integer and save it as volume.entryOk to true.Change entryOk to true.entryOk is yes and term isn't empty If entryOk is yes and term isn't emptysheetTab in spreadsheetUrl.Add a row to sheetTab in spreadsheetUrl.recordedForTopic.Add 1 to recordedForTopic.ideasRecorded.Add 1 to ideasRecorded.term - volume searches a month to the end of ideaLines and save it as ideaLines.Add term - volume searches a month to the end of ideaLines and save it as ideaLines.ideasRecorded is 0If ideasRecorded is 0seedTopics this month, so nothing was recorded. Check the 'keywordApiUrl' and 'keywordApiKey' steps if this repeats.Finish the run: No keyword ideas came back for seedTopics this month, so nothing was recorded. Check the 'keywordApiUrl' and 'keywordApiKey' steps if this repeats.shortlistErrorIf a step below fails, save the error as shortlistErrorseedTopics.Ask Claude: 'You are helping a marketer decide what to write next. Below are keyword ideas collected this month for these topics: seedTopics.
Each line is a search term and how many times it is searched a month.
ideaLines joined by a new line truncated to 6000 characters
Pick the five worth writing about next and give one short reason for each, based only on the lines above. Reply as a plain list with no preamble.'. Save it as suggestion.
Maximum response length: 600suggestion.response_text.ideasRecorded keyword ideas to the '@sheetTab' tab. No shortlist was produced this run - connect Claude on the 'suggestion' step to get one.Show in the output: Saved ideasRecorded keyword ideas to the '@sheetTab' tab. No shortlist was produced this run - connect Claude on the 'suggestion' step to get one.