#
Castle
Solve Castle.io Browser SDK challenges. Generate valid x-castle-request-token and __cuid cookies.
Generate valid Castle Browser SDK request tokens and session cookies. Used by Framer, and many other platforms for bot detection.
#
Task Types
#
Parameters
#
Data Parameters
#
Finding the Publishable Key
Open DevTools → Network tab and search for requests to cdn.castle.io:
https://cdn.castle.io/v2/castle.js?pk_XXXXXXXXXXXXX
Or search the page source for:
_castle('setKey', 'pk_XXXXXXXXXXXXX');
The key always starts with pk_.
#
Example
response = requests.post("https://v1.captchasolv.com/solve", json={
"clientKey": "YOUR_API_KEY",
"task": {
"type": "CastleTaskProxyless",
"websiteURL": "https://example.com",
"websiteKey": "pk_XXXXXXXXXXXXX"
}
}, timeout=130)
solution = response.json()["solution"]
token = solution["token"] # x-castle-request-token header
cuid = solution["cookie"] # __cuid cookie
ua = solution["userAgent"] # User-Agent to reuse
const response = await axios.post('https://v1.captchasolv.com/solve', {
clientKey: 'YOUR_API_KEY',
task: {
type: 'CastleTaskProxyless',
websiteURL: 'https://example.com',
websiteKey: 'pk_XXXXXXXXXXXXX'
}
}, { timeout: 130000 });
const { token, cookie, userAgent } = response.data.solution;
// token → x-castle-request-token header
// cookie → __cuid cookie
#
Multi-Token Example
Generate multiple tokens in a single session (useful for batch requests):
response = requests.post("https://v1.captchasolv.com/solve", json={
"clientKey": "YOUR_API_KEY",
"task": {
"type": "CastleTaskProxyless",
"websiteURL": "https://example.com",
"websiteKey": "pk_XXXXXXXXXXXXX",
"data": {
"count": 10
}
}
}, timeout=130)
data = response.json()
for task in data["tasks"]:
token = task["solution"]["token"]
cuid = task["solution"]["cookie"]
const response = await axios.post('https://v1.captchasolv.com/solve', {
clientKey: 'YOUR_API_KEY',
task: {
type: 'CastleTaskProxyless',
websiteURL: 'https://example.com',
websiteKey: 'pk_XXXXXXXXXXXXX',
data: { count: 10 }
}
}, { timeout: 130000 });
for (const task of response.data.tasks) {
console.log(task.solution.token, task.solution.cookie);
}
#
Response
#
Single Token
{
"errorId": 0,
"solution": {
"token": "eyJhbGciOi...",
"cookie": "__cuid=...",
"userAgent": "Mozilla/5.0..."
}
}
#
Multi-Token (with count)
{
"errorId": 0,
"tasks": [
{
"solution": {
"token": "eyJhbGciOi...",
"cookie": "__cuid=...",
"userAgent": "Mozilla/5.0..."
}
}
]
}
#
Tips
- Solve time — 0.5–1.5 seconds per token
- User-Agent — Always use the returned
userAgentin subsequent requests - Token usage — Include the token as
x-castle-request-tokenheader and set the__cuidcookie - Multi-token — Use
data.count(1–50) to generate multiple tokens in one session, saving time and resources - Session cookie — Pass
data.__cuidto continue an existing Castle session