Official integration guide for the Kaptcha.pro Dynamic API.
The simplest way to integrate is using our Auto-Injection script. It handles the Iframe creation, resizing, and form data automatically.
Place this div inside your form where you want the CAPTCHA to appear.
<div id="captcha-container"></div>
Add this script just before your </body> tag. It will inject a hidden input named captcha_id into your form once solved.
<script
src="https://kaptcha.pro/api.js"
data-endpoint="https://kaptcha.pro/captcha.php"
data-container="captcha-container"></script>
When your form is submitted, verify the captcha_id on your server using a simple GET request.
GET https://kaptcha.pro/captcha.php?action=webmaster_verify&captcha_id={ID}
<?php
$captchaId = $_GET['captcha_id'];
$verifyUrl = "https://kaptcha.pro/captcha.php?action=webmaster_verify&captcha_id=" . urlencode($captchaId);
$response = @file_get_contents($verifyUrl);
$result = json_decode($response, true);
if ($result && isset($result['success']) && $result['success'] == true) {
// CAPTCHA Passed: Process your logic
} else {
// CAPTCHA Failed
}
?>
captcha_id input field for you. No manual JavaScript listeners required!