360 Secure SkillHub
360 安全技能中心

seo-dataforseo

通过 Python 脚本调用 DataForSEO API,查询关键词搜索量、CPC、难度、意图、SERP 与 YouTube 排名、竞争对手域名及 Google Trends;结果以结构化数据返回,可选保存 JSON 或生成摘要文件。需要 DataForSEO 登录凭据,默认不写盘。

分类:营销
adamkristopher
adamkristopher
热度 63.29
最近更新 2026-11-29 02:52:00

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add adamkristopher/seo-dataforseo
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
seo-dataforseo
description
SEO keyword research with the DataForSEO API: search volume, CPC, keyword ideas, difficulty, intent, SERP and YouTube rankings, competitor domains and Google Trends. Use when the user asks to research keywords, check search volume or difficulty, analyze competitors, find trending topics, or plan YouTube or landing-page SEO. Sends the user's keywords and domains to DataForSEO (a paid API) using their DataForSEO login from .env. Saves nothing to disk unless SAVE_RESULTS=true.
version
1.1.1
homepage
https://github.com/adamkristopher/clawhub-skills/tree/main/seo-dataforseo
metadata
{"openclaw":{"homepage":"https://github.com/adamkristopher/clawhub-skills/tree/main/seo-dataforseo","primaryEnv":"DATAFORSEO_PASSWORD","requires":{"bins":["python3","pip"],"env":["DATAFORSEO_LOGIN","DATAFORSEO_PASSWORD"]},"envVars":[{"name":"DATAFORSEO_LOGIN","required":true,"description":"DataForSEO API login (your account email). Sent only to api.dataforseo.com."},{"name":"DATAFORSEO_PASSWORD","required":true,"description":"DataForSEO API password (not your dashboard password). Sent only to api.dataforseo.com."},{"name":"SAVE_RESULTS","required":false,"description":"The only way to turn saving on - set to true to save results as JSON under ./results. Off by default. A call's save false can still skip saving."},{"name":"RESULTS_DIR","required":false,"description":"Where saved results go if SAVE_RESULTS is true. Default ./results in the working directory."}]}}

SEO Keyword Research (DataForSEO)

What this skill does with your data

  • Network: every function calls the DataForSEO API (https://api.dataforseo.com) and nothing else. DataForSEO bills your account per request.
  • What's sent: the keywords, seed terms, competitor domains, location and language you ask about, plus your DataForSEO login. Don't research anything you wouldn't share with DataForSEO.
  • Credentials: read from .env in the working directory (DATAFORSEO_LOGIN, DATAFORSEO_PASSWORD). Use DataForSEO's API password, never your account password, and keep .env out of version control.
  • Files: nothing is written unless you set SAVE_RESULTS=true; no function argument can turn saving on. Saved files are readable only by you (0600) and can only go in the results/ folders listed below.

Setup

Install the pinned dependencies (a virtual environment is best):

python3 -m venv .venv && . .venv/bin/activate
pip install -r scripts/requirements.txt

Configure credentials by creating a .env file in the project root:

DATAFORSEO_LOGIN=your_email@example.com
DATAFORSEO_PASSWORD=your_api_password

Get credentials from: https://app.dataforseo.com/api-access

To keep results on disk, also add SAVE_RESULTS=true (see Results Storage). That's the only switch.

Quick Start

User says Function to call
"Research keywords for [topic]" keyword_research("topic")
"YouTube keyword data for [idea]" youtube_keyword_research("idea")
"Analyze competitor [domain.com]" competitor_analysis("domain.com")
"What's trending?" trending_topics()
"Keyword analysis for [list]" full_keyword_analysis(["kw1", "kw2"])
"Landing page keywords for [topic]" landing_page_keyword_research(["kw1"], "competitor.com")

Execute functions by importing from scripts/main.py:

import sys
from pathlib import Path
sys.path.insert(0, str(Path("scripts")))
from main import *

result = keyword_research("AI website builders")

Workflow Pattern

Every research task follows two phases:

1. Research

Run API functions. Each call hits the DataForSEO API and returns structured data to you. Nothing is written to disk.

2. Summarize

Summarize the returned data for the user: data tables, ranked opportunities and recommendations. Write a summary file only if the user asks for one.

Saving (opt-in): only with SAVE_RESULTS=true in .env is each result also saved as timestamped JSON in results/{category}/ (YYYYMMDD_HHMMSS__operation__keyword__extra_info.json).

High-Level Functions

These are the primary functions in scripts/main.py. Each orchestrates multiple API calls for a complete research workflow.

Function Purpose What it gathers
keyword_research(keyword) Single keyword deep-dive Overview, suggestions, related keywords, difficulty
youtube_keyword_research(keyword) YouTube content research Overview, suggestions, YouTube SERP rankings, YouTube trends
landing_page_keyword_research(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 searches

Parameters

All functions accept an optional location_name parameter (default: "United States"). Most functions also have boolean flags to skip specific sub-analyses (e.g., include_suggestions=False).

Individual API Functions

For granular control, import specific functions from the API modules. See references/api-reference.md for the complete list of 25 API functions with parameters, limits, and examples.

Results Storage (only if you opt in)

Off by default. Only with SAVE_RESULTS=true are results saved to results/ (or RESULTS_DIR) with this structure. Categories are fixed: other names are refused, and files are only read from inside results/.

results/
├── keywords_data/    # Search volume, CPC, competition
├── labs/             # Suggestions, difficulty, intent
├── serp/             # Google/YouTube rankings
├── trends/           # Google Trends data
└── summary/          # Human-readable markdown summaries

Managing Results

from core.storage import list_results, load_result, get_latest_result

# List recent results
files = list_results(category="labs", limit=10)

# Load a specific result
data = load_result(files[0])

# Get most recent result for an operation
latest = get_latest_result(category="labs", operation="keyword_suggestions")

Utility Functions

from main import get_recent_results, load_latest

# List recent files across all categories
files = get_recent_results(limit=10)

# Load latest result for a category
data = load_latest("labs", "keyword_suggestions")

Creating Summaries

When the user wants a summary file, write it to results/summary/ (and tell them where). Include:

  • Data tables with volumes, CPC, competition, difficulty
  • Ranked lists of opportunities (sorted by volume or opportunity score)
  • SERP analysis showing what currently ranks
  • Recommendations for content strategy, titles, tags

Name the summary file descriptively (e.g., results/summary/ai-tools-keyword-research.md).

Tips

  1. Be specific — "Get keyword suggestions for 'AI website builders'" works better than "research AI stuff"
  2. Request summaries — Ask for a summary document after research if you want one on disk
  3. Batch related keywords — Pass multiple related keywords at once for comparison
  4. Specify the goal — "for a YouTube video" vs "for a landing page" changes which data matters most
  5. Ask for competition analysis — "Show me what videos are ranking" helps identify content gaps

Defaults

  • Location: United States (code 2840)
  • Language: English
  • API Limits: 700 keywords for volume/overview, 1000 for difficulty/intent, 5 for trends, 200 for keyword ideas