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
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 emptyYes
No
No steps
collectedOn.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 tabErrorTry
sheetTab in spreadsheetUrl.Create the tab sheetTab in spreadsheetUrl.tabIsNew to true.Change tabIsNew to true.On error
tabIsNew is yesIf tabIsNew is yesYes
sheetTab in spreadsheetUrl.Add a row to sheetTab in spreadsheetUrl.No
No steps
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 emptyYes
No
No steps
reply 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 fetchErrorTry
keywordApiUrl and save it as reply.Send data to keywordApiUrl and save it as reply.fetchOk to true.Change fetchOk to true.On error
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 noYes
No
No steps
ideaList 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 shapeErrorTry
ideaList and save it as ideaCount.Count the items in ideaList and save it as ideaCount.On error
ideaCount is greater than 0If ideaCount is greater than 0Yes
recordedForTopic 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 maxIdeasPerTopicYes
No
No steps
term 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 entryErrorTry
idea.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.On error
entryOk is yes and term isn't empty If entryOk is yes and term isn't emptyYes
sheetTab 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.No
No steps
No
No steps
ideasRecorded is 0If ideasRecorded is 0Yes
seedTopics 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.No
No steps
shortlistErrorIf a step below fails, save the error as shortlistErrorTry
seedTopics.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.On error
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.