Back to Documentation

ReCAPTCHA v3

Solve ReCAPTCHA v3 challenges programmatically

ReCAPTCHA v3 API

Generate valid ReCAPTCHA v3 tokens programmatically for your automation needs.

Endpoint

GET https://castlebreaker.cc/getRecapToken

Authentication

Requires X-API-Key header with your API key.

Request

Simple GET request with no additional parameters required:

curl -X GET "https://castlebreaker.cc/getRecapToken" \
  -H "X-API-Key: YOUR_API_KEY"

Response Format

Success Response

{
  "status": "success",
  "data": {
    "token": "03AFcWeA7B4X2rVk9..."
  },
  "credits": 9.00
}

Error Response

{
  "status": "error",
  "message": "Insufficient credits",
  "credits": 0.00
}

Response Fields

FieldTypeDescription
statusstringRequest status: "success" or "error"
data.tokenstringThe generated ReCAPTCHA v3 token
creditsnumberRemaining credits in your account
messagestringError message (only present if status is "error")

Pricing

  • $1.00 per 1000 tokens
  • $0.001 per token (0.1ยข)
  • Deducted only on successful token generation

Token Characteristics

  • Valid for: 2 minutes (120 seconds)
  • Score: Typically 0.9 (high trust score)
  • Action: "verify"
  • Site: Compatible with most ReCAPTCHA v3 implementations

Example Usage

Python

import requests

API_KEY = "your_api_key"
headers = {"X-API-Key": API_KEY}

# Get a ReCAPTCHA token
response = requests.get(
    "https://castlebreaker.cc/getRecapToken",
    headers=headers
)

data = response.json()

if data["status"] == "success":
    token = data["data"]["token"]
    remaining_credits = data["credits"]
    
    print(f"Token: {token}")
    print(f"Remaining credits: ${remaining_credits:.2f}")
    
    # Use the token in your form submission
    # ...
else:
    print(f"Error: {data['message']}")

Node.js

const fetch = require('node-fetch');

const API_KEY = 'your_api_key';

async function getReCaptchaToken() {
  const response = await fetch('https://castlebreaker.cc/getRecapToken', {
    headers: {
      'X-API-Key': API_KEY
    }
  });
  
  const data = await response.json();
  
  if (data.status === 'success') {
    console.log('Token:', data.data.token);
    console.log('Remaining credits:', data.credits);
    return data.data.token;
  } else {
    console.error('Error:', data.message);
    return null;
  }
}

getReCaptchaToken();

cURL

#!/bin/bash

API_KEY="your_api_key"

response=$(curl -s -X GET "https://castlebreaker.cc/getRecapToken" \
  -H "X-API-Key: $API_KEY")

token=$(echo $response | jq -r '.data.token')
echo "ReCAPTCHA Token: $token"

Integration Example

Here's how to use the token in a form submission:

import requests

# Step 1: Get ReCAPTCHA token
api_headers = {"X-API-Key": "your_api_key"}
recap_response = requests.get(
    "https://castlebreaker.cc/getRecapToken",
    headers=api_headers
)
token = recap_response.json()["data"]["token"]

# Step 2: Submit form with token
form_data = {
    "username": "user@example.com",
    "password": "secretpass",
    "g-recaptcha-response": token  # Include token here
}

form_response = requests.post(
    "https://example.com/login",
    data=form_data
)

print(form_response.status_code)

Error Handling

Common errors and how to handle them:

def get_recaptcha_with_retry(max_retries=3):
    for attempt in range(max_retries):
        try:
            response = requests.get(
                "https://castlebreaker.cc/getRecapToken",
                headers=headers,
                timeout=10
            )
            
            data = response.json()
            
            if data["status"] == "success":
                return data["data"]["token"]
            elif "insufficient credits" in data.get("message", "").lower():
                print("Error: Please add credits to your account")
                return None
            else:
                print(f"Attempt {attempt + 1} failed: {data.get('message')}")
                
        except Exception as e:
            print(f"Attempt {attempt + 1} error: {str(e)}")
        
        if attempt < max_retries - 1:
            time.sleep(2 ** attempt)  # Exponential backoff
    
    return None

Common Errors

Error MessageCauseSolution
Invalid or missing API keyAuthentication failedCheck your API key
Insufficient creditsBalance too lowAdd credits to account
Rate limit exceededToo many requestsSlow down request rate
Service temporarily unavailableServer issueRetry with backoff

Performance

  • Average Response Time: 150-300ms
  • Success Rate: >99.5%
  • Token Validity: 2 minutes from generation

Best Practices

  1. Generate Just-In-Time: Request tokens right before you need them (they expire in 2 minutes)
  2. Handle Errors Gracefully: Implement retry logic with exponential backoff
  3. Monitor Credits: Check your balance regularly to avoid interruptions
  4. Cache Wisely: Don't cache tokens for more than 90 seconds
  5. Use HTTPS: Always use HTTPS for API requests

Rate Limits

  • No hard rate limits
  • Fair usage policy applies
  • Recommended: Maximum 10 requests per second

Need More Control?

If you need to specify custom parameters (site key, action, etc.), contact our support team for custom solutions.


Next Steps: