Skip to content

Castle

Solve Castle with the castle type: find the pk_ site key, send the page plus the client's ip, timezone, languages and platform, and get back the EZK- request token.

Use the castle type to obtain a Castle request token. You send the page, the site key and the identity the request will be made from. You get back the EZK-… token.

Overview

Castle (castle.io) has no visible challenge. Its script builds a fingerprint of the visitor and signs it into a token; the site’s server checks that token against the request carrying it. Because the token is a signature over the client’s identity, the identity has to be stated in the task rather than guessed on our side — a token whose timezone or platform disagrees with its own connection is the disagreement Castle looks for.

type castle
Needs a site key Yes: the pk_… key Castle’s script is configured with
Also required ip, timezone, languages, platform
Optional extras user_agent
You get solution.token (the EZK-… request token)

Before you start

  1. Create an API key in the dashboard under API keys (it starts with drx_) and add funds.
  2. Find the site key. Search the page source for castle: the configuration passed to Castle’s script carries a public key starting with pk_. It is also visible in the payload of the X-Castle-Request-Token header the script sends.
  3. Decide the identity. If you submit through a proxy, all four of ip, timezone, languages and platform describe that proxy’s client, not your server — the values have to match the connection the token will arrive on, and we never make that connection ourselves.

Request fields

Field Required What to put
type Yes castle
website_url Yes The full address of the page with the widget, starting with https://.
website_key Yes The Castle site key, starting with pk_.
ip Yes The address the token will be submitted from. IPv4 or IPv6.
timezone Yes An IANA name such as Europe/Berlin.
languages Yes Tags in the browser’s order: "de-DE,de", or a list. At most eight.
platform Yes Win32, MacIntel, Linux x86_64 or similar; must agree with the user agent.
user_agent No The user agent the request will carry. Empty uses ours.

Create the task

curl

curl -s -X POST https://draxon.one/api/captcha/v1/tasks \
  -H "Authorization: Bearer $DRAXON_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: signup-4417" \
  -d '{
    "type": "castle",
    "website_url": "https://example.com/signup",
    "website_key": "pk_live_abc123",
    "ip": "203.0.113.42",
    "timezone": "Europe/Berlin",
    "languages": "de-DE,de",
    "platform": "Win32"
  }'

Python

import os
import requests

API = "https://draxon.one/api/captcha/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['DRAXON_KEY']}"}

task = requests.post(f"{API}/tasks", headers=HEADERS, timeout=30, json={
    "type": "castle",
    "website_url": "https://example.com/signup",
    "website_key": "pk_live_abc123",
    "ip": "203.0.113.42",
    "timezone": "Europe/Berlin",
    "languages": "de-DE,de",
    "platform": "Win32",
}).json()

while task["status"] in ("queued", "processing"):
    task = requests.get(f"{API}/tasks/{task['id']}", params={"wait": 60},
                        headers=HEADERS, timeout=90).json()

if task["status"] == "solved":
    token = task["solution"]["token"]
    requests.post(
        "https://example.com/signup",
        json={"email": "[email protected]"},
        headers={"X-Castle-Request-Token": token},
        timeout=30,
    )
else:
    print("not solved:", task["error"])

Node.js

const API = "https://draxon.one/api/captcha/v1";
const headers = {
  Authorization: `Bearer ${process.env.DRAXON_KEY}`,
  "Content-Type": "application/json",
};

let task = await (await fetch(`${API}/tasks`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    type: "castle",
    website_url: "https://example.com/signup",
    website_key: "pk_live_abc123",
    ip: "203.0.113.42",
    timezone: "Europe/Berlin",
    languages: "de-DE,de",
    platform: "Win32",
  }),
})).json();

while (task.status === "queued" || task.status === "processing") {
  task = await (await fetch(`${API}/tasks/${task.id}?wait=60`, { headers })).json();
}

if (task.status === "solved") {
  await fetch("https://example.com/signup", {
    method: "POST",
    headers: { "Content-Type": "application/json", "X-Castle-Request-Token": task.solution.token },
    body: JSON.stringify({ email: "[email protected]" }),
  });
}

The header name is only an example; use the same place the page puts the token. Some sites pass it in a form field or a cookie instead.

Get the result

A Castle task is quick, because there is no image to recognise. Use ?wait=60 (0 to 120 seconds) to get the answer in one request.

curl -s -H "Authorization: Bearer $DRAXON_KEY" \
  "https://draxon.one/api/captcha/v1/tasks/<id>?wait=60"

A solved task (cost fields left out):

{
  "id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
  "type": "castle",
  "status": "solved",
  "website_host": "example.com",
  "attempts": 1,
  "created_at": "2026-11-24T10:00:00Z",
  "completed_at": "2026-11-24T10:00:01Z",
  "solution": {
    "token": "EZK-f_Qb|JABBMGNUUjBOSEkwY2pSd..."
  },
  "error": null
}

Use the answer

  • Send solution.token exactly as the page sends its own. Castle’s script attaches it to the site’s requests as the X-Castle-Request-Token header; a server may also compare it with the rest of the request.
  • It carries a timestamp, so it is short-lived. Create the task when you are ready to submit.
  • Submit from the same address, timezone, languages and platform you stated. A token is a signature over those values, and a mismatch is what Castle is built to notice.

Compatible API names

Castle is not one of the captcha types the compatibility layer maps, because the request needs four fields no other type takes (ip, timezone, languages, platform). Call /api/captcha/v1/tasks directly for it.

Errors and fixes

When you create a task:

Error What it means What to do
422 validation_error on website_key The pk_ site key is missing. Send the site key.
422 validation_error on ip Not an IPv4 or IPv6 address. Send the address the request will come from.
422 validation_error on languages A tag has a space, or more than eight were sent. Send "de-DE,de" style tags, at most eight.
422 validation_error on website_url Not a full http(s):// address, or too long. Send the full page address.
422 target_blocked This website is not served. Pick a site you are allowed to automate.
402 insufficient_balance / spend_cap_reached Not enough funds, or the key’s daily limit. Add funds or raise the limit.

When a task ends without an answer:

error.code What it means What to do
provider_unavailable The token codec is not installed on our side. Retry later; it is our problem, and nothing is charged.
solve_failed The codec refused the request, usually because the site key is not one Castle issued. Check the pk_ key, then send a new task.
expired Not finished within about 3 minutes. Try again.

None of these cost anything. More codes are on the errors page.

Notes

  • Castle scores consistency, so a token is only as good as the identity you stated. Reusing one identity across many requests from one address is what a fingerprint is designed to notice.
  • There is no puzzle and no image recognition here, which is why this type does not depend on the challenge-solving pipeline the other types use.
  • If a site is strict about a particular device family, ask before you build on it: the devices we can present come from harvested profiles, not from the request.

Price and billing

Each solved Castle task costs the price on the pricing page, also returned by GET /api/captcha/v1/families. Creating a task holds the amount. You are charged only when the task is solved. A failed or expired task releases the hold.