Loading...
Loading...
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.
npx skill4agent add xcrawl-api/xcrawl-skills xcrawl-scrapeXCRAWL_API_KEY~/.xcrawl/config.json{
"XCRAWL_API_KEY": "<your_api_key>"
}https://dash.xcrawl.com/1000curlnodePOST /v1/scrapeGET /v1/scrape/{scrape_id}https://run.xcrawl.comAuthorization: Bearer <XCRAWL_API_KEY>API_KEY="$(node -e "const fs=require('fs');const p=process.env.HOME+'/.xcrawl/config.json';const k=JSON.parse(fs.readFileSync(p,'utf8')).XCRAWL_API_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"]}}'API_KEY="$(node -e "const fs=require('fs');const p=process.env.HOME+'/.xcrawl/config.json';const k=JSON.parse(fs.readFileSync(p,'utf8')).XCRAWL_API_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":"Extract title and price."}}')"
echo "$CREATE_RESP"
SCRAPE_ID="$(node -e 'const s=process.argv[1];const j=JSON.parse(s);process.stdout.write(j.scrape_id||"")' "$CREATE_RESP")"
curl -sS -X GET "https://run.xcrawl.com/v1/scrape/${SCRAPE_ID}" \
-H "Authorization: Bearer ${API_KEY}"node -e '
const fs=require("fs");
const apiKey=JSON.parse(fs.readFileSync(process.env.HOME+"/.xcrawl/config.json","utf8")).XCRAWL_API_KEY;
const body={url:"https://example.com",mode:"sync",output:{formats:["markdown","json"]},json:{prompt:"Extract title and publish date."}};
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/scrapeContent-Type: application/jsonAuthorization: Bearer <api_key>| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Target URL |
| string | No | | |
| object | No | - | Proxy config |
| object | No | - | Request config |
| object | No | - | JS rendering config |
| object | No | - | Output config |
| object | No | - | Async webhook config ( |
proxy| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| string | No | | ISO-3166-1 alpha-2 country code, e.g. |
| string | No | Auto-generated | Sticky session ID; same ID attempts to reuse exit |
request| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| string | No | | Affects |
| string | No | | |
| object map | No | - | Cookie key/value pairs |
| object map | No | - | Header key/value pairs |
| boolean | No | | Return main content only |
| boolean | No | | Attempt to block ad resources |
| boolean | No | | Skip TLS verification |
js_render| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| boolean | No | | Enable browser rendering |
| string | No | | |
| integer | No | - | Viewport width (desktop |
| integer | No | - | Viewport height (desktop |
output| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| string[] | No | | Output formats |
| string | No | | |
| string | No | - | Extraction prompt |
| object | No | - | JSON Schema |
output.formatshtmlraw_htmlmarkdownlinkssummaryscreenshotjsonwebhook| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| string | No | - | Callback URL |
| object map | No | - | Custom callback headers |
| string[] | No | | Events: |
mode=sync| Field | Type | Description |
|---|---|---|
| string | Task ID |
| string | Always |
| string | Version |
| string | |
| string | Target URL |
| object | Result data |
| string | Start time (ISO 8601) |
| string | End time (ISO 8601) |
| integer | Total credits used |
dataoutput.formatshtmlraw_htmlmarkdownlinkssummaryscreenshotjsonmetadatatraffic_bytescredits_usedcredits_detailcredits_detail| Field | Type | Description |
|---|---|---|
| integer | Base scrape cost |
| integer | Traffic cost |
| integer | JSON extraction cost |
mode=async| Field | Type | Description |
|---|---|---|
| string | Task ID |
| string | Always |
| string | Version |
| string | Always |
GET /v1/scrape/{scrape_id}| Field | Type | Description |
|---|---|---|
| string | Task ID |
| string | Always |
| string | Version |
| string | |
| string | Target URL |
| object | Same shape as sync |
| string | Start time (ISO 8601) |
| string | End time (ISO 8601) |
output.formatsscrape_idstatuscompletedfailedsyncasyncrequest_payload