Resources
2Install
npx skillscat add yanglei1826877278/myskills/skills-seo-keyword-difficulty Install via the SkillsCat registry.
SKILL.md
关键词难度分析
前置条件
在 ~/.seo-skills/config.json 中配置 CapSolver API Key:
{
"CAPSOLVER_API_KEY": "CAP-你的API密钥"
}需要安装 Python 依赖:requests
使用方法
运行脚本(脚本位于本 skill 目录的 scripts/ 下):
python scripts/run.py --keyword <关键词> [--country <国家代码>]参数说明
| 参数 | 必填 | 默认值 | 说明 | 示例 |
|---|---|---|---|---|
--keyword |
✅ | - | 要分析的关键词 | "seo tools" |
--country |
❌ | us |
国家代码 | cn、uk、de |
使用示例
# 分析 "python tutorial" 在美国的关键词难度
python scripts/run.py --keyword "python tutorial"
# 分析在中国市场的难度
python scripts/run.py --keyword "python教程" --country cn输出格式
脚本以 JSON 格式输出到 stdout:
{
"difficulty": 45,
"shortage": 0,
"lastUpdate": "2024-01-15",
"serp": {
"results": [
{
"title": "排名页面标题",
"url": "https://example.com/page",
"position": 1,
"domainRating": 85,
"urlRating": 42,
"traffic": 5000,
"keywords": 320,
"topKeyword": "example keyword",
"topVolume": 8000
}
]
}
}字段说明
difficulty:关键词难度评分(0-100,越高越难排名)shortage:关键词稀缺度lastUpdate:数据最后更新时间serp.results[]:搜索结果排名页面列表title:页面标题url:页面 URLposition:排名位置domainRating:域名评级 (DR)urlRating:URL 评级 (UR)traffic:该页面预估流量keywords:该页面排名的关键词总数topKeyword:最高排名关键词topVolume:最高排名关键词的搜索量
难度评分参考
| 范围 | 难度等级 | 说明 |
|---|---|---|
| 0-10 | 非常容易 | 新站也可尝试 |
| 11-30 | 容易 | 需少量外链 |
| 31-50 | 中等 | 需一定权威度 |
| 51-70 | 较难 | 需大量高质量外链 |
| 71-100 | 极难 | 顶级域名才可竞争 |
错误处理
- 错误信息以 JSON 格式输出到 stderr:
{"error": "错误描述"} - 脚本返回退出码 1 表示失败
- 常见错误:未配置 API Key、验证码解决失败、API 请求失败
注意事项
- 仅解析有机搜索结果(排除广告等)
- 每次请求都需要获取新的验证码 Token,会消耗 CapSolver 余额
- 常用国家代码:
us、uk、ca、au、de、fr、es、it、jp、cn