Detect Protection
curl --request POST \
--url https://scrapebadger.com/v1/web/detect \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "<string>",
"timeout": 15000,
"country": "<string>"
}
'import requests
url = "https://scrapebadger.com/v1/web/detect"
payload = {
"url": "<string>",
"timeout": 15000,
"country": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', timeout: 15000, country: '<string>'})
};
fetch('https://scrapebadger.com/v1/web/detect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/web/detect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'timeout' => 15000,
'country' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/web/detect"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"timeout\": 15000,\n \"country\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://scrapebadger.com/v1/web/detect")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"timeout\": 15000,\n \"country\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/web/detect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"timeout\": 15000,\n \"country\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://protected-site.com",
"antibot_systems": [
{
"system": "cloudflare_turnstile",
"confidence": 0.92,
"details": "Turnstile widget detected in page HTML"
}
],
"captcha_systems": [],
"is_blocked": true,
"blocking_type": "cloudflare",
"recommendation": "Use browser engine with anti_bot enabled",
"credits_used": 1,
"duration_ms": 1240
}
{
"url": "https://scrapebadger.com",
"antibot_systems": [],
"captcha_systems": [],
"is_blocked": false,
"blocking_type": null,
"recommendation": null,
"credits_used": 1,
"duration_ms": 380
}
{
"url": "https://protected-site.com",
"antibot_systems": [
{
"system": "cloudflare_turnstile",
"confidence": 0.92,
"details": "Turnstile widget detected in page HTML"
}
],
"captcha_systems": [],
"is_blocked": true,
"blocking_type": "cloudflare",
"recommendation": "Use browser engine with anti_bot enabled",
"credits_used": 0,
"duration_ms": 12
}
API Reference
Detect Protection
Analyze a URL for anti-bot and CAPTCHA systems without performing a full scrape.
POST
/
v1
/
web
/
detect
Detect Protection
curl --request POST \
--url https://scrapebadger.com/v1/web/detect \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "<string>",
"timeout": 15000,
"country": "<string>"
}
'import requests
url = "https://scrapebadger.com/v1/web/detect"
payload = {
"url": "<string>",
"timeout": 15000,
"country": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', timeout: 15000, country: '<string>'})
};
fetch('https://scrapebadger.com/v1/web/detect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/web/detect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'timeout' => 15000,
'country' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/web/detect"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"timeout\": 15000,\n \"country\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://scrapebadger.com/v1/web/detect")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"timeout\": 15000,\n \"country\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/web/detect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"timeout\": 15000,\n \"country\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://protected-site.com",
"antibot_systems": [
{
"system": "cloudflare_turnstile",
"confidence": 0.92,
"details": "Turnstile widget detected in page HTML"
}
],
"captcha_systems": [],
"is_blocked": true,
"blocking_type": "cloudflare",
"recommendation": "Use browser engine with anti_bot enabled",
"credits_used": 1,
"duration_ms": 1240
}
{
"url": "https://scrapebadger.com",
"antibot_systems": [],
"captcha_systems": [],
"is_blocked": false,
"blocking_type": null,
"recommendation": null,
"credits_used": 1,
"duration_ms": 380
}
{
"url": "https://protected-site.com",
"antibot_systems": [
{
"system": "cloudflare_turnstile",
"confidence": 0.92,
"details": "Turnstile widget detected in page HTML"
}
],
"captcha_systems": [],
"is_blocked": true,
"blocking_type": "cloudflare",
"recommendation": "Use browser engine with anti_bot enabled",
"credits_used": 0,
"duration_ms": 12
}
Quickly scan a URL to identify which anti-bot and CAPTCHA systems are in use. Results are cached per domain for 5 minutes — cached hits cost 0 credits.
Request Body
string
required
The URL to analyze for anti-bot and CAPTCHA protection systems. Must be a valid HTTP or HTTPS URL.
integer
default:15000
Request timeout in milliseconds. Range:
1000 – 60000.string
ISO 3166-1 alpha-2 country code for proxy geo-targeting. Some sites show different protection depending on the visitor’s location.
{ "country": "US" }
Response
string
The analyzed URL.
array
array
boolean
Whether the page is currently showing a blocking/challenge page.
string
Type of blocking detected (e.g.,
cloudflare, datadome). null if not blocked.string
Suggested scraping strategy based on the detected protection. For example:
"Use browser engine with anti_bot enabled".integer
Credits charged for this request.
1 for a fresh scan, 0 for a cached result.integer
Response time in milliseconds.
Examples
Basic detection
curl -X POST "https://scrapebadger.com/v1/web/detect" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://scrapebadger.com"}'
import requests
response = requests.post(
"https://scrapebadger.com/v1/web/detect",
headers={"x-api-key": "YOUR_API_KEY"},
json={"url": "https://scrapebadger.com"}
)
detection = response.json()
for system in detection["antibot_systems"]:
print(f"{system['system']}: {system['confidence']}")
const res = await fetch("https://scrapebadger.com/v1/web/detect", {
method: "POST",
headers: { "x-api-key": "YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ url: "https://scrapebadger.com" })
});
const detection = await res.json();
console.log(detection.antibot_systems);
Detect with geo-targeting
{
"url": "https://region-restricted-site.com",
"country": "DE",
"timeout": 20000
}
Error Responses
| Status | Description |
|---|---|
400 | Invalid URL |
402 | Insufficient credits |
429 | Rate limit exceeded |
500 | Unexpected server error |
{
"url": "https://protected-site.com",
"antibot_systems": [
{
"system": "cloudflare_turnstile",
"confidence": 0.92,
"details": "Turnstile widget detected in page HTML"
}
],
"captcha_systems": [],
"is_blocked": true,
"blocking_type": "cloudflare",
"recommendation": "Use browser engine with anti_bot enabled",
"credits_used": 1,
"duration_ms": 1240
}
{
"url": "https://scrapebadger.com",
"antibot_systems": [],
"captcha_systems": [],
"is_blocked": false,
"blocking_type": null,
"recommendation": null,
"credits_used": 1,
"duration_ms": 380
}
{
"url": "https://protected-site.com",
"antibot_systems": [
{
"system": "cloudflare_turnstile",
"confidence": 0.92,
"details": "Turnstile widget detected in page HTML"
}
],
"captcha_systems": [],
"is_blocked": true,
"blocking_type": "cloudflare",
"recommendation": "Use browser engine with anti_bot enabled",
"credits_used": 0,
"duration_ms": 12
}
Authorizations
Body
application/json

