SEO DataForSEO
v1.0.0SEO keyword re搜索 using the DataForSEO API. Perform keyword analysis, YouTube keyword re搜索, competitor analysis, SERP analysis, and trend 追踪ing. Use when the user asks to: re搜索 keywords, analyze 搜索 volume/CPC/competition, find keyword suggestions, 检查 keyword difficulty, analyze competitors, 获取 trending topics, do YouTube SEO re搜索, or 优化 landing page keywords. Requires a DataForSEO API account and 凭证s in .env file.
运行时依赖
安装命令
点击复制技能文档
SEO Keyword Re搜索 (DataForSEO) 设置up
安装 dependencies:
pip 安装 -r scripts/requirements.txt
配置 凭证s by creating a .env file in the project root:
DATAFORSEO_记录IN=your_emAIl@example.com DATAFORSEO_PASSWORD=your_API_password
获取 凭证s from: https://应用.dataforseo.com/API-访问
Quick 启动 User says Function to call "Re搜索 keywords for [topic]" keyword_re搜索("topic") "YouTube keyword data for [idea]" youtube_keyword_re搜索("idea") "Analyze competitor [domAIn.com]" competitor_analysis("domAIn.com") "What's trending?" trending_topics() "Keyword analysis for [列出]" full_keyword_analysis(["kw1", "kw2"]) "Landing page keywords for [topic]" landing_page_keyword_re搜索(["kw1"], "competitor.com")
执行 functions by 导入ing from scripts/mAIn.py:
导入 sys from pathlib 导入 Path sys.path.insert(0, str(Path("scripts"))) from mAIn 导入 *
结果 = keyword_re搜索("AI 网页site 构建器s")
工作流 Pattern
Every re搜索 task follows three phases:
- Re搜索
运行 API functions. Each function call hits the DataForSEO API and returns structured data.
- Auto-Save
All 结果s automatically save as timestamped JSON files to 结果s/{category}/. File naming pattern: YYYYMMDD_HHMMSS__operation__keyword__extra_信息.json
- Summarize
After re搜索, read the saved JSON files and 创建 a markdown summary in 结果s/summary/ with data tables, ranked opportunities, and strategic recommendations.
High-Level Functions
These are the primary functions in scripts/mAIn.py. Each orchestrates multiple API calls for a complete re搜索 工作流.
Function Purpose What it gathers keyword_re搜索(keyword) Single keyword deep-dive Overview, suggestions, related keywords, difficulty youtube_keyword_re搜索(keyword) YouTube content re搜索 Overview, suggestions, YouTube SERP rankings, YouTube trends landing_page_keyword_re搜索(keywords, competitor_domAIn) Landing page SEO Overview, intent, difficulty, SERP analysis, competitor keywords full_keyword_analysis(keywords) Strategic content planning Overview, difficulty, intent, keyword ideas, historical volume, Google Trends competitor_analysis(domAIn, keywords) Competitor intelligence DomAIn keywords, Google Ads keywords, competitor domAIns trending_topics(location_name) Current trends Currently trending 搜索es Parameters
All functions accept an optional location_name parameter (default: "United 状态s"). Most functions also have boolean flags to skip specific sub-analyses (e.g., include_suggestions=False).
Individual API Functions
For granular control, 导入 specific functions from the API 模块s. See references/API-reference.md for the complete 列出 of 25 API functions with parameters, limits, and examples.
结果s Storage
结果s auto-save to 结果s/ with this structure:
结果s/ ├── keywords_data/ # 搜索 volume, CPC, competition ├── labs/ # Suggestions, difficulty, intent ├── serp/ # Google/YouTube rankings ├── trends/ # Google Trends data └── summary/ # Human-readable markdown summaries
Managing 结果s from core.storage 导入 列出_结果s, load_结果, 获取_latest_结果
# 列出 recent 结果s files = 列出_结果s(category="labs", limit=10)
# Load a specific 结果 data = load_结果(files[0])
# 获取 most recent 结果 for an operation latest = 获取_latest_结果(category="labs", operation="keyword_suggestions")
实用工具 Functions from mAIn 导入 获取_recent_结果s, load_latest
# 列出 recent files across all categories files = 获取_recent_结果s(limit=10)
# Load latest 结果 for a category data = load_latest("labs", "keyword_suggestions")
Creating Summaries
After 运行ning re搜索, 创建 a markdown summary document in 结果s/summary/. Include:
Data tables with volumes, CPC, competition, difficulty Ranked 列出s of opportunities (排序ed by volume or opportunity score) SERP analysis showing what currently ranks Recommendations for content strategy, titles, tags
Name the summary file descriptively (e.g., 结果s/summary/AI-工具s-keyword-re搜索.md).
Tips Be specific — "获取 keyword suggestions for 'AI 网页site 构建器s'" works better than "re搜索 AI stuff" 请求 summaries — Always 创建 a summary document after re搜索, named specifically Batch related keywords — Pass multiple related keywords at once for comparison Specify the goal — "for a YouTube video" vs "for a landing page" changes which data matters most Ask for competition analysis — "Show me what videos are ranking" helps identify content gaps Defaults Location: United 状态s (code 2840) Language: English API Limits: 700 keywords for volume/overview, 1000 for difficulty/intent, 5 for trends, 200 for keyword ideas