API Documentation
Complete reference for the rcap.sh API
Getting Started
rcap.sh provides a simple REST API for solving Cloudflare Turnstile and Challenge captchas. The API uses a task-based flow: create a task, then poll for the result.
https://api.rcap.shAuthentication
All API requests require your clientKey in the request body. Get your key from the dashboard after signing up.
createTask
POST /createTask
Create a new captcha solving task.
Parameters
clientKeystringrequiredYour API keytask.typestringrequiredAntiTurnstileTaskProxyLess, AntiTurnstileTask, or AntiCloudflareTasktask.websiteURLstringrequiredTarget page URLtask.websiteKeystringTurnstile site key (required for turnstile)task.proxystringProxy for challenge: protocol://user:pass@host:porttask.userAgentstringCustom user agent (challenge only)task.actionstringTurnstile action parameter (if site sets data-action)task.cdatastringTurnstile cdata parameter (if site sets data-cdata)import requests
response = requests.post("https://api.rcap.sh/createTask", json={
"clientKey": "YOUR_API_KEY",
"task": {
"type": "AntiTurnstileTaskProxyLess",
"websiteURL": "https://example.com",
"websiteKey": "0x4AAAAAAB..."
}
})
print(response.json())
# {"errorId": 0, "taskId": "uuid-here", "status": "processing"}curl -X POST https://api.rcap.sh/createTask \
-H "Content-Type: application/json" \
-d '{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "AntiTurnstileTaskProxyLess",
"websiteURL": "https://example.com",
"websiteKey": "0x4AAAAAAB..."
}
}'getTaskResult
POST /getTaskResult
Poll for a task result. Keep polling until status is "ready" or "failed".
clientKeystringrequiredYour API keytaskIdstringrequiredTask ID from createTaskimport time
while True:
result = requests.post("https://api.rcap.sh/getTaskResult", json={
"clientKey": "YOUR_API_KEY",
"taskId": task_id
}).json()
if result["status"] == "ready":
token = result["solution"]["token"]
break
elif result["status"] == "failed":
print("Failed:", result.get("errorDescription"))
break
time.sleep(1)Response
// Success
{
"errorId": 0,
"status": "ready",
"solution": {
"token": "0.abc123..."
},
"solveTime": 842
}
// Processing
{"errorId": 0, "status": "processing"}
// Failed
{
"errorId": 1,
"status": "failed",
"errorCode": "ERROR_CAPTCHA_UNSOLVABLE",
"errorDescription": "solve failed"
}getBalance
POST /getBalance
clientKeystringrequiredYour API keyresponse = requests.post("https://api.rcap.sh/getBalance", json={
"clientKey": "YOUR_API_KEY"
}).json()
print("Balance:", response["balance"])solve (sync)
POST /solve
Single-request solve. Blocks until the captcha is solved and returns the result directly — no polling needed. Ideal for latency-sensitive workflows.
Parameters
clientKeystringrequiredYour API keytask.typestringrequiredAntiTurnstileTaskProxyLess, AntiTurnstileTask, or AntiCloudflareTasktask.websiteURLstringrequiredTarget page URLtask.websiteKeystringTurnstile site key (required for turnstile)task.proxystringProxy for challenge: protocol://user:pass@host:porttask.userAgentstringCustom user agent (challenge only)task.actionstringTurnstile action (if site sets data-action)task.cdatastringTurnstile cdata (if site sets data-cdata)import requests
# Single request — no polling needed
response = requests.post("https://api.rcap.sh/solve", json={
"clientKey": "YOUR_API_KEY",
"task": {
"type": "AntiTurnstileTaskProxyLess",
"websiteURL": "https://example.com",
"websiteKey": "0x4AAAAAAB..."
}
}, timeout=30).json()
token = response["solution"]["token"]
print(f"Solved in {response['solveTime']}ms")curl -X POST https://api.rcap.sh/solve \
-H "Content-Type: application/json" \
-d '{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "AntiTurnstileTaskProxyLess",
"websiteURL": "https://example.com",
"websiteKey": "0x4AAAAAAB..."
}
}'Response
// Success
{
"errorId": 0,
"status": "ready",
"solution": {"token": "0.abc123..."},
"solveTime": 306
}
// Failed
{
"errorId": 1,
"status": "failed",
"errorCode": "ERROR_CAPTCHA_UNSOLVABLE",
"errorDescription": "solve failed"
}Use a timeout of at least 30 seconds. Typical solve time is ~300ms for Turnstile and 1-5s for Challenge. Same body format as createTask.
Cloudflare Turnstile
Solve Cloudflare Turnstile captchas. Proxy optional — use AntiTurnstileTaskProxyLess without proxy, or AntiTurnstileTask with proxy.
task.typestringrequiredAntiTurnstileTaskProxyLess (no proxy) or AntiTurnstileTask (with proxy)task.websiteURLstringrequiredPage URL with turnstiletask.websiteKeystringrequiredTurnstile sitekey (data-sitekey)task.proxystringOptional proxy: protocol://user:pass@host:porttask.userAgentstringMatch the UA you use on the form submissiontask.actionstringPass if site sets data-action on the widgettask.cdatastringPass if site sets data-cdata on the widget# Without proxy
response = requests.post("https://api.rcap.sh/createTask", json={
"clientKey": "YOUR_API_KEY",
"task": {
"type": "AntiTurnstileTaskProxyLess",
"websiteURL": "https://example.com/login",
"websiteKey": "0x4AAAAAAB..."
}
})
# With proxy
response = requests.post("https://api.rcap.sh/createTask", json={
"clientKey": "YOUR_API_KEY",
"task": {
"type": "AntiTurnstileTask",
"websiteURL": "https://example.com/login",
"websiteKey": "0x4AAAAAAB...",
"proxy": "http://user:pass@host:port"
}
})Cloudflare Challenge
Solve Cloudflare Challenge pages ("Checking your browser..."). Requires a proxy. Returns cf_clearance cookies and the user agent used.
task.typestringrequiredAntiCloudflareTasktask.websiteURLstringrequiredChallenge page URLtask.proxystringrequiredprotocol://user:pass@host:porttask.userAgentstringCustom user agent (should match your browser)response = requests.post("https://api.rcap.sh/createTask", json={
"clientKey": "YOUR_API_KEY",
"task": {
"type": "AntiCloudflareTask",
"websiteURL": "https://example.com/protected",
"proxy": "http://user:pass@proxy.example.com:8080",
"userAgent": "Mozilla/5.0 ..."
}
})
# Result contains cookies and user_agent
# {"solution": {"cookies": {"cf_clearance": "..."}, "user_agent": "..."}}Error Codes
ERROR_KEY_DOES_NOT_EXISTInvalid API keyERROR_ZERO_BALANCEInsufficient balanceERROR_TASK_NOT_SUPPORTEDTask type not supported or disabledERROR_NO_SUCH_CAPCHA_IDTask not foundERROR_CAPTCHA_UNSOLVABLESolve failed (auto-refunded)ERROR_RATE_LIMITToo many requests, slow downERROR_BAD_REQUESTInvalid request parameters