返回顶部
x

xcrawl-scrapeXCrawl抓取

Use this skill for XCrawl scrape tasks, including single-URL fetch, format selection, sync or async execution, and JSON extraction with prompt or json_schema.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.2
安全检测
已通过
1,036
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

xcrawl-scrape

XCrawl Scrape

概述

该技能使用 XCrawl Scrape API 处理单页提取。
默认行为为原始透传:按原样返回上游 API 响应体。

所需本地配置

使用此技能前,用户必须创建本地配置文件并写入 XCRAWLAPIKEY。

路径:~/.xcrawl/config.json

json
{
XCRAWLAPIKEY: apikey>
}

仅从本地配置文件读取 API 密钥。无需全局环境变量。

积分与账户设置

使用 XCrawl API 会消耗积分。
如果用户没有账户或可用积分,引导其前往 https://dash.xcrawl.com/ 注册。
注册后,可在运行请求前激活免费的 1000 积分套餐。

工具权限策略

仅请求 curl 和 node 的运行时权限。
不请求 Python、Shell 辅助脚本或其他运行时权限。

API 接口

  • - 开始抓取:POST /v1/scrape
  • 读取异步结果:GET /v1/scrape/{scrapeid}
  • 基础 URL:https://run.xcrawl.com
  • 必需请求头:Authorization: Bearer API_KEY>

使用示例

cURL(同步)

bash
APIKEY=$(node -e const fs=require(fs);const p=process.env.HOME+/.xcrawl/config.json;const k=JSON.parse(fs.readFileSync(p,utf8)).XCRAWLAPI_KEY||;process.stdout.write(k))

curl -sS -X POST https://run.xcrawl.com/v1/scrape \
-H Content-Type: application/json \
-H Authorization: Bearer ${API_KEY} \
-d {url:https://example.com,mode:sync,output:{formats:[markdown,links]}}

cURL(异步创建 + 结果)

bash
APIKEY=$(node -e const fs=require(fs);const p=process.env.HOME+/.xcrawl/config.json;const k=JSON.parse(fs.readFileSync(p,utf8)).XCRAWLAPI_KEY||;process.stdout.write(k))

CREATE_RESP=$(curl -sS -X POST https://run.xcrawl.com/v1/scrape \
-H Content-Type: application/json \
-H Authorization: Bearer ${API_KEY} \
-d {url:https://example.com/product/1,mode:async,output:{formats:[json]},json:{prompt:提取标题和价格。}})

echo $CREATE_RESP

SCRAPEID=$(node -e const s=process.argv[1];const j=JSON.parse(s);process.stdout.write(j.scrapeid||) $CREATE_RESP)

curl -sS -X GET https://run.xcrawl.com/v1/scrape/${SCRAPE_ID} \
-H Authorization: Bearer ${API_KEY}

Node

bash
node -e
const fs=require(fs);
const apiKey=JSON.parse(fs.readFileSync(process.env.HOME+/.xcrawl/config.json,utf8)).XCRAWLAPIKEY;
const body={url:https://example.com,mode:sync,output:{formats:[markdown,json]},json:{prompt:提取标题和发布日期。}};
fetch(https://run.xcrawl.com/v1/scrape,{
method:POST,
headers:{Content-Type:application/json,Authorization:Bearer ${apiKey}},
body:JSON.stringify(body)
}).then(async r=>{console.log(await r.text());});

请求参数

请求端点与请求头

  • - 端点:POST https://run.xcrawl.com/v1/scrape
  • 请求头:
  • Content-Type: application/json
  • Authorization: Bearer

请求体:顶层字段

字段类型必需默认值描述
url字符串-目标 URL
mode
字符串 | 否 | sync | sync 或 async | | proxy | 对象 | 否 | - | 代理配置 | | request | 对象 | 否 | - | 请求配置 | | js_render | 对象 | 否 | - | JS 渲染配置 | | output | 对象 | 否 | - | 输出配置 | | webhook | 对象 | 否 | - | 异步 Webhook 配置(mode=async) |

proxy

字段类型必需默认值描述
location字符串USISO-3166-1 alpha-2 国家代码,例如 US / JP / SG
sticky_session
字符串 | 否 | 自动生成 | 粘性会话 ID;相同 ID 会尝试复用出口 |

request

字段类型必需默认值描述
locale字符串en-US,en;q=0.9影响 Accept-Language
device
字符串 | 否 | desktop | desktop / mobile;影响 UA 和视口 | | cookies | 对象映射 | 否 | - | Cookie 键值对 | | headers | 对象映射 | 否 | - | 请求头键值对 | | onlymaincontent | 布尔值 | 否 | true | 仅返回主要内容 | | block_ads | 布尔值 | 否 | true | 尝试屏蔽广告资源 | | skiptlsverification | 布尔值 | 否 | true | 跳过 TLS 验证 |

js_render

字段类型必需默认值描述
enabled布尔值true启用浏览器渲染
wait_until
字符串 | 否 | load | load / domcontentloaded / networkidle | | viewport.width | 整数 | 否 | - | 视口宽度(桌面端 1920,移动端 402) | | viewport.height | 整数 | 否 | - | 视口高度(桌面端 1080,移动端 874) |

output

字段类型必需默认值描述
formats字符串数组[markdown]输出格式
screenshot
字符串 | 否 | viewport | full_page / viewport(仅当 formats 包含 screenshot 时) | | json.prompt | 字符串 | 否 | - | 提取提示 | | json.json_schema | 对象 | 否 | - | JSON Schema |

output.formats 枚举:

  • - html
  • raw_html
  • markdown
  • links
  • summary
  • screenshot
  • json

webhook

字段类型必需默认值描述
url字符串-回调 URL
headers
对象映射 | 否 | - | 自定义回调请求头 | | events | 字符串数组 | 否 | [started,completed,failed] | 事件:started / completed / failed |

响应参数

同步创建响应(mode=sync)

字段类型描述
scrape_id字符串任务 ID
endpoint
字符串 | 始终为 scrape | | version | 字符串 | 版本 | | status | 字符串 | completed / failed | | url | 字符串 | 目标 URL | | data | 对象 | 结果数据 | | started_at | 字符串 | 开始时间(ISO 8601) | | ended_at | 字符串 | 结束时间(ISO 8601) | | totalcreditsused | 整数 | 使用的总积分 |

data 字段(基于 output.formats):

  • - html、raw_html、markdown、links、summary、screenshot、json
  • metadata(页面元数据)
-

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 xcrawl-scrape-1776152463 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 xcrawl-scrape-1776152463 技能

通过命令行安装

skillhub install xcrawl-scrape-1776152463

下载

⬇ 下载 xcrawl-scrape v1.0.2(免费)

文件大小: 3.62 KB | 发布时间: 2026-4-15 12:34

v1.0.2 最新 2026-4-15 12:34
xcrawl-scrape v1.0.2

- Added a note about credits: users need an XCrawl account with activated free credits before running requests.
- Provided registration guidance: users should sign up at https://dash.xcrawl.com/ and activate the free 1000 credits plan.
- No breaking changes to API usage or workflow.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部