ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 2.2 months ago (distributed domain, exempt) |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://developers.google.com/recaptcha/docs/v3 |
| Last Crawled | 2026-02-07 05:26:30 (2 months ago) |
| First Indexed | not set |
| HTTP Status Code | 200 |
| Meta Title | reCAPTCHA v3 | Google for Developers |
| Meta Description | null |
| Meta Canonical | null |
| Boilerpipe Text | Skip to main content
Home
Guides
Support
Get Started
Introduction
Choose a Type
Loading re
CAPTCHA
re
CAPTCHA v3
re
CAPTCHA v3
re
CAPTCHA v2
Checkbox
Invisible
Android
Server Side Validation
Verify the User’s Response
Domain/
Package Name Validation
Admin Console
Settings
Analytics
Additional Settings
Language Codes
re
CAPTCHA v3
Stay organized with collections
Save and categorize content based on your preferences.
On this page
Placement on your website
Automatically bind the challenge to a button
Programmatically invoke the challenge
Interpreting the score
Actions
Site Verify Response
Tips
reCAPTCHA v3 provides a score-based system to assess user interactions without interrupting their experience, allowing you to take appropriate actions based on risk levels.
You can implement reCAPTCHA v3 by either automatically binding it to a button or programmatically invoking it for more control over when it runs.
reCAPTCHA v3 uses "actions" to categorize interactions, providing detailed data breakdown and adaptive risk analysis based on the specific context.
reCAPTCHA v3 returns a score along with other details that you should verify on your backend to ensure the response is valid and the action is expected.
You should analyze reCAPTCHA v3 scores within your admin console and adjust action thresholds based on your site's traffic and risk tolerance, starting with a default of 0.5.
reCAPTCHA v3 returns a score for each request without user friction. The score is based on interactions with your site and enables you to take an appropriate action for your site. Register reCAPTCHA v3 keys on the
reCAPTCHA Admin console
.
This page explains how to enable and customize reCAPTCHA v3 on your webpage.
Placement on your website
reCAPTCHA v3 will never interrupt your users, so you can run it whenever you like without affecting
conversion. reCAPTCHA works best when it has the most context about interactions with your site,
which comes from seeing both legitimate and abusive behavior. For this reason, we recommend
including reCAPTCHA verification on forms or actions as well as in the background of pages for
analytics.
You can execute reCAPTCHA on as many actions as you want on the same page.
Automatically bind the challenge to a button
The easiest method for using reCAPTCHA v3 on your page is to include the
necessary JavaScript resource and add a few attributes to your html button.
Load the JavaScript API.
<script src="https://www.google.com/recaptcha/api.js"></script>
Add a callback function to handle the token.
<script>
function onSubmit(token) {
document.getElementById("demo-form").submit();
}
</script>
Add attributes to your html button.
<button class="g-recaptcha"
data-sitekey="reCAPTCHA_site_key"
data-callback='onSubmit'
data-action='submit'>Submit</button>
Programmatically invoke the challenge
If you wish to have more control over when reCAPTCHA runs, you can use the
execute
method in
grecaptcha
object. To do this,
you need to add a
render
parameter to the reCAPTCHA script load.
Load the JavaScript API with your sitekey.
<script src="https://www.google.com/recaptcha/api.js?render=reCAPTCHA_site_key"></script>
Call
grecaptcha.execute
on each action you wish to protect.
<script>
function onClick(e) {
e.preventDefault();
grecaptcha.ready(function() {
grecaptcha.execute('reCAPTCHA_site_key', {action: 'submit'}).then(function(token) {
// Add your logic to submit to your backend server here.
});
});
}
</script>
Send the token immediately to your backend with the request to
verify
.
Interpreting the score
reCAPTCHA v3 returns a score (1.0 is very likely a good interaction, 0.0 is very likely a bot).
Based on the score, you can take variable action in the context of your site. Every site is
different, but below are some examples of how sites use the score. As in the examples below, take
action behind the scenes instead of blocking traffic to better protect your site.
Use case
Recommendation
homepage
See a cohesive view of your traffic on the admin console while filtering scrapers.
login
With low scores, require 2-factor-authentication or email verification to prevent credential stuffing attacks.
social
Limit unanswered friend requests from abusive users and send risky comments to moderation.
e-commerce
Put your real sales ahead of bots and identify risky transactions.
reCAPTCHA learns by seeing real traffic on your site. For this reason, scores in a staging
environment or soon after implementing may differ from production. As reCAPTCHA v3 doesn't ever
interrupt the user flow, you can first run reCAPTCHA without taking action and then decide on
thresholds by looking at your traffic in the
admin console
. By
default, you can use a threshold of 0.5.
Actions
reCAPTCHA v3 introduces a new concept: actions. When you specify an action name
in each place you execute reCAPTCHA, you enable the following new features:
A detailed break-down of data for your top ten actions in the
admin console
Adaptive risk analysis based on the context of the action, because abusive
behavior can vary.
Importantly, when you verify the reCAPTCHA response, you should verify that the
action name is the name you expect.
Site Verify Response
Make the request to
verify the response token
as with reCAPTCHA v2 or
Invisible reCAPTCHA.
The response is a JSON object:
{
"success"
:
true
|
false
,
// whether this request was a valid reCAPTCHA token for your site
"score"
:
nu
mber
// the score for this request (0.0 - 1.0)
"action"
:
s
tr
i
n
g
// the action name for this request (important to verify)
"challenge_ts"
:
t
imes
ta
mp
,
// timestamp of the challenge load (ISO format yyyy-MM-dd'T'HH:mm:ssZZ)
"hostname"
:
s
tr
i
n
g
,
// the hostname of the site where the reCAPTCHA was solved
"error-codes"
:
[
...
]
// optional
}
Tips
grecaptcha.ready()
runs your function when the reCAPTCHA library loads. To
avoid race conditions with the
api.js
, include the
api.js
before your
scripts that call grecaptcha, or continue to use the
onload callback
that's defined with the v2 API.
Try hooking the
execute
call to interesting or sensitive actions like
Register, Password Reset, Purchase, or Play.
Use
https://www.google.com/recaptcha/api.js?trustedtypes=true
to
load code compatible with
Trusted Types
.
Except as otherwise noted, the content of this page is licensed under the
Creative Commons Attribution 4.0 License
, and code samples are licensed under the
Apache 2.0 License
. For details, see the
Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[],["reCAPTCHA v3 provides a score per request, indicating the likelihood of a good interaction. Implement it by registering keys and including the JavaScript API. Execute reCAPTCHA on forms, actions, or in the background using either an automated button binding or the `grecaptcha.execute` method. Verify the response token, and interpret scores (0.0-1.0) to decide actions like requiring multi-factor authentication. Define action names to gain detailed data in the admin console. Always verify the action name in the response.\n"]] |
| Markdown | [Skip to main content](https://developers.google.com/recaptcha/docs/v3#main-content)
[](https://developers.google.com/recaptcha)
- [reCAPTCHA](https://developers.google.com/recaptcha)
- [English](https://developers.google.com/recaptcha/docs/v3)
- [Deutsch](https://developers.google.com/recaptcha/docs/v3?hl=de)
- [Español](https://developers.google.com/recaptcha/docs/v3?hl=es)
- [Español – América Latina](https://developers.google.com/recaptcha/docs/v3?hl=es-419)
- [Français](https://developers.google.com/recaptcha/docs/v3?hl=fr)
- [Indonesia](https://developers.google.com/recaptcha/docs/v3?hl=id)
- [Italiano](https://developers.google.com/recaptcha/docs/v3?hl=it)
- [Polski](https://developers.google.com/recaptcha/docs/v3?hl=pl)
- [Português – Brasil](https://developers.google.com/recaptcha/docs/v3?hl=pt-br)
- [Tiếng Việt](https://developers.google.com/recaptcha/docs/v3?hl=vi)
- [Türkçe](https://developers.google.com/recaptcha/docs/v3?hl=tr)
- [Русский](https://developers.google.com/recaptcha/docs/v3?hl=ru)
- [עברית](https://developers.google.com/recaptcha/docs/v3?hl=he)
- [العربيّة](https://developers.google.com/recaptcha/docs/v3?hl=ar)
- [فارسی](https://developers.google.com/recaptcha/docs/v3?hl=fa)
- [हिंदी](https://developers.google.com/recaptcha/docs/v3?hl=hi)
- [বাংলা](https://developers.google.com/recaptcha/docs/v3?hl=bn)
- [ภาษาไทย](https://developers.google.com/recaptcha/docs/v3?hl=th)
- [中文 – 简体](https://developers.google.com/recaptcha/docs/v3?hl=zh-cn)
- [中文 – 繁體](https://developers.google.com/recaptcha/docs/v3?hl=zh-tw)
- [日本語](https://developers.google.com/recaptcha/docs/v3?hl=ja)
- [한국어](https://developers.google.com/recaptcha/docs/v3?hl=ko)
[Sign in](https://developers.google.com/_d/signin?continue=https%3A%2F%2Fdevelopers.google.com%2Frecaptcha%2Fdocs%2Fv3&prompt=select_account)
[Home](https://developers.google.com/recaptcha)
[Guides](https://developers.google.com/recaptcha/intro)
[Support](https://developers.google.com/recaptcha/docs/faq)
More
[](https://developers.google.com/recaptcha)
- [reCAPTCHA](https://developers.google.com/recaptcha)
- [Home](https://developers.google.com/recaptcha)
- [Guides](https://developers.google.com/recaptcha/intro)
- [Support](https://developers.google.com/recaptcha/docs/faq)
- Get Started
- [Introduction](https://developers.google.com/recaptcha/intro)
- [Choose a Type](https://developers.google.com/recaptcha/docs/versions)
- [Loading re CAPTCHA](https://developers.google.com/recaptcha/docs/loading)
- re
CAPTCHA v3
- [re CAPTCHA v3](https://developers.google.com/recaptcha/docs/v3)
- re
CAPTCHA v2
- [Checkbox](https://developers.google.com/recaptcha/docs/display)
- [Invisible](https://developers.google.com/recaptcha/docs/invisible)
- [Android](https://developer.android.com/training/safetynet/recaptcha.html)
- Server Side Validation
- [Verify the User’s Response](https://developers.google.com/recaptcha/docs/verify)
- [Domain/ Package Name Validation](https://developers.google.com/recaptcha/docs/domain_validation)
- Admin Console
- [Settings](https://developers.google.com/recaptcha/docs/settings)
- [Analytics](https://developers.google.com/recaptcha/docs/analytics)
- Additional Settings
- [Language Codes](https://developers.google.com/recaptcha/docs/language)
- On this page
- [Placement on your website](https://developers.google.com/recaptcha/docs/v3#placement_on_your_website)
- [Automatically bind the challenge to a button](https://developers.google.com/recaptcha/docs/v3#automatically_bind_the_challenge_to_a_button)
- [Programmatically invoke the challenge](https://developers.google.com/recaptcha/docs/v3#programmatically_invoke_the_challenge)
- [Interpreting the score](https://developers.google.com/recaptcha/docs/v3#interpreting_the_score)
- [Actions](https://developers.google.com/recaptcha/docs/v3#actions)
- [Site Verify Response](https://developers.google.com/recaptcha/docs/v3#site_verify_response)
- [Tips](https://developers.google.com/recaptcha/docs/v3#tips)
- [Home](https://developers.google.com/)
- [Products](https://developers.google.com/products)
- [reCAPTCHA](https://developers.google.com/recaptcha)
- [Guides](https://developers.google.com/recaptcha/intro)
Was this helpful?
# reCAPTCHA v3Stay organized with collections Save and categorize content based on your preferences.
- On this page
- [Placement on your website](https://developers.google.com/recaptcha/docs/v3#placement_on_your_website)
- [Automatically bind the challenge to a button](https://developers.google.com/recaptcha/docs/v3#automatically_bind_the_challenge_to_a_button)
- [Programmatically invoke the challenge](https://developers.google.com/recaptcha/docs/v3#programmatically_invoke_the_challenge)
- [Interpreting the score](https://developers.google.com/recaptcha/docs/v3#interpreting_the_score)
- [Actions](https://developers.google.com/recaptcha/docs/v3#actions)
- [Site Verify Response](https://developers.google.com/recaptcha/docs/v3#site_verify_response)
- [Tips](https://developers.google.com/recaptcha/docs/v3#tips)

## Page Summary
outlined\_flag
- reCAPTCHA v3 provides a score-based system to assess user interactions without interrupting their experience, allowing you to take appropriate actions based on risk levels.
- You can implement reCAPTCHA v3 by either automatically binding it to a button or programmatically invoking it for more control over when it runs.
- reCAPTCHA v3 uses "actions" to categorize interactions, providing detailed data breakdown and adaptive risk analysis based on the specific context.
- reCAPTCHA v3 returns a score along with other details that you should verify on your backend to ensure the response is valid and the action is expected.
- You should analyze reCAPTCHA v3 scores within your admin console and adjust action thresholds based on your site's traffic and risk tolerance, starting with a default of 0.5.
reCAPTCHA v3 returns a score for each request without user friction. The score is based on interactions with your site and enables you to take an appropriate action for your site. Register reCAPTCHA v3 keys on the [reCAPTCHA Admin console](https://www.google.com/recaptcha/admin/create).
This page explains how to enable and customize reCAPTCHA v3 on your webpage.
## Placement on your website
reCAPTCHA v3 will never interrupt your users, so you can run it whenever you like without affecting conversion. reCAPTCHA works best when it has the most context about interactions with your site, which comes from seeing both legitimate and abusive behavior. For this reason, we recommend including reCAPTCHA verification on forms or actions as well as in the background of pages for analytics.
**Note:** reCAPTCHA tokens expire after two minutes. If you're protecting an action with reCAPTCHA, make sure to call `execute` when the user takes the action rather than on page load.
You can execute reCAPTCHA on as many actions as you want on the same page.
## Automatically bind the challenge to a button
The easiest method for using reCAPTCHA v3 on your page is to include the necessary JavaScript resource and add a few attributes to your html button.
1. Load the JavaScript API.
```
<script src="https://www.google.com/recaptcha/api.js"></script>
```
2. Add a callback function to handle the token.
```
<script>
function onSubmit(token) {
document.getElementById("demo-form").submit();
}
</script>
```
3. Add attributes to your html button.
```
<button class="g-recaptcha"
data-sitekey="reCAPTCHA_site_key"
data-callback='onSubmit'
data-action='submit'>Submit</button>
```
## Programmatically invoke the challenge
If you wish to have more control over when reCAPTCHA runs, you can use the `execute` method in `grecaptcha` object. To do this, you need to add a `render` parameter to the reCAPTCHA script load.
1. Load the JavaScript API with your sitekey.
```
<script src="https://www.google.com/recaptcha/api.js?render=reCAPTCHA_site_key"></script>
```
2. Call `grecaptcha.execute` on each action you wish to protect.
```
<script>
function onClick(e) {
e.preventDefault();
grecaptcha.ready(function() {
grecaptcha.execute('reCAPTCHA_site_key', {action: 'submit'}).then(function(token) {
// Add your logic to submit to your backend server here.
});
});
}
</script>
```
3. Send the token immediately to your backend with the request to [verify](https://developers.google.com/recaptcha/docs/verify).
## Interpreting the score
reCAPTCHA v3 returns a score (1.0 is very likely a good interaction, 0.0 is very likely a bot). Based on the score, you can take variable action in the context of your site. Every site is different, but below are some examples of how sites use the score. As in the examples below, take action behind the scenes instead of blocking traffic to better protect your site.
| Use case | Recommendation |
|---|---|
| homepage | See a cohesive view of your traffic on the admin console while filtering scrapers. |
| login | With low scores, require 2-factor-authentication or email verification to prevent credential stuffing attacks. |
| social | Limit unanswered friend requests from abusive users and send risky comments to moderation. |
| e-commerce | Put your real sales ahead of bots and identify risky transactions. |
reCAPTCHA learns by seeing real traffic on your site. For this reason, scores in a staging environment or soon after implementing may differ from production. As reCAPTCHA v3 doesn't ever interrupt the user flow, you can first run reCAPTCHA without taking action and then decide on thresholds by looking at your traffic in the [admin console](https://g.co/recaptcha/admin). By default, you can use a threshold of 0.5.
## Actions
reCAPTCHA v3 introduces a new concept: actions. When you specify an action name in each place you execute reCAPTCHA, you enable the following new features:
- A detailed break-down of data for your top ten actions in the [admin console](https://g.co/recaptcha/admin/)
- Adaptive risk analysis based on the context of the action, because abusive behavior can vary.
Importantly, when you verify the reCAPTCHA response, you should verify that the action name is the name you expect.
**Note:** Actions might contain only alphanumeric characters, slashes, and underscores. Actions must not be user-specific.
## Site Verify Response
Make the request to [verify the response token](https://developers.google.com/recaptcha/docs/verify) as with reCAPTCHA v2 or Invisible reCAPTCHA.
The response is a JSON object:
```
{
"success": true|false, // whether this request was a valid reCAPTCHA token for your site
"score": number // the score for this request (0.0 - 1.0)
"action": string // the action name for this request (important to verify)
"challenge_ts": timestamp, // timestamp of the challenge load (ISO format yyyy-MM-dd'T'HH:mm:ssZZ)
"hostname": string, // the hostname of the site where the reCAPTCHA was solved
"error-codes": [...] // optional
}
```
### Tips
1. `grecaptcha.ready()` runs your function when the reCAPTCHA library loads. To avoid race conditions with the `api.js`, include the `api.js` before your scripts that call grecaptcha, or continue to use the [onload callback](https://developers.google.com/recaptcha/docs/display#explicit_render) that's defined with the v2 API.
2. Try hooking the `execute` call to interesting or sensitive actions like Register, Password Reset, Purchase, or Play.
3. Use `https://www.google.com/recaptcha/api.js?trustedtypes=true` to load code compatible with [Trusted Types](https://web.dev/trusted-types/).
Was this helpful?
Except as otherwise noted, the content of this page is licensed under the [Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). For details, see the [Google Developers Site Policies](https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
\[\[\["Easy to understand","easyToUnderstand","thumb-up"\],\["Solved my problem","solvedMyProblem","thumb-up"\],\["Other","otherUp","thumb-up"\]\],\[\["Missing the information I need","missingTheInformationINeed","thumb-down"\],\["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"\],\["Out of date","outOfDate","thumb-down"\],\["Samples / code issue","samplesCodeIssue","thumb-down"\],\["Other","otherDown","thumb-down"\]\],\["Last updated 2024-07-10 UTC."\],\[\],\["reCAPTCHA v3 provides a score per request, indicating the likelihood of a good interaction. Implement it by registering keys and including the JavaScript API. Execute reCAPTCHA on forms, actions, or in the background using either an automated button binding or the \`grecaptcha.execute\` method. Verify the response token, and interpret scores (0.0-1.0) to decide actions like requiring multi-factor authentication. Define action names to gain detailed data in the admin console. Always verify the action name in the response.\\n"\]\]
- ### Connect
- [Blog](https://googledevelopers.blogspot.com/)
- [Bluesky](https://goo.gle/3FReQXN)
- [Instagram](https://www.instagram.com/googlefordevs/)
- [LinkedIn](https://www.linkedin.com/showcase/googledevelopers/)
- [X (Twitter)](https://twitter.com/googledevs)
- [YouTube](https://www.youtube.com/user/GoogleDevelopers)
- ### Programs
- [Google Developer Program](https://developers.google.com/program)
- [Google Developer Groups](https://developers.google.com/community)
- [Google Developer Experts](https://developers.google.com/community/experts)
- [Accelerators](https://developers.google.com/community/accelerators)
- [Google Cloud & NVIDIA](https://developers.google.com/community/nvidia)
- ### Developer consoles
- [Google API Console](https://console.developers.google.com/)
- [Google Cloud Platform Console](https://console.cloud.google.com/)
- [Google Play Console](https://play.google.com/apps/publish)
- [Firebase Console](https://console.firebase.google.com/)
- [Actions on Google Console](https://console.actions.google.com/)
- [Cast SDK Developer Console](https://cast.google.com/publish)
- [Chrome Web Store Dashboard](https://chrome.google.com/webstore/developer/dashboard)
- [Google Home Developer Console](https://console.home.google.com/)
[](https://developers.google.com/)
- [Android](https://developer.android.com/)
- [Chrome](https://developer.chrome.com/home)
- [Firebase](https://firebase.google.com/)
- [Google Cloud Platform](https://cloud.google.com/)
- [Google AI](https://ai.google.dev/)
- [All products](https://developers.google.com/products)
- [Terms](https://developers.google.com/terms/site-terms)
- [Privacy](https://policies.google.com/privacy)
- [Manage cookies](https://developers.google.com/recaptcha/docs/v3)
- [English](https://developers.google.com/recaptcha/docs/v3)
- [Deutsch](https://developers.google.com/recaptcha/docs/v3?hl=de)
- [Español](https://developers.google.com/recaptcha/docs/v3?hl=es)
- [Español – América Latina](https://developers.google.com/recaptcha/docs/v3?hl=es-419)
- [Français](https://developers.google.com/recaptcha/docs/v3?hl=fr)
- [Indonesia](https://developers.google.com/recaptcha/docs/v3?hl=id)
- [Italiano](https://developers.google.com/recaptcha/docs/v3?hl=it)
- [Polski](https://developers.google.com/recaptcha/docs/v3?hl=pl)
- [Português – Brasil](https://developers.google.com/recaptcha/docs/v3?hl=pt-br)
- [Tiếng Việt](https://developers.google.com/recaptcha/docs/v3?hl=vi)
- [Türkçe](https://developers.google.com/recaptcha/docs/v3?hl=tr)
- [Русский](https://developers.google.com/recaptcha/docs/v3?hl=ru)
- [עברית](https://developers.google.com/recaptcha/docs/v3?hl=he)
- [العربيّة](https://developers.google.com/recaptcha/docs/v3?hl=ar)
- [فارسی](https://developers.google.com/recaptcha/docs/v3?hl=fa)
- [हिंदी](https://developers.google.com/recaptcha/docs/v3?hl=hi)
- [বাংলা](https://developers.google.com/recaptcha/docs/v3?hl=bn)
- [ภาษาไทย](https://developers.google.com/recaptcha/docs/v3?hl=th)
- [中文 – 简体](https://developers.google.com/recaptcha/docs/v3?hl=zh-cn)
- [中文 – 繁體](https://developers.google.com/recaptcha/docs/v3?hl=zh-tw)
- [日本語](https://developers.google.com/recaptcha/docs/v3?hl=ja)
- [한국어](https://developers.google.com/recaptcha/docs/v3?hl=ko)
Info
Chat
API |
| Readable Markdown | [Skip to main content](https://developers.google.com/recaptcha/docs/v3#main-content)
- [Home](https://developers.google.com/recaptcha)
- [Guides](https://developers.google.com/recaptcha/intro)
- [Support](https://developers.google.com/recaptcha/docs/faq)
- Get Started
- [Introduction](https://developers.google.com/recaptcha/intro)
- [Choose a Type](https://developers.google.com/recaptcha/docs/versions)
- [Loading re CAPTCHA](https://developers.google.com/recaptcha/docs/loading)
- re CAPTCHA v3
- [re CAPTCHA v3](https://developers.google.com/recaptcha/docs/v3)
- re CAPTCHA v2
- [Checkbox](https://developers.google.com/recaptcha/docs/display)
- [Invisible](https://developers.google.com/recaptcha/docs/invisible)
- [Android](https://developer.android.com/training/safetynet/recaptcha.html)
- Server Side Validation
- [Verify the User’s Response](https://developers.google.com/recaptcha/docs/verify)
- [Domain/ Package Name Validation](https://developers.google.com/recaptcha/docs/domain_validation)
- Admin Console
- [Settings](https://developers.google.com/recaptcha/docs/settings)
- [Analytics](https://developers.google.com/recaptcha/docs/analytics)
- Additional Settings
- [Language Codes](https://developers.google.com/recaptcha/docs/language)
## reCAPTCHA v3Stay organized with collections Save and categorize content based on your preferences.
- On this page
- [Placement on your website](https://developers.google.com/recaptcha/docs/v3#placement_on_your_website)
- [Automatically bind the challenge to a button](https://developers.google.com/recaptcha/docs/v3#automatically_bind_the_challenge_to_a_button)
- [Programmatically invoke the challenge](https://developers.google.com/recaptcha/docs/v3#programmatically_invoke_the_challenge)
- [Interpreting the score](https://developers.google.com/recaptcha/docs/v3#interpreting_the_score)
- [Actions](https://developers.google.com/recaptcha/docs/v3#actions)
- [Site Verify Response](https://developers.google.com/recaptcha/docs/v3#site_verify_response)
- [Tips](https://developers.google.com/recaptcha/docs/v3#tips)
- reCAPTCHA v3 provides a score-based system to assess user interactions without interrupting their experience, allowing you to take appropriate actions based on risk levels.
- You can implement reCAPTCHA v3 by either automatically binding it to a button or programmatically invoking it for more control over when it runs.
- reCAPTCHA v3 uses "actions" to categorize interactions, providing detailed data breakdown and adaptive risk analysis based on the specific context.
- reCAPTCHA v3 returns a score along with other details that you should verify on your backend to ensure the response is valid and the action is expected.
- You should analyze reCAPTCHA v3 scores within your admin console and adjust action thresholds based on your site's traffic and risk tolerance, starting with a default of 0.5.
reCAPTCHA v3 returns a score for each request without user friction. The score is based on interactions with your site and enables you to take an appropriate action for your site. Register reCAPTCHA v3 keys on the [reCAPTCHA Admin console](https://www.google.com/recaptcha/admin/create).
This page explains how to enable and customize reCAPTCHA v3 on your webpage.
## Placement on your website
reCAPTCHA v3 will never interrupt your users, so you can run it whenever you like without affecting conversion. reCAPTCHA works best when it has the most context about interactions with your site, which comes from seeing both legitimate and abusive behavior. For this reason, we recommend including reCAPTCHA verification on forms or actions as well as in the background of pages for analytics.
You can execute reCAPTCHA on as many actions as you want on the same page.
## Automatically bind the challenge to a button
The easiest method for using reCAPTCHA v3 on your page is to include the necessary JavaScript resource and add a few attributes to your html button.
1. Load the JavaScript API.
```
<script src="https://www.google.com/recaptcha/api.js"></script>
```
2. Add a callback function to handle the token.
```
<script>
function onSubmit(token) {
document.getElementById("demo-form").submit();
}
</script>
```
3. Add attributes to your html button.
```
<button class="g-recaptcha"
data-sitekey="reCAPTCHA_site_key"
data-callback='onSubmit'
data-action='submit'>Submit</button>
```
## Programmatically invoke the challenge
If you wish to have more control over when reCAPTCHA runs, you can use the `execute` method in `grecaptcha` object. To do this, you need to add a `render` parameter to the reCAPTCHA script load.
1. Load the JavaScript API with your sitekey.
```
<script src="https://www.google.com/recaptcha/api.js?render=reCAPTCHA_site_key"></script>
```
2. Call `grecaptcha.execute` on each action you wish to protect.
```
<script>
function onClick(e) {
e.preventDefault();
grecaptcha.ready(function() {
grecaptcha.execute('reCAPTCHA_site_key', {action: 'submit'}).then(function(token) {
// Add your logic to submit to your backend server here.
});
});
}
</script>
```
3. Send the token immediately to your backend with the request to [verify](https://developers.google.com/recaptcha/docs/verify).
## Interpreting the score
reCAPTCHA v3 returns a score (1.0 is very likely a good interaction, 0.0 is very likely a bot). Based on the score, you can take variable action in the context of your site. Every site is different, but below are some examples of how sites use the score. As in the examples below, take action behind the scenes instead of blocking traffic to better protect your site.
| Use case | Recommendation |
|---|---|
| homepage | See a cohesive view of your traffic on the admin console while filtering scrapers. |
| login | With low scores, require 2-factor-authentication or email verification to prevent credential stuffing attacks. |
| social | Limit unanswered friend requests from abusive users and send risky comments to moderation. |
| e-commerce | Put your real sales ahead of bots and identify risky transactions. |
reCAPTCHA learns by seeing real traffic on your site. For this reason, scores in a staging environment or soon after implementing may differ from production. As reCAPTCHA v3 doesn't ever interrupt the user flow, you can first run reCAPTCHA without taking action and then decide on thresholds by looking at your traffic in the [admin console](https://g.co/recaptcha/admin). By default, you can use a threshold of 0.5.
## Actions
reCAPTCHA v3 introduces a new concept: actions. When you specify an action name in each place you execute reCAPTCHA, you enable the following new features:
- A detailed break-down of data for your top ten actions in the [admin console](https://g.co/recaptcha/admin/)
- Adaptive risk analysis based on the context of the action, because abusive behavior can vary.
Importantly, when you verify the reCAPTCHA response, you should verify that the action name is the name you expect.
## Site Verify Response
Make the request to [verify the response token](https://developers.google.com/recaptcha/docs/verify) as with reCAPTCHA v2 or Invisible reCAPTCHA.
The response is a JSON object:
```
{
"success": true|false, // whether this request was a valid reCAPTCHA token for your site
"score": number // the score for this request (0.0 - 1.0)
"action": string // the action name for this request (important to verify)
"challenge_ts": timestamp, // timestamp of the challenge load (ISO format yyyy-MM-dd'T'HH:mm:ssZZ)
"hostname": string, // the hostname of the site where the reCAPTCHA was solved
"error-codes": [...] // optional
}
```
### Tips
1. `grecaptcha.ready()` runs your function when the reCAPTCHA library loads. To avoid race conditions with the `api.js`, include the `api.js` before your scripts that call grecaptcha, or continue to use the [onload callback](https://developers.google.com/recaptcha/docs/display#explicit_render) that's defined with the v2 API.
2. Try hooking the `execute` call to interesting or sensitive actions like Register, Password Reset, Purchase, or Play.
3. Use `https://www.google.com/recaptcha/api.js?trustedtypes=true` to load code compatible with [Trusted Types](https://web.dev/trusted-types/).
Except as otherwise noted, the content of this page is licensed under the [Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). For details, see the [Google Developers Site Policies](https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
\[\[\["Easy to understand","easyToUnderstand","thumb-up"\],\["Solved my problem","solvedMyProblem","thumb-up"\],\["Other","otherUp","thumb-up"\]\],\[\["Missing the information I need","missingTheInformationINeed","thumb-down"\],\["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"\],\["Out of date","outOfDate","thumb-down"\],\["Samples / code issue","samplesCodeIssue","thumb-down"\],\["Other","otherDown","thumb-down"\]\],\["Last updated 2024-07-10 UTC."\],\[\],\["reCAPTCHA v3 provides a score per request, indicating the likelihood of a good interaction. Implement it by registering keys and including the JavaScript API. Execute reCAPTCHA on forms, actions, or in the background using either an automated button binding or the \`grecaptcha.execute\` method. Verify the response token, and interpret scores (0.0-1.0) to decide actions like requiring multi-factor authentication. Define action names to gain detailed data in the admin console. Always verify the action name in the response.\\n"\]\] |
| Shard | 95 (laksa) |
| Root Hash | 744624608793826895 |
| Unparsed URL | com,google!developers,/recaptcha/docs/v3 s443 |