Skip to content

Use code FUN10 for 10% bonus credits

DocsKasada (cd)

Kasada cd API Reference

Get Kasada headers with x-kpsdk-cd for one protected request.

Read Markdown (English)

The Captcha.fun Kasada (cd) API accepts kind, url, protectedUrl and returns x-kpsdk-cd headers. Send the API_KEY header, create a solve with POST /v1/request, then poll GET /v2/response/{id} until ready is true.

What you’ll need

  • Your API key
  • The URL of the page where the challenge appears
  • protectedUrl — Endpoint the headers are for. Replay them on a request to exactly this URL
  • Optional: jsDomain
  • A proxy, if the result must come from your own IP (kasada_cd_proxy)
Use kind

Good to Know

For sites that require x-kpsdk-cd. Loads the target page live, sends a request to protectedUrl, and captures the headers the sensor adds, including x-kpsdk-cd.

ips.js-only deployments never attach x-kpsdk headers to requests — the edge validates the KP_UID session cookies instead. The sensor type is detected from the page automatically and those sites get the cookie-bearing cleared request; pass the challenge document URL (/fp) as url.

Send the Challenge

Send the page details with your API key. You get a solve id back right away.

POSThttps://api.captcha.fun/v1/request
curl -X POST https://api.captcha.fun/v1/request \
  -H "API_KEY: CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "kind": "kasada_cd",
  "url": "https://your-domain.example",
  "protectedUrl": "https://your-domain.example/api/login"
}'

Response

Returns the solve id. Use it to get the result.

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "message": "Started Solving"
}
Request fields6 body fields · 3 required

Headers

NameTypeRequiredDescription
API_KEYstringYesYour API key
Content-TypestringYesapplication/json
APP_IDstringNoOptional app ID for request tracking

Body

NameTypeRequiredDescription
kindstringYesOne of kasada_cd, kasada_cd_proxy
urlstringYesPage URL where the challenge appears
protectedUrlstringYesEndpoint the headers are for. Replay them on a request to exactly this URL
jsDomainstringNoHost serving the sensor (p.js) when it isn’t on the target’s domain. Omit for standard sites
proxystringNoFor _proxy kinds: host:port or host:port:username:password
platformstringNoRequested platform label: windows (default) or mac

Wait for the Result

Use the solve id to fetch the result.

GEThttps://api.captcha.fun/v2/response/{id}

Poll every second until ready is true.

Example

curl -X GET https://api.captcha.fun/v2/response/550e8400-e29b-41d4-a716-446655440000 \
  -H "API_KEY: CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Accept: application/json"

Response

{
  "ready": true,
  "status": "SUCCESS",
  "success": true,
  "userAgent": "RETURNED_USER_AGENT",
  "secUa": "RETURNED_SEC_CH_UA",
  "token": "",
  "headers": {
    "x-kpsdk-cd": "kpsdk:cd:1:...",
    "x-kpsdk-ct": "kpsdk:ct:1:...",
    "x-kpsdk-v": "1.4.0",
    "cookie": "KP_UIDz=unknown; KP_UIDz_s=unknown"
  }
}
Request and response fields7 response fields

Request

NameTypeRequiredDescription
idstring (UUID)YesPath parameter. The id from Create Solve
API_KEYstringYesHeader. Your API key

Response Fields

NameTypeRequiredDescription
readyboolean—true when the solve is finished (v2 only)
statusstring—PENDING while solving, then SUCCESS or FAILURE
successboolean—Whether the solve succeeded
userAgentstring—Value to send as User-Agent when using the result. Preserve it exactly
secUastring—Value to send as Sec-CH-UA when using the result
headersobject—Headers to replay as-is: x-kpsdk-cd, the rest of the x-kpsdk family, and the cookie header with KP_UID cookies
messagestring—Failure reason. Omitted on success

Replay the Request

  • Send one outbound request to exactly protectedUrl with every returned header set verbatim — including the cookie header — and the returned userAgent as your User-Agent header.
  • The header set is single-use, session-bound, and IP-bound: mint a fresh solve for every protected request, and keep the replay on the solving session's egress IP.

When using a successful result, preserve the returned userAgent as User-Agent and secUa as Sec-CH-UA.

Wrong or rejected result? Report the failed solve.

More from Kasada