Tools
Fetch URL body and headers with JS-rendering + bot-protection handling
Fetches the body and headers of any URL with automatic JavaScript rendering and common bot-protection handling. Tune via optional parameters (bodyNeeded, headersNeeded, cleanHtml, maxTimeoutMs, bodyMaxBytes). Response includes body, headers, cleanStats. The cleanHtml flag strips HTML noise (scripts, styles, comments) while preserving text content — significant token-cost reduction for LLM consumption; per-request reduction reported in cleanStats. Returns headersAvailable: false when advanced behavioral fingerprinting prevents header access. Intended for AI agents and customer integrations that need direct URL content access.
post/v1/tools/fetch-url
Request
- Base URL: https://api.competlab.com
- URL: https://api.competlab.com/v1/tools/fetch-url
- Auth: API key in header CL-API-Key
Request body
Example request
{
"url": "https://stripe.com",
"bodyNeeded": true,
"headersNeeded": true,
"maxTimeoutMs": 60000,
"bodyMaxBytes": 5242880
}Response
Example response
{
"item": {
"statusCode": 200,
"body": "<!DOCTYPE html><html>…</html>",
"headers": {
"content-type": "text/html; charset=utf-8",
"strict-transport-security": "max-age=63072000"
},
"headersAvailable": true,
"contentType": "text/html",
"cleanStats": {
"originalSize": 248532,
"cleanedSize": 41218,
"reductionPercent": 83.4,
"originalSizeKB": 242.7,
"cleanedSizeKB": 40.3,
"savedKB": 202.4
},
"finalUrl": "https://stripe.com/",
"durationMs": 1842
}
}Changes
No recorded changes to this operation across all 1 revision of this API.