Todas las demos
Widget de prueba

Cloudflare Turnstile

Explora el widget Turnstile y el formato de su token de respuesta.

Widget oficial de prueba

Usa el widget oficial con la clave pública de prueba de Cloudflare.

Cargando widget…

Clave de prueba: aprobación automática, sin resolución real ni cobro. Este token no inicia sesión en tu cuenta.

Sobre las claves de prueba

Parámetros del ejemplo

turnstile
Esta página no solicita ninguna clave privada.
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "turnstile",
    "websiteURL": "https://solucaptcha.com/es-es/demos/turnstile",
    "websiteKey": "1x00000000000000000000AA"
  }
}

POST https://api.solucaptcha.com/createTask. Sustituye YOUR_API_KEY solo en tu servidor.

Ejemplo de integración

demo.mjs
import { setTimeout as sleep } from "node:timers/promises";

const API = "https://api.solucaptcha.com";
const clientKey = process.env.SOLUCAPTCHA_API_KEY;
if (!clientKey) throw new Error("Set SOLUCAPTCHA_API_KEY");
const task = {
  "type": "turnstile",
  "websiteURL": "https://solucaptcha.com/es-es/demos/turnstile",
  "websiteKey": "1x00000000000000000000AA"
};

async function post(path, body) {
  const response = await fetch(API + path, {
    method: "POST", redirect: "error",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ clientKey, ...body }),
    signal: AbortSignal.timeout(15000),
  });
  if (!response.ok) throw new Error("HTTP " + response.status);
  const data = await response.json();
  if (data.errorId !== 0) throw new Error(data.errorDescription || "API_ERROR");
  return data;
}

const { taskId } = await post("/createTask", { task });
if (!taskId) throw new Error("Missing taskId");
let completed = false;
for (let attempt = 0; attempt < 120; attempt++) {
  await sleep(2500);
  const result = await post("/getTaskResult", { taskId });
  if (result.status === "completed") {
    console.log(result.solution); completed = true; break;
  }
  if (result.status === "failed") throw new Error("Task failed");
  if (!["pending", "processing"].includes(result.status)) throw new Error("Unexpected status");
}
if (!completed) throw new Error("Timeout: resume polling taskId=" + taskId);

Para ejecutar una tarea real, usa la clave de tu cuenta y consulta los precios. Solo se cobra tras el éxito.

Ver precios
Explorar otros servicios