Services · by Google
Google reCAPTCHA
Use Google’s bot checks to help your site spot suspicious activity on forms such as signup or password reset.
A sudden flood of signup requests might come from an automated program. reCAPTCHA looks for signs of automation. Depending on the setup, it can show a challenge or give your site a score for the request.
Choose one form and decide what should happen when a request looks suspicious. Try the form as an ordinary visitor, then use the integration’s testing options to check the other outcome. Make sure a real person can understand how to try again.
- When to use it
- If you already use Google Cloud or Firebase, or you want a score for every visit instead of a plain yes or no.
- When to skip it
- If you don’t want visitors to see picture puzzles. Its checkbox can show them.
- What it costs
- Free for 10,000 checks a month, as of November 2026. Then $8 a month up to 100,000 checks, and $1 per 1,000 after that.
Stop bots with Google reCAPTCHA
Add a reCAPTCHA check to a sign-up, sign-in or contact form. Each time someone sends the form, reCAPTCHA gives it a one-time code, called a pass. Your server asks Google about each pass before it accepts the form.
You’ll need
- A website or app with a form you want to protect, like sign-up or contact.
- Your AI tool, set up and working in your product’s folder.
- Server code that handles the form.
- Google Cloud account. It holds your reCAPTCHA keys and your free monthly checks.
Your part
- Create the reCAPTCHA keys and the server API key in Google Cloud.
- Paste the keys into .env and your host’s settings.
- Test the form on your live site, and check that a made-up pass is refused.
Copy the prompt for these steps
I’m following “Stop bots with Google reCAPTCHA” on BuildLadder. What the guide says I’ll end up with: Your form runs a reCAPTCHA check, and your server refuses any submission Google doesn’t confirm. This comes from https://buildladder.com/tools/recaptcha#security. If you can open web pages, read https://buildladder.com/tools/recaptcha.md for the current version. BuildLadder guide, tool, concept, answer and setup pages all work this way: add .md to the address. How to work with me: - Go through the steps below in order, one at a time. - Do what you can yourself in this folder: write code, run commands, check settings. If a service has an official command-line tool, like the Vercel CLI, you can offer to use it. Ask me before you install anything, sign in to anything or spend money. - When a step needs me, like making an account or clicking in a dashboard, tell me exactly what to do in small steps. Then wait until I say it’s done. - The actions, checks and fixes in each step were written for me, the reader. Where one says “your AI tool”, that means you, and “Say:” means something I would say to you. - Never ask me to paste passwords or secret keys into this chat. I type those into the service’s own settings. - After each step, tell me how to check it worked. Once Git is set up, save a version each time a step works. Then ask if I’m ready for the next one. - Use plain words. I may never have coded before. ## Step 1 of 4: Create a reCAPTCHA key This step is mine to do. Walk me through it, one action at a time: - Go to google.com/recaptcha/admin/create and sign in with your Google account. This opens the reCAPTCHA page in Google Cloud, which Google now labels Fraud Defense. - In Label, type what it protects, like “My site sign-up”. - Pick a key type. Challenge (v2) shows the familiar “I’m not a robot” checkbox. Score based (v3) shows nothing and gives each visit a score. - Add your site’s domain, like mysite.com. Its subdomains are covered too. Leave localhost off this key. - Keep the key limited to your domains, so other sites can’t use it. - If you’re new to Google Cloud, read the terms and tick the checkbox. Then click Submit. - On the reCAPTCHA page in Google Cloud, select the Keys tab. Copy your new key, a long string of letters and numbers, into your notes. This is your site key, and it’s safe to share. - Create a second key the same way for testing on your computer, with only localhost as its domain. It worked when: You have two reCAPTCHA site keys, one for your live domain and one for localhost. Before we move on, check with me: - Can you tell which key is for your live site? Keep for later: You need the localhost key in your .env file, and the live key in “Add the keys to your host and test”. If something goes wrong: - You don’t know which key type to pick. Pick Challenge (v2) if you want people to see a checkbox. Pick Score based (v3) if you want nothing on screen and are happy to choose a score to accept. - It asks you to pick or create a Google Cloud project. Create one named after your site. Your keys and the free monthly checks belong to it. ## Step 2 of 4: Make a secret API key for your server This step is mine to do. Walk me through it, one action at a time: - Go to console.cloud.google.com. Check that your new project’s name shows in the project picker at the top of the page. - Open the Credentials page for this Cloud project. Use the console search if you can’t find it in the menu. - Start creating an API key for your server. - In the key’s API restrictions, allow only the reCAPTCHA Enterprise API. Don’t leave it usable with every API. - Finish creating the key and copy it somewhere private, like a note only you can see. - Open the Cloud project’s overview and note its project ID. It may differ from the name you gave it. It worked when: You have a restricted API key saved somewhere private, and your project ID written down. Before we move on, check with me: - Does the Credentials page show a restriction on your new API key? Keep for later: You need the API key and project ID again in “Add the keys to your host and test”. If something goes wrong: - You can’t find the reCAPTCHA Enterprise API in the list. Type reCAPTCHA in the list’s search box. If it still isn’t there, ask your AI tool to check Google’s current docs for the API’s name. - You made the key without a restriction. Click the key’s name on the Credentials page. Under API restrictions, click Restrict key, select the reCAPTCHA Enterprise API, and click Save. ## Step 3 of 4: Add reCAPTCHA and check it on the server I want to protect a form in this product with Google reCAPTCHA, which now runs on Google Cloud. Read PLAN.md if there is one. Check Google’s current reCAPTCHA docs on Google Cloud first. Don’t rely on memory, because the setup changed. Ask me which form to protect, like sign-up, sign-in or contact, and whether my key is Challenge (v2) or Score based (v3). Then: 1. If my sign-in uses Clerk, stop and tell me how to check Clerk’s own bot protection is turned on instead. 2. If I want to protect Firebase itself, like Firestore, explain Firebase App Check with reCAPTCHA and ask me before you set it up. 3. Otherwise, add reCAPTCHA to that form, using the site key, and send its pass to my server with the form. 4. On the server, create an assessment with the reCAPTCHA Enterprise API before doing anything else. Use my project ID and my API key. Refuse the form unless the pass is valid and its action matches. 5. If my key is score based, explain the score from 0.0 to 1.0 in plain words, and ask me what score to accept. 6. Get a fresh pass for each send, because each one can be checked only once. 7. Read the site key, project ID and API key from environment variables. Put the names in .env with empty values and make sure Git ignores .env. Then tell me which names are public and which are secret, and wait while I paste my localhost values into .env myself. Never put the API key in code that runs in a browser or on a phone. If my product has no server code, stop and explain my options before you change anything. Keep everything that already works. It worked when: reCAPTCHA runs on your form on your computer, and the form still sends when the check passes. Before we move on, check with me: - Did your AI tool show you the server code that asks Google to check each pass? If something goes wrong: - It says localhost is not in the list of supported domains. Use the key you made for localhost on your computer. Keep your live key for your live domain. - Your AI tool only added the checkbox, with no server check. Say: “Check each pass with Google Cloud on the server, and refuse the form when it isn’t valid.” Without it, a bot can skip the checkbox. - Your AI tool asks for a reCAPTCHA secret key. Keys made in Google Cloud check passes with an API key and your project ID. Ask it to follow Google’s current docs on checking passes on your server. ## Step 4 of 4: Add the keys to your host and test This step is mine to do. Walk me through it, one action at a time: - Open your host’s environment variable settings. “Where do my API keys go?” in Answers names the page for Vercel, Netlify and Cloudflare. - Add the live site key, the project ID and the API key, using the names your AI tool gave you. Mark the API key as secret if your host offers that. - Put your site online again from your host, so it uses the new keys. - Open your live site in a private browser window and send the form. It should go through. - Ask your AI tool: “Send one request to my live form with a made-up reCAPTCHA pass, and show me the reply.” It should be refused. It worked when: The form on your live site goes through for a real visitor, and a made-up pass is refused. If something goes wrong: - The widget says “Invalid site key”. The key isn’t valid for this site. Check you used the live key, not the localhost one, or create a new key. - The server check fails with a permission or API key error. Check that the API key’s restriction includes the reCAPTCHA Enterprise API, and that the project ID matches the project that holds your site key. - You’re getting close to 10,000 checks a month. After the free 10,000, Google Cloud needs a billing account. Add one in the Google Cloud console before you run out.
The steps
- Steps marked AI tool are done by your AI tool when you paste the prompt. The rest are yours.
- Save a version after every step that works.
- If a screen looks different from a step, ask your AI tool where the setting moved.
- Never paste a password or secret key into the chat.
A form that turns bots away
Create a reCAPTCHA key
A site key tells reCAPTCHA which website is asking. It’s public and goes in your page. You make one for your live site and one for testing on your computer.
- Go to google.com/recaptcha/admin/create and sign in with your Google account. This opens the reCAPTCHA page in Google Cloud, which Google now labels Fraud Defense.
- In Label, type what it protects, like “My site sign-up”.
- Pick a key type. Challenge (v2) shows the familiar “I’m not a robot” checkbox. Score based (v3) shows nothing and gives each visit a score.
- Add your site’s domain, like mysite.com. Its subdomains are covered too. Leave localhost off this key.
- Keep the key limited to your domains, so other sites can’t use it.
- If you’re new to Google Cloud, read the terms and tick the checkbox. Then click Submit.
- On the reCAPTCHA page in Google Cloud, select the Keys tab. Copy your new key, a long string of letters and numbers, into your notes. This is your site key, and it’s safe to share.
- Create a second key the same way for testing on your computer, with only localhost as its domain.
It worked when: You have two reCAPTCHA site keys, one for your live domain and one for localhost.
Keep: You need the localhost key in your .env file, and the live key in “Add the keys to your host and test”.
Check this step
- Can you tell which key is for your live site?
You don’t know which key type to pick.
Pick Challenge (v2) if you want people to see a checkbox. Pick Score based (v3) if you want nothing on screen and are happy to choose a score to accept.
It asks you to pick or create a Google Cloud project.
Create one named after your site. Your keys and the free monthly checks belong to it.
Make a secret API key for your server
Your server needs its own secret API key, plus your project ID, to ask Google about each pass. That API key stays on your server and in your host’s settings.
- Go to console.cloud.google.com. Check that your new project’s name shows in the project picker at the top of the page.
- Open the Credentials page for this Cloud project. Use the console search if you can’t find it in the menu.
- Start creating an API key for your server.
- In the key’s API restrictions, allow only the reCAPTCHA Enterprise API. Don’t leave it usable with every API.
- Finish creating the key and copy it somewhere private, like a note only you can see.
- Open the Cloud project’s overview and note its project ID. It may differ from the name you gave it.
It worked when: You have a restricted API key saved somewhere private, and your project ID written down.
Keep: You need the API key and project ID again in “Add the keys to your host and test”.
Check this step
- Does the Credentials page show a restriction on your new API key?
You can’t find the reCAPTCHA Enterprise API in the list.
Type reCAPTCHA in the list’s search box. If it still isn’t there, ask your AI tool to check Google’s current docs for the API’s name.
You made the key without a restriction.
Click the key’s name on the Credentials page. Under API restrictions, click Restrict key, select the reCAPTCHA Enterprise API, and click Save.
Add reCAPTCHA and check it on the server
reCAPTCHA goes on your form, and new server code asks Google about each pass. A form that skips this server check isn’t protected at all.
It worked when: reCAPTCHA runs on your form on your computer, and the form still sends when the check passes.
Check this step
- Did your AI tool show you the server code that asks Google to check each pass?
It says localhost is not in the list of supported domains.
Use the key you made for localhost on your computer. Keep your live key for your live domain.
Your AI tool only added the checkbox, with no server check.
Say: “Check each pass with Google Cloud on the server, and refuse the form when it isn’t valid.” Without it, a bot can skip the checkbox.
Your AI tool asks for a reCAPTCHA secret key.
Keys made in Google Cloud check passes with an API key and your project ID. Ask it to follow Google’s current docs on checking passes on your server.
Add the keys to your host and test
Your live site needs the real keys, which go in your host’s settings. A request with a made-up pass then shows whether your server really checks.
- Open your host’s environment variable settings. “Where do my API keys go?” in Answers names the page for Vercel, Netlify and Cloudflare.
- Add the live site key, the project ID and the API key, using the names your AI tool gave you. Mark the API key as secret if your host offers that.
- Put your site online again from your host, so it uses the new keys.
- Open your live site in a private browser window and send the form. It should go through.
- Ask your AI tool: “Send one request to my live form with a made-up reCAPTCHA pass, and show me the reply.” It should be refused.
It worked when: The form on your live site goes through for a real visitor, and a made-up pass is refused.
The widget says “Invalid site key”.
The key isn’t valid for this site. Check you used the live key, not the localhost one, or create a new key.
The server check fails with a permission or API key error.
Check that the API key’s restriction includes the reCAPTCHA Enterprise API, and that the project ID matches the project that holds your site key.
You’re getting close to 10,000 checks a month.
After the free 10,000, Google Cloud needs a billing account. Add one in the Google Cloud console before you run out.
Stuck? Try these, in order
- Stop asking it to “fix it”. Say exactly what’s wrong.
Paste this into the same chat. It asks your AI tool to find the problem with you.
Troubleshooting promptI’m following “Google reCAPTCHA” on BuildLadder and something isn’t working. This comes from https://buildladder.com/tools/recaptcha. If you can open web pages, read https://buildladder.com/tools/recaptcha.md for the current version. BuildLadder guide, tool, concept, answer and setup pages all work this way: add .md to the address. Ask me which step I’m on, what I tried and what happened, one question at a time. Look at the files in this folder if you can. Then explain the problem in plain words and suggest the smallest fix. Don’t change anything that already works.
- Check the service isn’t down.
If you use one of these, open its status page before changing any code: Supabase, Vercel, Netlify, Cloudflare, Stripe, Clerk, Firebase, Resend, GitHub, Expo, Claude, OpenAI.
- Go back to your last saved version.Troubleshooting prompt
Take my product back to the last saved version that worked. First show me which version that is and what will change. Don’t delete anything else.
- Make the change smaller.Troubleshooting prompt
Let’s make a smaller change. Undo what you just tried. Then do only the first part of it, and tell me how to check that part works before we go on.
- Ask a person.
Copy this, fill in each line, and post it in a community like r/vibecoding. Take out any keys or passwords first.
Problem reportWhat I'm building: (one sentence) What I asked my AI tool to do: (the last request) What I expected: (what should happen) What happened instead: (what you see) The exact error, if any: (copy it here) What I've tried: (each attempt, in order) My tools: (AI tool, website or app, hosting)
Look things up
Questions people ask
- Do I need a captcha if my sign-in tool already blocks bots?
- Should I accept the updates Dependabot suggests?
- I shared a secret key by mistake. What do I do now?
- Is my site protected from DDoS attacks?
- Which keys are safe to show, and which must stay secret?
- All answers
Words used on this page
- Captcha
- A captcha is a quick check that a person, not a bot, is filling in a form. It runs in the browser, then your server asks the captcha service whether the visitor passed.
- API key
- An API key is a long code that tells a service your app is allowed to use it. Many keys are secret, so treat them like passwords and keep them out of shared code.
- Domain
- A domain is the name people type to reach your website, like buildladder.com. You rent it from a domain seller, usually for a yearly fee, and point it at your hosting.
- Localhost
- Localhost is the name your computer uses for itself. When your site runs at an address like http://localhost:3000, it's a private preview that only you can see.
- Backend
- The backend is the behind-the-scenes part of an app that visitors never see. It runs on a server, where it saves data and checks who is signed in.
- Environment variable
- An environment variable is a named setting stored outside your code, such as an API key or a database address. Your app reads it when it runs, so secrets stay out of your shared files.
- API
- An API is a set of rules that lets one program ask another for data or actions. Your app uses APIs to talk to outside services, such as maps, payments, or weather.
- Deploy
- To deploy means to put your website or app online so other people can use it. You send your product to a hosting service, which gives it a public web address. This site says “put it online”.
- Production
- Production is the live version of your website or app that real people use. Changes there affect everyone, so you test them in a preview first.
Official pages
- Create a reCAPTCHA key
- Check the free amount and prices
- Check each pass on your server
- Google reCAPTCHA
- Firebase
Updated · Google