Back to Documentation

Quick Start

Get up and running with CastleBreaker API in minutes

Quick Start Guide

This guide will help you make your first API call to CastleBreaker in just a few minutes.

Prerequisites

Step 1: Check Your Balance

First, let's verify your account is working by checking your balance:

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

Response:

{
  "status": "success",
  "data": {
    "credits": 10.00,
    "requests_count": 0,
    "total_spent": 0.00
  }
}

Step 2: Solve a ReCAPTCHA v3 Token

Let's solve your first ReCAPTCHA token:

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

Response:

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

Step 3: Generate a Castle Token

Generate a Castle token for your application:

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

Response:

{
  "status": "success",
  "data": {
    "accept_lang": "en-US",
    "castle_token": "wczD-SdF5I1C-...",
    "cid": "ef3b4d08baed1",
    "user_agent": "Mozilla/5.0 ..."
  },
  "credits": 8.20
}

Step 4: Try TLS Bypass

Make an HTTP request with TLS fingerprinting:

curl -X POST "https://castlebreaker.cc/tls" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://httpbin.org/get",
    "method": "GET",
    "tls_config": "CUSTOM"
  }'

Response:

{
  "status": true,
  "msg": "Success",
  "data": {
    "response": {
      "status": true,
      "text": "...",
      "tls": {
        "ja3": "771,4865-4866-...",
        "ja3_hash": "e7d705a3286e19ea..."
      }
    }
  }
}

Common Patterns

Error Handling

Always check the status field in responses:

response = requests.get(url, headers=headers)
data = response.json()

if data.get("status") == "success":
    print("Success:", data["data"])
else:
    print("Error:", data.get("message"))

Retry Logic

Implement retry logic for transient errors:

import time

def make_request_with_retry(url, headers, max_retries=3):
    for attempt in range(max_retries):
        try:
            response = requests.get(url, headers=headers)
            if response.status_code == 200:
                return response.json()
        except Exception as e:
            if attempt == max_retries - 1:
                raise
            time.sleep(2 ** attempt)  # Exponential backoff

Next Steps

Now that you've made your first requests, explore:

Need Help?

  • Check our API Reference for detailed endpoint documentation
  • Review Error Handling best practices
  • Contact support if you encounter issues

Congratulations! 🎉 You've successfully integrated CastleBreaker API. Start building your application now!