1,调研Google关键词
调研Google关键词的目的是识别和分析用户在在线搜索中使用的最相关和流行的关键词或短语。这种研究有助于了解搜索趋势、用户行为和偏好,对搜索引擎优化(SEO)、内容创作、在线广告活动以及整体数字营销策略具有重要价值。通过研究Google关键词,企业可以优化其网站和在线内容,提升可见性,增加流量,并有效地吸引目标受众。


发现一个好用的方法,就是加上一些how, why, is, 等等词语,就可以多维度的分析关键词的情况:
参考:https://learnwithhasan.com/develop-keyword-research-tool/

那么怎样编程得到所有关键词,然后把工作转变为微型SaaS:
- 使用谷歌搜索免费API调用
谷歌关键词获取自动提示方法-Google Keyword Suggestions:
Copied!http://google.com/complete/search?output=toolbar&gl=COUNTRY&q=Your_QUERY //当访问这个地址api就会得到关键词列表
访问url,得到以下关键词,那么我们就可以基于自动化编程,获得:

2 . 使用Python自动化和数据抓取
#start
import requests
import xml.etree.ElementTree as ET
# Define Class
class QuestionsExplorer:
def GetQuestions(self, questionType, userInput, countryCode):
questionResults = []
# Build Google Search Query
searchQuery = questionType + " " + userInput + " "
# API Call
googleSearchUrl = "http://google.com/complete/search?output=toolbar&gl=" + \
countryCode + "&q=" + searchQuery
# Call The URL and Read Data
result = requests.get(googleSearchUrl)
tree = ET.ElementTree(ET.fromstring(result.content))
root = tree.getroot()
for suggestion in root.findall('CompleteSuggestion'):
question = suggestion.find('suggestion').attrib.get('data')
questionResults.append(question)
return questionResults
# Get a Keyword From The User
userInput = input("Enter a Keyword: ")
# Create Object of the QuestionsExplorer Class
qObj = QuestionsExplorer()
# Call The Method and pass the parameters
questions = qObj.GetQuestions("is", userInput, "us")
# Loop over the list and pring the questions
for result in questions:
print(result)
print("Done")
#en
github 代码地址: https://github.com/hassancs91/Keyword-Research-tool-python
3 .构建微型SaaS给大众使用
我们可以请教大模型/chatgpt,让它帮忙把python程序转为线上可以访问的代码,提供API, 以下是提示语:
你是一名程序员,现在需要把以下python代码转为 fastapi 提供线上访问: ### #start
import requests
import xml.etree.ElementTree as ET
# Define Class
class QuestionsExplorer:
def GetQuestions(self, questionType, userInput, countryCode):
questionResults = []
# Build Google Search Query
searchQuery = questionType + " " + userInput + " "
# API Call
googleSearchUrl = "http://google.com/complete/search?output=toolbar&gl=" + \
countryCode + "&q=" + searchQuery
# Call The URL and Read Data
result = requests.get(googleSearchUrl)
tree = ET.ElementTree(ET.fromstring(result.content))
root = tree.getroot()
for suggestion in root.findall('CompleteSuggestion'):
question = suggestion.find('suggestion').attrib.get('data')
questionResults.append(question)
return questionResults
# Get a Keyword From The User
userInput = input("Enter a Keyword: ")
# Create Object of the QuestionsExplorer Class
qObj = QuestionsExplorer()
# Call The Method and pass the parameters
questions = qObj.GetQuestions("is", userInput, "us")
# Loop over the list and pring the questions
for result in questions:
print(result)
print("Done")
#en
- 大模型/chatgpt 回答:
以下是将 Python 代码转换为 FastAPI 并提供在线访问所需的代码:
```python
from fastapi import FastAPI
import requests
import xml.etree.ElementTree as ET
app = FastAPI()
# Define Class
class QuestionsExplorer:
def GetQuestions(self, questionType, userInput, countryCode):
questionResults = []
# Build Google Search Query
searchQuery = questionType + " " + userInput + " "
# API Call
googleSearchUrl = "http://google.com/complete/search?output=toolbar&gl=" + \
countryCode + "&q=" + searchQuery
# Call The URL and Read Data
result = requests.get(googleSearchUrl)
tree = ET.ElementTree(ET.fromstring(result.content))
root = tree.getroot()
for suggestion in root.findall('CompleteSuggestion'):
question = suggestion.find('suggestion').attrib.get('data')
questionResults.append(question)
return questionResults
# Get a Keyword From The User
@app.get("/get_questions/")
def get_questions(userInput: str):
# Create Object of the QuestionsExplorer Class
qObj = QuestionsExplorer()
# Call The Method and pass the parameters
questions = qObj.GetQuestions("is", userInput, "us")
return questions
```
这段代码使用 FastAPI 创建了一个名为 `/get_questions/` 的接口,它接受一个名为 `userInput` 的字符串作为输入。当调用这个接口时,它会调用 `QuestionsExplorer` 类中的 `GetQuestions` 方法来获取问题列表,并将其作为响应返回。您可以将此代码部署到服务器上,并通过访问接口来获取用户输入对应的问题列表。
4, 多维度考察搜索关键词:
参考: https://learnwithhasan.com/keyword-research-with-ai/
刚才考察的是 “is” 附带的关键词,这里我们可以多维度考察 关键词的不同层面的情况,附带关键词参数如下:
"Questions": ["who", "what", "where", "when", "why", "how", "are"]
"Prepositions": ["can", "with", "for"]
"Alphabit": list("abcdefghijklmnopqrstuvwxyz")
"Comparisons": ["vs", "versus", "or"]
"Intent-Based": ["buy", "review", "price", "best", "top", "how to", "why to"]
"Time-Related": ["when", "schedule", "deadline", "today", "now", "latest"]
"Audience-Specific": ["for beginners", "for students"]
"Problem-Solving": ["solution", "issue", "error", "troubleshoot", "fix"]
"Feature-Specific": ["with video", "with images", "analytics", "tools"]
"Opinions/Reviews": ["review", "opinion", "rating"]
"Cost-Related": ["price", "cost", "budget", "cheap", "expensive", "value"]
"Trend-Based": ["trends", "new", "upcoming"]
具体代码地址: https://github.com/hassancs91/Keyword-Bomber-Tool

这样得到的关键词就会很丰富,可以用来进一步进行数据分析,利用大模型的语言分析。
大模型提示语:
suggestion_keywords_analysis = """
You are an expert in SEO and data-driven marketing strategies. You am familiar with analyzing keyword data, including metrics like search volume, paid competitors, SEO difficulty, and cost per click.
Using the provided [Keyword_data] categorized into various themes as follows:
Questions: Keywords starting with 'who', 'what', 'where', 'when', 'why', 'how', 'are'.
Prepositions: Keywords including 'can', 'with', 'for'.
Alphabet: Keywords beginning with each letter from A to Z.
Comparisons: Keywords containing 'vs', 'versus', 'or'.
Intent-Based: Keywords with 'buy', 'review', 'price', 'best', 'top', 'how to', 'why to'.
Time-Related: Keywords related to 'when', 'schedule', 'deadline', 'today', 'now', 'latest'.
Audience-Specific: Keywords like 'for beginners', 'for small businesses', 'for students', 'for professionals'.
Problem-Solving: Keywords around 'solution', 'issue', 'error', 'troubleshoot', 'fix'.
Feature-Specific: Keywords with 'with video', 'with images', 'analytics', 'tools', 'with example'.
Opinions/Reviews: Keywords including 'review', 'opinion', 'rating', 'feedback', 'testimonial'.
Cost-Related: Keywords about 'price', 'cost', 'budget', 'cheap', 'expensive', 'value'.
Trend-Based: Keywords like 'trends', 'new', 'upcoming'.
Please analyze these keyword suggestions and provide SEO strategy advice for each category. Focus on:
Content Strategy: Suggest types of content and approaches that could be effective for targeting keywords in each category.
Audience Engagement: Offer insights into how to engage different audience segments based on the keyword categories.
Competitor Analysis: Briefly discuss potential competitive landscapes for these keyword categories.
Long-Term SEO Planning: Provide ideas on incorporating these keywords into a broader SEO strategy, considering their categorical themes.
Provide a list of 7-10 bullet-point suggestions on how to use these keywords, highlighting unique opportunities and challenges they present.
[Keyword_data]: {KEYWORD_DATA}
"""
