Getting Started
Set up your first integration with CapBypass
This guide will help you integrate the CapBypass API into your application in minutes.
Prerequisites
- A CapBypass API key (Get one here)
- HTTP client (curl, axios, fetch, requests, etc.)
Authentication
All requests require a clientKey in the request body:
{
"clientKey": "your-api-key",
...
}Keep your API key secret
Never expose your API key in client-side code or public repositories. Use environment variables or a backend proxy.
API Endpoints
| Endpoint | Description |
|---|---|
POST /createTask | Create a new solving task |
POST /getTaskResult | Get the result of a task |
POST /getBalance | Check your account balance |
Base URL: https://api.capbypass.pro
Creating Your First Task
Create a Task
const response = await fetch('https://api.capbypass.pro/createTask', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
clientKey: 'your-api-key',
task: {
type: 'ReCaptchaV3TaskProxyLess',
websiteURL: 'https://example.com',
websiteKey: '6LdyC2cUAAAAACGuDKpXeDorzUDWXmdqeg-xy696',
pageAction: 'login'
}
})
});
const { taskId } = await response.json();
console.log('Task created:', taskId);import requests
response = requests.post('https://api.capbypass.pro/createTask', json={
'clientKey': 'your-api-key',
'task': {
'type': 'ReCaptchaV3TaskProxyLess',
'websiteURL': 'https://example.com',
'websiteKey': '6LdyC2cUAAAAACGuDKpXeDorzUDWXmdqeg-xy696',
'pageAction': 'login'
}
})
task_id = response.json()['taskId']
print(f'Task created: {task_id}')curl -X POST https://api.capbypass.pro/createTask \
-H 'Content-Type: application/json' \
-d '{
"clientKey": "your-api-key",
"task": {
"type": "ReCaptchaV3TaskProxyLess",
"websiteURL": "https://example.com",
"websiteKey": "6LdyC2cUAAAAACGuDKpXeDorzUDWXmdqeg-xy696",
"pageAction": "login"
}
}'Poll for Results
Call /getTaskResult every 1 to 3 seconds, not faster, starting about 1 second after /createTask, or pass waitMs so the request waits on our side (Waiting for the Result).
async function getResult(taskId) {
while (true) {
// Wait 1 second before each check, the first one included
await new Promise(r => setTimeout(r, 1000));
const response = await fetch('https://api.capbypass.pro/getTaskResult', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
clientKey: 'your-api-key',
taskId
})
});
const result = await response.json();
if (result.status === 'ready') {
return result.solution;
}
if (result.status === 'failed') {
throw new Error(result.errorDescription);
}
}
}
const solution = await getResult(taskId);
console.log('Token:', solution.gRecaptchaResponse);import time
def get_result(task_id):
while True:
# Wait 1 second before each check, the first one included
time.sleep(1)
response = requests.post('https://api.capbypass.pro/getTaskResult', json={
'clientKey': 'your-api-key',
'taskId': task_id
})
result = response.json()
if result['status'] == 'ready':
return result['solution']
if result['status'] == 'failed':
raise Exception(result['errorDescription'])
solution = get_result(task_id)
print(f"Token: {solution['gRecaptchaResponse']}")Other Task Types
Only task.type, task.websiteURL and task.websiteKey change. A Cloudflare Turnstile task:
{
"clientKey": "your-api-key",
"task": {
"type": "TurnstileTaskProxyLess",
"websiteURL": "https://example.com/login",
"websiteKey": "0x4AAAAAAAxxxxxxxxxxxxxx"
}
}A CaptchaFox task:
{
"clientKey": "your-api-key",
"task": {
"type": "CaptchaFoxTaskProxyLess",
"websiteURL": "https://signup.gmx.com/",
"websiteKey": "sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}Every task type takes the same clientKey / task envelope and answers with a taskId to poll. Full parameter lists: Cloudflare Turnstile, CaptchaFox.
Waiting for the Result
The poll loop above works, but each sleep is time you spend not knowing the task is done. Pass waitMs to /getTaskResult instead: we hold the request until the task is ready or failed, or waitMs milliseconds pass (capped at 20000), then answer exactly as a plain poll. The token comes back within milliseconds of the solve, so the sleep can go.
POST https://api.capbypass.pro/getTaskResult
{ "clientKey": "your-api-key", "taskId": "TASK_ID", "waitMs": 20000 }A request can be held for up to 20 seconds: set your HTTP client's read timeout above that (30 seconds is comfortable). status: "processing" still means "not solved yet": call again at once. Full rules, including the per-key concurrency cap and what happens over it: API reference.
async function getResult(taskId) {
while (true) {
// Our side waits up to 20 s, so this loop returns as soon as the task ends
const response = await fetch('https://api.capbypass.pro/getTaskResult', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
clientKey: 'your-api-key',
taskId,
waitMs: 20000
})
});
const result = await response.json();
if (result.status === 'ready') {
return result.solution;
}
if (result.status === 'failed') {
throw new Error(result.errorDescription);
}
// status "processing": the wait elapsed, ask again at once
}
}
const solution = await getResult(taskId);
console.log('Token:', solution.gRecaptchaResponse);import requests
def get_result(task_id):
while True:
# Our side waits up to 20 s, so this loop returns as soon as the task ends.
# timeout=30 keeps the client from giving up before the long poll answers.
response = requests.post('https://api.capbypass.pro/getTaskResult', json={
'clientKey': 'your-api-key',
'taskId': task_id,
'waitMs': 20000
}, timeout=30)
result = response.json()
if result['status'] == 'ready':
return result['solution']
if result['status'] == 'failed':
raise Exception(result['errorDescription'])
# status "processing": the wait elapsed, ask again at once
solution = get_result(task_id)
print(f"Token: {solution['gRecaptchaResponse']}")Response Format
Success Response (reCAPTCHA)
{
"errorId": 0,
"status": "ready",
"solution": {
"gRecaptchaResponse": "03AGdBq24PBCb...",
"userAgent": "Mozilla/5.0 ...",
"secChUa": "\"Chromium\";v=\"136\", ..."
}
}Success Response (AWS WAF)
{
"errorId": 0,
"status": "ready",
"solution": {
"cookie": "aws-waf-token=xxxxxxxx...",
"token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:...",
"userAgent": "Mozilla/5.0 ..."
}
}Processing Response
{
"errorId": 0,
"status": "processing"
}Error Response
{
"errorId": 1,
"errorCode": "ERROR_CAPTCHA_UNSOLVABLE",
"errorDescription": "Unable to solve the challenge"
}Error Codes
| Error Code | Description |
|---|---|
ERROR_KEY_DOES_NOT_EXIST | Invalid API key |
ERROR_ZERO_BALANCE | Insufficient balance |
ERROR_CAPTCHA_UNSOLVABLE | Challenge could not be solved |
ERROR_TASK_NOT_FOUND | Task ID not found |
ERROR_INVALID_TASK_DATA | Missing or invalid parameters |
ERROR_PROXY_NOT_DEFINED | Proxy required for a non-ProxyLess task type — use the ProxyLess variant or supply task.proxy |
ERROR_PROXY_FORMAT | Malformed proxy: it must be one token with no whitespace, such as host:port:user:pass or a proxy URL. See Proxy Format in the API Reference |
ERROR_BLOCKED_TARGET | The target URL or your proxy host is, or resolves to, a non-public (internal or reserved) address |
ERROR_PROXY_CONNECTION_FAILED | The proxy could not connect: refused, unreachable, bad credentials, or a 407 or 408 from the proxy. Check the proxy is alive and reachable. On a ProxyLess task it was our pool: nothing to fix on your side, retry |
ERROR_PROXY_BANNED | The target refused the proxy address. For Turnstile: the site or Cloudflare answered HTTP 403 (including Cloudflare error 1020), 429, 451 or 5xx without presenting a challenge, and the description names the status. Use a residential or mobile proxy. On a ProxyLess task it was our pool proxy: nothing to fix on your side, retry |
ERROR_INVALID_DEVELOPER_KEY | The provided developerKey is invalid or disabled |
ERROR_WRONG_TASK_TYPE | Wrong task type for this site (e.g., standard vs enterprise) |
ERROR_RECAPTCHA_INVALID_SITEKEY | reCAPTCHA: Google refused the site key before any solve (it answered "Invalid site key" or "Invalid input"). Check websiteKey and that the task type matches the key. Do not retry the same task |
ERROR_RECAPTCHA_INVALID_DOMAIN | reCAPTCHA: Google refused the site key for the domain of websiteURL ("Invalid domain for site key"). Use the URL of the page that loads the key. Do not retry the same task |
ERROR_TIMEOUT | Task exceeded timeout |
ERROR_TASK_QUEUE_FULL | Server is at capacity, or too many Turnstile tasks are in flight for this API key. Retry in a few seconds. Nothing is charged |
ERROR_TASK_TYPE_COMING_SOON | Task type is not yet available |
ERROR_TASK_TYPE_INACTIVE | Task type is currently disabled |
ERROR_INTERNAL | Internal server error |
SDKs
TypeScript / JavaScript
npm install @capbypass/sdk
Python
pip install capbypass-sdk
Go
go get github.com/CapBypass-Development/capbypass-sdk-go