Node.js hCaptcha solver

npm install vanishcaptcha and call solve(). If you would rather not take a dependency, the same call is one fetch to /v1/solves.

Steps

  1. Create a key in the dashboard. It starts with nc_live_, and you can view and copy it there.
  2. Pass type, sitekey, and url. Add rqdata when the widget is enterprise.
  3. Read token from the solved object and submit it with the form.
sdk
import { VanishCaptcha } from "vanishcaptcha";

const vc = new VanishCaptcha({ apiKey: process.env.VANISHCAPTCHA_KEY });
const solve = await vc.solve({
  type: "hcaptcha",
  sitekey: "10000000-ffff-ffff-ffff-000000000001",
  url: "https://example.com/login",
});
console.log(solve.token);
fetch
const res = await fetch("https://api.vanishcaptcha.com/v1/solves?wait=90", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.VANISHCAPTCHA_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    type: "hcaptcha",
    sitekey: "10000000-ffff-ffff-ffff-000000000001",
    url: "https://example.com/login",
  }),
});
const { token } = await res.json();

Enterprise rqdata

If the widget carries rqdata, send type: "hcaptcha_enterprise" and that value. The token that comes back is what the enterprise sitekey expects. Fields are in the API reference.

Questions

Does this solve reCAPTCHA or Turnstile?
No. These guides are hCaptcha only. reCAPTCHA and Turnstile are not live on VanishCaptcha.
How long is the token good for?
About two minutes, and it can be submitted once. Request it immediately before the form goes out.

Start solving hCaptcha in minutes.

1,400 free credits on signup. Pay per solve, credits never expire, failed solves never charged.