NEWStandard createTask and in.php APIs. Change the address and you are connected.View API docs
GATESOLVER

reCAPTCHA

How to find the reCAPTCHA site key

Every reCAPTCHA task needs the site key, the public identifier of the widget on the page. It is always somewhere in the page or its requests; this guide shows where to look first.

What the site key is

A site key is the public half of the key pair a site owner creates for reCAPTCHA. It is embedded in the page so the widget knows which configuration to load, while the secret half stays on the server and is used to verify tokens. Because it is public by design, reading it from the page is normal and expected.

reCAPTCHA site keys are 40 characters long and almost always start with 6L. That pattern makes them easy to spot in HTML, URLs and JavaScript. One page can hold more than one key, for example a v3 key loaded on every page and a v2 checkbox key on the login form, so always note which widget a key belongs to.

Look at the data-sitekey attribute

The most common case. Widgets rendered automatically by Google's script sit in an element like <div class="g-recaptcha" data-sitekey="6Lc...">. For invisible widgets the same attribute is often on the submit button. Open developer tools, use the element search (Ctrl+F in the Elements panel) and type data-sitekey.

In code, any HTML parser reads it: a CSS selector of [data-sitekey] works in Beautiful Soup, Cheerio, jsoup, Nokogiri and browser automation tools alike. If the attribute is missing from the raw HTML but present in the live DOM, the widget is added by JavaScript, and you need either a browser or one of the approaches below.

Read the render parameter in the script URL

reCAPTCHA v3 has no widget element. Instead, the site loads the library with its key in the URL: https://www.google.com/recaptcha/api.js?render=6Lc.... Enterprise sites use enterprise.js?render=6Lc.... Search the page source for render=; the value is the key. A render=explicit value is not a key; it means the site calls grecaptcha.render() itself, which means the key is in the page scripts (see below).

Take the k parameter from the anchor iframe

Every reCAPTCHA widget that is rendered, visible or invisible, creates an iframe whose address looks like https://www.google.com/recaptcha/api2/anchor?ar=1&k=6Lc...&co=...&size=normal. The k parameter is the site key. This is the most reliable method on complex pages, because the iframe only exists for widgets that were actually rendered with a real key. The other parameters help too: size=invisible marks an invisible widget, and an /enterprise/anchor path marks Enterprise.

Watch the network tab

Open the Network panel, reload the page and filter by recaptcha. Requests to anchor, reload and userverify all carry the key as k=. For v3 sites, the reload request fires each time the page calls execute, so trigger the action you care about (log in, search) and read the key from the request that fires at that moment. That also tells you which key belongs to which action when the page has several.

Search the page scripts

Single page apps often keep the key in their JavaScript bundle and render the widget with grecaptcha.render(container, { sitekey: '6Lc...' }) or pass it to grecaptcha.execute('6Lc...', {...}). In Chrome developer tools, press Ctrl+Shift+F (Cmd+Option+F on macOS) to search all loaded scripts for sitekey, 6L or grecaptcha. Pretty print the minified bundle with the {} button to read the surrounding code. Frameworks sometimes keep the key in a config object such as RECAPTCHA_SITE_KEY, so searching for RECAPTCHA in capital letters is worth a try as well.

A console snippet that tries all of them

Paste this into the developer tools console on the page. It collects keys from attributes, script URLs and iframes, and labels where each one came from.

(() => {
  const found = new Map();
  const note = (key, where) => key && /^6L[\w-]{38}$/.test(key) && found.set(key, where);
  document.querySelectorAll('[data-sitekey]').forEach((el) =>
    note(el.getAttribute('data-sitekey'), 'attribute on <' + el.tagName.toLowerCase() + '>'));
  document.querySelectorAll('script[src*="recaptcha"]').forEach((s) =>
    note(new URL(s.src).searchParams.get('render'), 'render= in ' + s.src.split('?')[0]));
  document.querySelectorAll('iframe[src*="recaptcha"]').forEach((f) => {
    const u = new URL(f.src);
    note(u.searchParams.get('k'), 'iframe ' + u.pathname + ' size=' + u.searchParams.get('size'));
  });
  console.table([...found].map(([key, where]) => ({ key, where })));
})();

The regular expression filters out placeholders and explicit values. If the table is empty, the widget has not rendered yet: trigger the form or scroll to it and run the snippet again. Keys that live only inside bundles will not appear here.

Reading it in automation

For scripts, the same logic works in any tool. With a browser driver, evaluate the attribute and iframe checks inside the page after it loads. Without a browser, parse the HTML for data-sitekey and the script URL for render=. When neither is present in the HTML, you can either open the page in a headless browser once to read the iframe, or take the key from the bundle and store it in your configuration. Keys rarely change, but they do get rotated, so make your script fall back to discovery when a task returns tokens the site refuses.

Common mix-ups

  • Secret key. You never see the secret key in a page and you never need it. Anything in the HTML is the public site key.
  • Turnstile keys. Cloudflare Turnstile also uses data-sitekey, but its keys start with 0x4. That is a different widget and a different task; see finding Turnstile parameters.
  • Two keys on one page. Match the key to the widget you are solving, using the iframe size or the timing in the network tab.
  • Wrong page URL. The task also needs websiteURL: the page where the widget appears, not the API endpoint the form posts to.

Once you have the key, the guides for reCAPTCHA v2 in Python and the other languages show the full solve. The reCAPTCHA v2 page lists the task fields.

Common questions

Is it allowed to read the site key from a page?

Yes. The site key is public by design and is sent to every visitor's browser; only the secret key is private.

How long is a reCAPTCHA site key?

It is 40 characters and normally starts with 6L. Values such as explicit in the render parameter are not keys.

Does the site key change often?

Rarely, but owners can rotate it. Re-read it from the page if tokens that used to work start getting refused.

Is the site key the same for v2 and v3 on one site?

Usually not. Each widget type has its own key, and one page can load both.

Can I find the key without a browser?

Often yes, from data-sitekey or render= in the raw HTML. If the widget is built by JavaScript, search the bundle or use a browser once.

Keep reading