Developer Documentation

Official integration guide for the Kaptcha.pro Dynamic API.

1. Frontend Integration

The simplest way to integrate is using our Auto-Injection script. It handles the Iframe creation, resizing, and form data automatically.

Step A: The Container

Place this div inside your form where you want the CAPTCHA to appear.

HTML Layout
<div id="captcha-container"></div>

Step B: The Loader Script

Add this script just before your </body> tag. It will inject a hidden input named captcha_id into your form once solved.

Script Injection
<script 
  src="https://kaptcha.pro/api.js" 
  data-endpoint="https://kaptcha.pro/captcha.php" 
  data-container="captcha-container"></script>

2. Server Verification

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 Implementation

verify.php
<?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
}
?>
Pro Tip: The API script automatically handles responsive resizing and creates a hidden captcha_id input field for you. No manual JavaScript listeners required!