Modules
Evadr
Anti-bot detection and bypass — the engine behind fetch()
5 min read
Evadr is the anti-bot module that powers evadr.fetch(). It detects anti-bot systems and works out, per site, how to get past them: plain HTTP where that is enough, a browser, a residential exit or a challenge solver where the site needs them.
The high-level client.crawl() orchestrator uses Evadr internally to fetch each page it discovers. You only need evadr.fetch() directly when you want a single page.
For the full API reference, see evadr.fetch().
fetch
result = client.evadr.fetch("https://example.com")
if result.success:
print(result.status_code, result.artifact_id, len(result.html or ""))
else:
print("Fetch failed:", result.error) # still HTTP 200: check success
const result = await client.evadr.fetch('https://example.com');
console.log(result.statusCode, result.artifactId);
result, _ := client.Evadr.Fetch(ctx, "https://example.com", nil)
if result.ArtifactID != nil {
fmt.Println(result.StatusCode, *result.ArtifactID)
}
FetchResult result = client.evadr().fetch("https://example.com");
if (result.success()) {
System.out.println(result.statusCode() + " " + result.artifactId());
} else {
System.out.println("Fetch failed: " + result.error());
}
fetch_async and get_job
POST …/evadr/fetch/async starts a fetch as a job and answers 202 at once with job_id. Poll GET …/evadr/jobs/{job_id} until status is completed or failed (it goes pending → running → completed | failed); the completed job's result has the same fields as a synchronous fetch, so check result.success. Jobs are kept for one hour, then the poll answers 404.
job_id = client.evadr.fetch_async(
"https://example.com",
webhook_url="https://your-server.com/webhooks/kloakd", # optional
)
result = client.evadr.wait_for_job(job_id) # the job's result; or poll client.evadr.get_job(job_id)
print(result.get("success"), result.get("status_code"), result.get("error"))
const jobId = await client.evadr.fetchAsync('https://example.com', {
webhookUrl: 'https://your-server.com/webhooks/kloakd',
});
const job = await client.evadr.getJob(jobId);
| Field | Type | Description |
|-------|------|-------------|
| url | string | Target URL |
| force_browser | boolean | Start with a browser |
| use_proxy | boolean | Accepted, with no effect on the fetch |
| webhook_url | string | Optional: an https URL on the public internet, notified when the job ends (Webhooks) |
The async route does not use session_artifact_id. Fetch pages behind a
login with the synchronous fetch().
fetch_stream / fetchStream (SSE)
fetch_stream starts an async fetch and yields the events of GET …/evadr/jobs/{job_id}/events:
for event in client.evadr.fetch_stream("https://example.com"):
print(event.type, event.message, event.tier_used)
for await (const event of client.evadr.fetchStream('https://example.com')) {
console.log(event.type, event.message, event.tierUsed);
}
The events are pipeline_step, pipeline_error and pipeline_complete, with the fields listed under crawl() SSE streaming; the stream ends after pipeline_complete or pipeline_error. The tier the fetch used is in metadata.tier_used of pipeline_complete (with vendor_detected, anti_bot_bypassed, artifact_id, status_code). When the job runs in another process, the stream falls back to unnamed events with type STATUS (status), COMPLETE (tier_used, artifact_id), FAILED (error) or ERROR (job_not_found). The SDK events carry tier_used / tierUsed and artifact_id / artifactId from either form.
scan
A lightweight check of a URL's protection: one plain HTTP request, then the analysis of what came back.
Like a fetch, a scan reads the site's robots.txt first: a page it does not allow is a 409 ROBOTS_DISALLOWED, which you acknowledge by sending the scan again with the host in robots_acknowledged_hosts, and a 503 ROBOTS_CHECK_UNAVAILABLE means KLOAKD could not check (nothing to acknowledge; retry later). See When robots.txt stops a request.
report = client.evadr.scan("https://example.com")
analyze
Classify a response you already have (status, headers, the start of the body) without fetching anything:
result = client.evadr.analyze("https://example.com", status_code=403, body_snippet=html[:10000])
print(result.blocked, result.vendor, result.confidence, result.recommended_actions)
Response fields
The SDKs' fetch result:
| Field | Type | Description |
|-------|------|-------------|
| success | boolean | Whether the page was fetched (a failed fetch is still HTTP 200: check this) |
| url | string | The URL you asked for |
| status_code | integer | HTTP status; 0 when no page was fetched |
| tier_used | integer | Rough indication of how the page was fetched (1 HTTP, 2 TLS client, 3 headless browser, 4 headed browser, 5 proxy, 0 unknown); 1 on a failed fetch |
| html | string or null | Page HTML; empty on failure. A page that asks for a login is still returned |
| vendor_detected | string or null | Anti-bot vendor |
| anti_bot_bypassed | boolean | Bypass needed and succeeded |
| artifact_id | string or null | ID for reuse in other modules |
| error | string or null | Why the fetch failed |
The raw API sends the artifact as an object, artifact: {artifact_id, type}; the SDKs flatten it to artifact_id. The API response also carries login_options, session, page_category, unverified_html, shell_links and related_page, which the SDKs (0.7.0 included) do not expose as named fields: see fetch().
Next steps
- crawl() orchestrator — discover, fetch, and extract an entire site in one call
- evadr.fetch() reference — full API endpoint docs
- Authenticated scraping guide — login flows with Fetchyr
- Choosing an approach — when to use fetch vs crawl vs extract
