Developer documentation

Getting started

1. Create a sitekey

Sign in to your account, open "Sitekeys"
and create one for your website.
The sitekey is public.
Optionally restrict it to your origins, choose a difficulty and the widget mode.

2. Install the widget

Add the stylesheet and the script to your page.
Both are served by your CDPCaptcha installation;
there is no CDN.
You may also copy the two files to your own server.

HTML
<link rel="stylesheet" href="https://cdpcaptcha.com/core/assets/css/cdp-captcha.css">
<script src="https://cdpcaptcha.com/core/assets/js/cdp-captcha.js" defer></script>

Then put one element with the class cdp-captcha inside the form you want to protect:

HTML
<form method="post" action="/contact">
  <input name="email" type="email" required>
  <div class="cdp-captcha" data-sitekey="YOUR_SITEKEY"></div>
  <button type="submit">Send</button>
</form>

The script mounts a widget on every such element.
When the check completes, a hidden field named cdp-captcha-solution is added to the form.
If the visitor submits before the widget is done, the widget finishes first and then submits the form.

3. Verify the response on your server

Create an API key under "API keys".
Then, when the form arrives, POST the field value to the siteverify endpoint.
Without this step there is no protection.

cURL
curl -X POST 'https://cdpcaptcha.com/api/v1/siteverify' \
  -H 'X-API-Key: ck_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"response": "VALUE_OF_cdp-captcha-solution", "sitekey": "YOUR_SITEKEY"}'

A valid response answers with success: true.
Any other answer means the form must be rejected:

JSON
{
  "success": true,
  "data": {
    "verification_id": "cv_3f9a…",
    "challenge": { "solved_at": "2026-10-13T10:12:04Z", "issued_at": "2026-10-13T10:11:58Z", "sitekey": "YOUR_SITEKEY", "difficulty_bits": 14 }
  }
}
HTTP status 200 only means the verification ran. Always read the success field. A used, expired or wrong token also comes back with status 200 and success: false.

Ready-made client code for PHP, Node, Python and others is on the examples page.