Integrate hCaptcha widget and verify tokens with the siteverify API

domain: docs.hcaptcha.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Register an account at hcaptcha.com, create a site, and note your Site Key (public, used client-side) and Secret Key (private, used server-side only).
  2. Load the hCaptcha widget script https://js.hcaptcha.com/1/api.js in your page and add a div with class h-captcha and data-sitekey=YOUR_SITE_KEY; on form submission the widget populates a hidden field named h-captcha-response with the token.
  3. Submit the h-captcha-response token to your backend alongside any form data; validate on the server before processing the form.
  4. From your backend, make a POST request to https://api.hcaptcha.com/siteverify with Content-Type application/x-www-form-urlencoded and body parameters secret=YOUR_SECRET_KEY and response=TOKEN; optionally include remoteip for additional signal.
  5. Parse the JSON response: success: true means the token is valid; success: false means it is invalid, already used, or expired—inspect error-codes[] for the specific failure reason and reject the request accordingly.
  6. Tokens are single-use and must be verified promptly; do not store or replay tokens.

Known gotchas

Related routes

Integrate Cloudflare Turnstile widget and validate tokens with the siteverify API
developers.cloudflare.com · 6 steps · unrated
Register and verify a webhook endpoint to receive WHCC order status updates
whcc.com · 5 steps · unrated
Authorize Search Console API access with the correct OAuth scope and automate domain property verification via the Site Verification API
developers.google.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans