Backend Validation
After form submission, your server receives captcha_token
and captcha_solution.
Forward both to /verify, check that success === true, and reject the request if verification fails.
The widget appends two hidden fields to your form on submit —
captcha_token and captcha_solution.
Never trust client-side verification; always call /verify server-side.
This step is required for security. Skipping backend verification leaves your form effectively unprotected.
Laravel
RecommendedUse the built-in HTTP client. Drop this into your form handler.
use Illuminate\Support\Facades\Http;
$response = Http::timeout(3)->post('https://captchaapi.eu/api/v1/captcha/verify', [
'token' => $request->input('captcha_token'),
'solution' => $request->input('captcha_solution'),
]);
if ($response->failed() || ! $response->json('success')) {
return back()->withErrors([
'captcha' => 'Captcha verification failed.',
]);
}Plain PHP
Basic exampleNo dependencies required.
$response = file_get_contents('https://captchaapi.eu/api/v1/captcha/verify', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/json",
'content' => json_encode([
'token' => $_POST['captcha_token'],
'solution' => $_POST['captcha_solution'],
]),
],
]));
$data = json_decode($response, true);
if (! $data['success']) {
die('Captcha failed');
}Node.js / Express
Basic exampleUsing axios. Works with any Node framework.
const axios = require('axios');
app.post('/form', async (req, res) => {
const response = await axios.post('https://captchaapi.eu/api/v1/captcha/verify', {
token: req.body.captcha_token,
solution: req.body.captcha_solution,
});
if (!response.data.success) {
return res.status(400).send('Captcha failed');
}
return res.send('OK');
});Python / Flask
Basic exampleUsing the requests library.
import requests
response = requests.post('https://captchaapi.eu/api/v1/captcha/verify', json={
'token': request.form.get('captcha_token'),
'solution': request.form.get('captcha_solution'),
})
data = response.json()
if not data['success']:
return 'Captcha failed', 400Go / net/http
Basic exampleStandard library only — no dependencies.
resp, err := http.Post("https://captchaapi.eu/api/v1/captcha/verify", "application/json",
bytes.NewBuffer([]byte(`{
"token": "`+r.FormValue("captcha_token")+`",
"solution": "`+r.FormValue("captcha_solution")+`"
}`)),
)
if err != nil {
http.Error(w, "Captcha failed", 400)
return
}
defer resp.Body.Close()
var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)
if data["success"] != true {
http.Error(w, "Captcha failed", 400)
return
}