数据提供商: DataForSEO
使用 DataForSEO 对目标网站进行页面级 SEO 浏览分析。
默认输入规模下,每次调用 $0.00015异步运行,需轮询 Run
使用DataForSEO的OnPage功能对某个网站进行爬取,爬取范围受到max_crawl_pages的限制(最多为100个页面),并返回爬取结果摘要:包括域名信息、爬取状态以及整个网站的页面相关数据。响应中的 task id 可用于免费的 OnPage 报告接口(页面、链接、资源、重复内容、关键词密度、微数据、原始 HTML 等);须先在此处启用对应的爬取选项。“完成”意味着这次有范围的爬取行动已经结束,并不表示整个网站已经被完全爬取完毕。
如何调用
第 1 步接入
首次使用时,将提示词粘贴到 Agent 对话中。Skill 会自动安装 CLI 并完成登录。无法使用 shell 的 Agent 可通过 MCP 接入。
接入
set up https://glasser.ai/SKILL.md
Show me how to use the DataForSEO endpoint /v3/on_page/task_post on Glasser.bash
glasser run -p dataforseo -e '/v3/on_page/task_post' -i '{"target":"example.com","max_crawl_pages":10,"calculate_keyword_density":true}' --endpoint-version 4使用接口版本 4。运行前请确认当前价格,并先在开始使用页面安装和登录。
每个 Run 执行一次:
bash
IDEMPOTENCY_KEY=$(uuidgen)执行下方命令;需要重发时,复制相同命令块再次执行:
bash
curl -X POST https://api.glasser.ai/v1/runs \
-H "Authorization: Bearer gl_..." \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{"provider":"dataforseo","endpoint":"/v3/on_page/task_post","input":{"target":"example.com","max_crawl_pages":10,"calculate_keyword_density":true},"endpoint_version":4}'重发时请使用相同的 Idempotency-Key:第二次发送只会读取首个 Run。新的幂等键会创建新的 Run 并产生新的费用。此处使用接口版本 4,运行前请确认当前价格。
第 2 步尝试一个具体任务
制作研究简报时,可以查找与你的主题相关的已发布帖子,将它们用作资料来源。
复制此提示词到你的 Agent,查找研究简报所需的帖子。
提示词
Use dataforseo:/v3/on_page/task_post on Glasser.
Find published content about my topic in the returned posts for a research brief.接口结构
json
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"target",
"max_crawl_pages"
],
"properties": {
"tag": {
"type": "string"
},
"target": {
"type": "string",
"pattern": "^(?!https?:\\/\\/)(?!www\\.)[a-z0-9-]+(?:\\.[a-z0-9-]+)+$",
"maxLength": 253,
"minLength": 1
},
"custom_js": {
"type": "string"
},
"start_url": {
"type": "string",
"pattern": "^https?:\\/\\/",
"maxLength": 2048,
"minLength": 8
},
"enable_xhr": {
"type": "boolean"
},
"check_spell": {
"type": "boolean"
},
"crawl_delay": {
"type": "integer"
},
"switch_pool": {
"type": "boolean"
},
"priority_urls": {
"type": "array"
},
"browser_preset": {
"type": "string"
},
"custom_sitemap": {
"type": "string"
},
"load_resources": {
"type": "boolean"
},
"store_raw_html": {
"type": "boolean"
},
"accept_language": {
"type": "string"
},
"max_crawl_depth": {
"type": "integer"
},
"max_crawl_pages": {
"type": "integer",
"maximum": 100,
"minimum": 1
},
"respect_sitemap": {
"type": "boolean"
},
"support_cookies": {
"type": "boolean"
},
"allow_subdomains": {
"type": "boolean"
},
"checks_threshold": {
"type": "object"
},
"custom_robots_txt": {
"type": "string"
},
"custom_user_agent": {
"type": "string"
},
"enable_javascript": {
"type": "boolean",
"description": "Run the page's scripts. DataForSEO charges extra per page."
},
"allowed_subdomains": {
"type": "array"
},
"crawl_sitemap_only": {
"type": "boolean"
},
"disable_page_checks": {
"type": "array"
},
"browser_screen_width": {
"type": "integer"
},
"check_spell_language": {
"type": "string"
},
"disable_cookie_popup": {
"type": "boolean"
},
"validate_micromarkup": {
"type": "boolean"
},
"browser_screen_height": {
"type": "integer"
},
"disallowed_subdomains": {
"type": "array"
},
"force_sitewide_checks": {
"type": "boolean"
},
"robots_txt_merge_mode": {
"type": "string"
},
"check_spell_exceptions": {
"type": "array"
},
"enable_content_parsing": {
"type": "boolean"
},
"return_despite_timeout": {
"type": "boolean"
},
"disable_sitewide_checks": {
"type": "array"
},
"enable_browser_rendering": {
"type": "boolean",
"description": "Render the page in a full browser (needs enable_javascript and load_resources). DataForSEO charges extra per page."
},
"calculate_keyword_density": {
"type": "boolean"
},
"enable_www_redirect_check": {
"type": "boolean"
},
"browser_screen_scale_factor": {
"anyOf": [
{
"type": "number"
},
{
"enum": [
"Infinity",
"-Infinity",
"NaN"
],
"type": "string"
}
]
}
},
"additionalProperties": false
}json
{
"target": "example.com",
"max_crawl_pages": 10,
"calculate_keyword_density": true
}此接口未发布输出结构。你将收到数据提供商的原始响应正文,我们不会承诺无法保证的输出格式。
计费说明
| 默认输入规模 | 更大的输入和付费选项会随数据提供商的用量而改变费用。 没有返回数据时不收费。 | $0.00015 |
|---|---|---|
| 每次运行的费用上限 | 总费用不会超过此金额。 | $2.55 |
| 数据提供商错误 | 数据提供商未能响应。 | $0.00 |
| 运行超时 | 运行超过时间限制。 | $0.00 |
| 内部错误 | 内部错误导致运行未能完成。 | $0.00 |