dataforseo-cli by alexgusevski/dataforseo-cli
npx skills add https://github.com/alexgusevski/dataforseo-cli --skill dataforseo-cli面向 LLM 的关键词研究 CLI。封装 DataForSEO API,默认输出 TSV 格式——紧凑、结构化,并针对智能体上下文窗口进行了优化。
npm: https://www.npmjs.com/package/dataforseo-cli GitHub: https://github.com/alexgusevski/dataforseo-cli
npm install -g dataforseo-cli
dataforseo-cli status
如果凭证已配置,即可开始使用。如果未配置,请进行身份验证:
# 使用登录名 + 密码
dataforseo-cli --set-credentials login=YOUR_LOGIN password=YOUR_PASSWORD
# 或使用 base64 令牌(来自 DataForSEO 邮件)
dataforseo-cli --set-credentials base64=YOUR_BASE64_TOKEN
凭证存储在 ~/.config/dataforseo-cli/config.json 中。locations 和 命令无需凭证即可工作(使用本地数据)。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
languagesstatus — 检查凭证检查 API 凭证是否已配置,无需进行任何 API 调用。
dataforseo-cli status
如果已配置则退出码为 0,未配置则退出码为 1。显示登录用户名(不显示密码)。
volume — 关键词指标获取搜索量、CPC、关键词难度(0–100)、竞争水平以及 12 个月的搜索趋势。
dataforseo-cli volume <keywords...> [options]
参数:
<keywords...> — 一个或多个关键词(必需)。在一次调用中批量处理多个关键词以节省 API 请求次数。选项:
-l, --location <code> — 位置代码(默认:2840 = 美国)--language <code> — 语言代码(默认:en)--json — 输出为 JSON 数组--table / --human — 输出为人类可读的表格示例:
dataforseo-cli volume "seo tools" "keyword research" "backlink checker"
输出(TSV):
keyword volume cpc difficulty competition trend
seo tools 12500 2.35 45 HIGH 14800,13900,12500,12100,11800,12000,12500,13000,12800,12500,12200,11900
difficulty — 0–100 等级(0-30 简单,31-60 中等,61-100 困难)cpc — 每次点击成本(美元)competition — 低 / 中 / 高trend — 12 个月的搜索量,从最新到最旧related — 关键词建议根据种子关键词查找相关的关键词创意。
dataforseo-cli related <seed> [options]
参数:
<seed> — 种子关键词(必需,单个关键词)选项:
-l, --location <code> — 位置代码(默认:2840 = 美国)--language <code> — 语言代码(默认:en)-n, --limit <n> — 最大结果数(默认:50)--json — 输出为 JSON 数组--table / --human — 输出为人类可读的表格示例:
dataforseo-cli related "ai agents" -n 20
输出(TSV):
keyword volume cpc competition difficulty
best ai agents 8100 3.10 0.82 52
ai agent framework 2400 1.85 0.65 38
competitor — 域名关键词分析查看某个域名目前为哪些关键词排名。
dataforseo-cli competitor <domain> [options]
参数:
<domain> — 目标域名(必需,例如 ahrefs.com)选项:
-l, --location <code> — 位置代码(默认:2840 = 美国)--language <code> — 语言代码(默认:en)-n, --limit <n> — 最大结果数(默认:50)--json — 输出为 JSON 数组--table / --human — 输出为人类可读的表格示例:
dataforseo-cli competitor semrush.com -n 10
输出(TSV):
keyword position volume cpc difficulty url
backlink checker 1 33100 4.50 72 https://ahrefs.com/backlink-checker
locations — 查找位置代码列出所有可用的位置代码,或按名称筛选。离线工作——无需 API 凭证。
dataforseo-cli locations [search] [--json]
参数:
[search] — 可选的按名称筛选(例如 sweden, new york)无搜索参数 — 列出所有位置:
dataforseo-cli locations
带搜索参数 — 按名称筛选:
dataforseo-cli locations sweden
输出(TSV):
code name country type
2752 Sweden SE Country
languages — 查找语言代码列出所有可用的语言代码,或按名称筛选。离线工作——无需 API 凭证。
dataforseo-cli languages [search] [--json]
无搜索参数 — 列出所有语言:
dataforseo-cli languages
带搜索参数 — 按名称筛选:
dataforseo-cli languages swedish
输出(TSV):
name code
Swedish sv
所有数据命令默认输出 TSV(制表符分隔值)格式——这是对 LLM 最节省令牌的结构化格式。
| 标志 | 描述 |
|---|---|
| (默认) | TSV — 令牌数最少,最适合智能体管道 |
--json | JSON 数组 — 当需要结构化解析时使用 |
--table / --human | 人类可读的对齐表格 — 供人工审阅 |
结果缓存在 ~/.config/dataforseo-cli/cache/ 中,以避免重复的 API 调用并节省成本。相同的查询 + 位置 + 语言 = 缓存命中。
dataforseo-cli --print-cache
dataforseo-cli volume "your topic"dataforseo-cli related "your topic" -n 30dataforseo-cli competitor competitor-domain.com -n 20volume 命令中批量处理关键词 — DataForSEO 按 API 请求收费,而不是按关键词收费--locationlocations 和 languages 命令查看所有可用选项每周安装数
1
代码仓库
GitHub 星标数
2
首次出现
1 天前
安全审计
安装于
amp1
cline1
openclaw1
opencode1
cursor1
kimi-cli1
LLM-friendly keyword research CLI. Wraps the DataForSEO API and outputs TSV by default — compact, structured, and optimized for agent context windows.
npm: https://www.npmjs.com/package/dataforseo-cli GitHub: https://github.com/alexgusevski/dataforseo-cli
npm install -g dataforseo-cli
dataforseo-cli status
If credentials are already configured, you're good to go. If not, authenticate:
# With login + password
dataforseo-cli --set-credentials login=YOUR_LOGIN password=YOUR_PASSWORD
# Or with base64 token (from DataForSEO email)
dataforseo-cli --set-credentials base64=YOUR_BASE64_TOKEN
Credentials are stored in ~/.config/dataforseo-cli/config.json. The locations and languages commands work without credentials (local data).
status — Check credentialsCheck if API credentials are configured without making any API calls.
dataforseo-cli status
Exits 0 if configured, exits 1 if not. Shows login username (not password).
volume — Keyword metricsGet search volume, CPC, keyword difficulty (0–100), competition level, and 12-month search trend.
dataforseo-cli volume <keywords...> [options]
Arguments:
<keywords...> — One or more keywords (required). Batch multiple keywords in one call to save API requests.Options:
-l, --location <code> — Location code (default: 2840 = US)--language <code> — Language code (default: en)--json — Output as JSON array--table / --human — Output as human-readable tableExample:
dataforseo-cli volume "seo tools" "keyword research" "backlink checker"
Output (TSV):
keyword volume cpc difficulty competition trend
seo tools 12500 2.35 45 HIGH 14800,13900,12500,12100,11800,12000,12500,13000,12800,12500,12200,11900
difficulty — 0–100 scale (0-30 easy, 31-60 medium, 61-100 hard)cpc — Cost per click in USDcompetition — LOW / MEDIUM / HIGHtrend — 12 monthly search volumes, newest firstrelated — Keyword suggestionsFind related keyword ideas from a seed keyword.
dataforseo-cli related <seed> [options]
Arguments:
<seed> — Seed keyword (required, single keyword)Options:
-l, --location <code> — Location code (default: 2840 = US)--language <code> — Language code (default: en)-n, --limit <n> — Max results (default: 50)--json — Output as JSON array--table / --human — Output as human-readable tableExample:
dataforseo-cli related "ai agents" -n 20
Output (TSV):
keyword volume cpc competition difficulty
best ai agents 8100 3.10 0.82 52
ai agent framework 2400 1.85 0.65 38
competitor — Domain keyword analysisSee what keywords a domain currently ranks for.
dataforseo-cli competitor <domain> [options]
Arguments:
<domain> — Target domain (required, e.g. ahrefs.com)Options:
-l, --location <code> — Location code (default: 2840 = US)--language <code> — Language code (default: en)-n, --limit <n> — Max results (default: 50)--json — Output as JSON array--table / --human — Output as human-readable tableExample:
dataforseo-cli competitor semrush.com -n 10
Output (TSV):
keyword position volume cpc difficulty url
backlink checker 1 33100 4.50 72 https://ahrefs.com/backlink-checker
locations — Look up location codesList all available location codes, or filter by name. Works offline — no API credentials needed.
dataforseo-cli locations [search] [--json]
Arguments:
[search] — Optional filter by name (e.g. sweden, new york)Without search — lists all locations:
dataforseo-cli locations
With search — filters by name:
dataforseo-cli locations sweden
Output (TSV):
code name country type
2752 Sweden SE Country
languages — Look up language codesList all available language codes, or filter by name. Works offline — no API credentials needed.
dataforseo-cli languages [search] [--json]
Without search — lists all languages:
dataforseo-cli languages
With search — filters by name:
dataforseo-cli languages swedish
Output (TSV):
name code
Swedish sv
All data commands default to TSV (tab-separated values) — the most token-efficient structured format for LLMs.
| Flag | Description |
|---|---|
| (default) | TSV — fewest tokens, best for agent pipelines |
--json | JSON array — use when you need structured parsing |
--table / --human | Human-readable aligned table — for human review |
Results are cached in ~/.config/dataforseo-cli/cache/ to avoid duplicate API calls and save costs. Same query + location + language = cache hit.
dataforseo-cli --print-cache
dataforseo-cli volume "your topic"dataforseo-cli related "your topic" -n 30dataforseo-cli competitor competitor-domain.com -n 20volume — DataForSEO charges per API request, not per keyword--location for local/international SEOlocations and languages without arguments to see all available optionsWeekly Installs
1
Repository
GitHub Stars
2
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketFailSnykFail
Installed on
amp1
cline1
openclaw1
opencode1
cursor1
kimi-cli1
Excel财务建模规范与xlsx文件处理指南:专业格式、零错误公式与数据分析
42,000 周安装