XCrawl Crawl
Overview
This skill orchestrates full-site or scoped crawling with XCrawl Crawl APIs.
Default behavior is raw passthrough: return upstream API response bodies as-is.
Required Local Config
Before using this skill, the user must create a local config file and write XCRAWL_API_KEY into it.
Path: INLINECODE1
CODEBLOCK0
Read API key from local config file only. Do not require global environment variables.
Credits and Account Setup
Using XCrawl APIs consumes credits.
If the user does not have an account or available credits, guide them to register at https://dash.xcrawl.com/.
After registration, they can activate the free 1000 credits plan before running requests.
Tool Permission Policy
Request runtime permissions for curl and node only.
Do not request Python, shell helper scripts, or other runtime permissions.
API Surface
- - Start crawl: INLINECODE6
- Read result: INLINECODE7
- Base URL: INLINECODE8
- Required header: INLINECODE9
Usage Examples
cURL (create + result)
CODEBLOCK1
Node
CODEBLOCK2
Request Parameters
Request endpoint and headers
- - Endpoint: INLINECODE10
- Headers:
- INLINECODE11
- INLINECODE12
Request body: top-level fields
| Field | Type | Required | Default | Description |
|---|
| INLINECODE13 | string | Yes | - | Site entry URL |
| INLINECODE14 |
object | No | - | Crawler config |
|
proxy | object | No | - | Proxy config |
|
request | object | No | - | Request config |
|
js_render | object | No | - | JS rendering config |
|
output | object | No | - | Output config |
|
webhook | object | No | - | Async callback config |
crawler
| Field | Type | Required | Default | Description |
|---|
| INLINECODE21 | integer | No | INLINECODE22 | Max pages |
| INLINECODE23 |
string[] | No | - | Include only matching URLs (regex supported) |
|
exclude | string[] | No | - | Exclude matching URLs (regex supported) |
|
max_depth | integer | No |
3 | Max depth from entry URL |
|
include_entire_domain | boolean | No |
false | Crawl full site instead of only subpaths |
|
include_subdomains | boolean | No |
false | Include subdomains |
|
include_external_links | boolean | No |
false | Include external links |
|
sitemaps | boolean | No |
true | Use site sitemap |
proxy
| Field | Type | Required | Default | Description |
|---|
| INLINECODE36 | string | No | INLINECODE37 | ISO-3166-1 alpha-2 country code, e.g. US / JP / INLINECODE40 |
| INLINECODE41 |
string | No | Auto-generated | Sticky session ID; same ID attempts to reuse exit |
request
| Field | Type | Required | Default | Description |
|---|
| INLINECODE43 | string | No | INLINECODE44 | Affects INLINECODE45 |
| INLINECODE46 |
string | No |
desktop |
desktop /
mobile; affects UA and viewport |
|
cookies | object map | No | - | Cookie key/value pairs |
|
headers | object map | No | - | Header key/value pairs |
|
only_main_content | boolean | No |
true | Return main content only |
|
block_ads | boolean | No |
true | Attempt to block ad resources |
|
skip_tls_verification | boolean | No |
true | Skip TLS verification |
js_render
| Field | Type | Required | Default | Description |
|---|
| INLINECODE59 | boolean | No | INLINECODE60 | Enable browser rendering |
| INLINECODE61 |
string | No |
load |
load /
domcontentloaded /
networkidle |
|
viewport.width | integer | No | - | Viewport width (desktop
1920, mobile
402) |
|
viewport.height | integer | No | - | Viewport height (desktop
1080, mobile
874) |
output
| Field | Type | Required | Default | Description |
|---|
| INLINECODE73 | string[] | No | INLINECODE74 | Output formats |
| INLINECODE75 |
string | No |
viewport |
full_page /
viewport (only if
formats includes
screenshot) |
|
json.prompt | string | No | - | Extraction prompt |
|
json.json_schema | object | No | - | JSON Schema |
INLINECODE83 enum:
- - INLINECODE84
- INLINECODE85
- INLINECODE86
- INLINECODE87
- INLINECODE88
- INLINECODE89
- INLINECODE90
webhook
| Field | Type | Required | Default | Description |
|---|
| INLINECODE92 | string | No | - | Callback URL |
| INLINECODE93 |
object map | No | - | Custom callback headers |
|
events | string[] | No |
["started","completed","failed"] | Events:
started /
completed /
failed |
Response Parameters
Create response (POST /v1/crawl)
| Field | Type | Description |
|---|
| INLINECODE100 | string | Task ID |
| INLINECODE101 |
string | Always
crawl |
|
version | string | Version |
|
status | string | Always
pending |
Result response (GET /v1/crawl/{crawl_id})
| Field | Type | Description |
|---|
| INLINECODE107 | string | Task ID |
| INLINECODE108 |
string | Always
crawl |
|
version | string | Version |
|
status | string |
pending /
crawling /
completed /
failed |
|
url | string | Entry URL |
|
data | object[] | Per-page result array |
|
started_at | string | Start time (ISO 8601) |
|
ended_at | string | End time (ISO 8601) |
|
total_credits_used | integer | Total credits used |
INLINECODE121 fields follow output.formats:
- -
html, raw_html, markdown, links, summary, screenshot, INLINECODE129 - INLINECODE130 (page metadata)
- INLINECODE131
- INLINECODE132
- INLINECODE133
Workflow
- 1. Confirm business objective and crawl boundary.
- - What content is required, what content must be excluded, and what is the completion signal.
- 2. Draft a bounded crawl request.
- - Prefer explicit limits and path constraints.
- 3. Start crawl and capture task metadata.
- - Record
crawl_id, initial status, and request payload.
- 4. Poll
GET /v1/crawl/{crawl_id} until terminal state.
- - Track
pending, crawling, completed, or failed.
- 5. Return raw create/result responses.
- - Do not synthesize derived summaries unless explicitly requested.
Output Contract
Return:
- - Endpoint flow (
POST /v1/crawl + GET /v1/crawl/{crawl_id}) - INLINECODE142 used for the create request
- Raw response body from create call
- Raw response body from result call
- Error details when request fails
Do not generate summaries unless the user explicitly requests a summary.
Guardrails
- - Never run an unbounded crawl without explicit constraints.
- Do not present speculative page counts as final coverage.
- Do not hardcode provider-specific tool schemas in core logic.
- Highlight policy, legal, or website-usage risks when relevant.
XCrawl 爬虫
概述
该技能通过 XCrawl 爬虫 API 编排全站或限定范围的爬取任务。
默认行为为原始透传:直接返回上游 API 响应体,不做任何处理。
本地配置要求
使用此技能前,用户必须创建本地配置文件,并在其中写入 XCRAWLAPIKEY。
路径:~/.xcrawl/config.json
json
{
XCRAWLAPIKEY: apikey>
}
仅从本地配置文件读取 API 密钥,无需设置全局环境变量。
积分与账户设置
使用 XCrawl API 会消耗积分。
如果用户没有账户或可用积分,请引导其前往 https://dash.xcrawl.com/ 注册。
注册后,可在运行请求前激活免费的 1000 积分套餐。
工具权限策略
仅请求 curl 和 node 的运行时权限。
不请求 Python、Shell 辅助脚本或其他运行时权限。
API 接口
- - 启动爬取:POST /v1/crawl
- 读取结果:GET /v1/crawl/{crawlid}
- 基础 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))
CREATE_RESP=$(curl -sS -X POST https://run.xcrawl.com/v1/crawl \
-H Content-Type: application/json \
-H Authorization: Bearer ${API_KEY} \
-d {url:https://example.com,crawler:{limit:100,max_depth:2},output:{formats:[markdown,links]}})
echo $CREATE_RESP
CRAWLID=$(node -e const s=process.argv[1];const j=JSON.parse(s);process.stdout.write(j.crawlid||) $CREATE_RESP)
curl -sS -X GET https://run.xcrawl.com/v1/crawl/${CRAWL_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,crawler:{limit:300,max_depth:3,include:[/docs/.],exclude:[/blog/.]},request:{locale:ja-JP},output:{formats:[markdown,links,json]}};
fetch(https://run.xcrawl.com/v1/crawl,{
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/crawl
- 请求头:
- Content-Type: application/json
- Authorization: Bearer
请求体:顶层字段
| 字段 | 类型 | 必填 | 默认值 | 描述 |
|---|
| url | 字符串 | 是 | - | 网站入口 URL |
| crawler |
对象 | 否 | - | 爬虫配置 |
| proxy | 对象 | 否 | - | 代理配置 |
| request | 对象 | 否 | - | 请求配置 |
| js_render | 对象 | 否 | - | JS 渲染配置 |
| output | 对象 | 否 | - | 输出配置 |
| webhook | 对象 | 否 | - | 异步回调配置 |
crawler
| 字段 | 类型 | 必填 | 默认值 | 描述 |
|---|
| limit | 整数 | 否 | 100 | 最大页面数 |
| include |
字符串数组 | 否 | - | 仅包含匹配的 URL(支持正则) |
| exclude | 字符串数组 | 否 | - | 排除匹配的 URL(支持正则) |
| max_depth | 整数 | 否 | 3 | 从入口 URL 开始的最大深度 |
| include
entiredomain | 布尔值 | 否 | false | 爬取整个网站而非仅子路径 |
| include_subdomains | 布尔值 | 否 | false | 包含子域名 |
| include
externallinks | 布尔值 | 否 | false | 包含外部链接 |
| sitemaps | 布尔值 | 否 | true | 使用站点地图 |
proxy
| 字段 | 类型 | 必填 | 默认值 | 描述 |
|---|
| location | 字符串 | 否 | US | ISO-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 | 对象映射 | 否 | - | 请求头键值对 |
| only
maincontent | 布尔值 | 否 | true | 仅返回主要内容 |
| block_ads | 布尔值 | 否 | true | 尝试拦截广告资源 |
| skip
tlsverification | 布尔值 | 否 | 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 |
响应参数
创建响应(POST /v1/crawl)
| 字段 | 类型 | 描述 |
|---|
| crawl_id | 字符串 | 任务 ID |
| endpoint |
字符串 | 始终为 crawl |
| version | 字符串 | 版本号 |
| status | 字符串 | 始终为 pending |
结果响应(GET /v1/crawl/{crawl_id})
| 字段 |