How To Bypass Google reCaptcha Using Node.Js
Tags: node, 2captcha, bypasscaptcha, recaptcha
Published: 2021-10-17 13:02:44

The article is originally published to my blog: [Solve Google reCaptcha using Node.Js](https://stackblogger.com/bypass-google-recaptcha/)

Ever wondered about bypassing a Google reCaptcha using some captcha solver techniques? If yes, your next question must be how? Well, I have a quick solution that will help you bypass a Google reCaptcha using Node.Js. You can solve Google reCaptcha v2 and v3 both with the help of this tool.

I am using [2Captcha](https://www.npmjs.com/package/2captcha) library to solve the reCaptcha. It is a Captcha Solving Software that bypasses the captcha within seconds.

## Here is how to bypass captcha

The process of bypassing a captcha is mentioned below-

* Get the Captcha image from page in the form of data-sitekey parameter
* Transfer the parameter to 2captcha service
* The employee at 2captcha solves it
* Once it is solved, we get the response
* The response needs to set in the google reCaptcha textarea to make it work.

That’s it! Isn’t it easy? Yes its pretty easy to bypass. Let’s implement it in code.

## Bypass Google Recaptcha using Node.Js

Here is step by step implementation of solving google recaptcha using Node.Js:

## Setup Node.Js Application

*You can skip this step if you have a existing Node.Js Application.*

I am using [Express Generator](https://expressjs.com/en/starter/generator.html) to generate a Node.Js boilerplate.

```javascript
express bypass-captcha
```

![Create a Node.Js Boilerplate](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5kfl9ywqstsmlapc3mc.PNG)

## Install 2captcha

Install the 2captcha package in Node.Js application.
```
npm install 2captcha
```

![Install 2captcha package](https://stackblogger.com/wp-content/uploads/2021/10/install-2captcha-min.png)

## Get 2captcha API Key

The next step is to get a 2captcha API key. Create an Account at [2captcha](https://2captcha.com/auth/register). Confirm your account by clicking on the link sent to your mail. Go to [Setting page](https://2captcha.com/auth/register) to get your API key.

![2Captcha API Key](https://stackblogger.com/wp-content/uploads/2021/10/2captcha-api-key-min.png)

## Integrate 2Captcha Code to bypass Google reCaptcha

Once everything is done, integrate the 2Captcha code.

```javascript
const Captcha = require("2captcha")
 
// A new 'solver' instance with our API key
const solver = new Captcha.Solver("<Your 2captcha api key>")
 
/* Example ReCaptcha Website */
/*****
  @params
    - dataSiteKey
    - website url where captcha is placed
*****/
solver.recaptcha("6Ld2sf4SAAAAAKSgzs0Q13IZhY02Pyo31S2jgOB5", "https://patrickhlauke.github.io/recaptcha/")
 
.then((res) => {
    console.log(res)
})
```

Pass the API key in above code.

That’s it!! You have successfully bypass the Google v2/v3 reCaptcha. You can get more details about 2Captcha APIs [here](https://2captcha.com/2captcha-api).

## Common Questions

### How to get Data Site Key

You need to pass a `data-sitekey` value to 2Captcha service in order to bypass it. But the question comes- how would I get `data-sitekey` value? Here is the solution.

Open the website in browser of which you want to solve the Google reCaptcha. For example, I want to solve reCaptcha at following website: `https://patrickhlauke.github.io/recaptcha`

![Solve reCaptcha of https://patrickhlauke.github.io/recaptcha/](https://stackblogger.com/wp-content/uploads/2021/10/solve-google-recaptcha-min.png)

Now open “**View Page Source**” of website. Search for `data-sitekey` parameter on page. Copy the value and send in 2Captcha service.

![View Page Source](https://stackblogger.com/wp-content/uploads/2021/10/view-page-source-min.png)

The article is originally published to my blog: [Solve Google reCaptcha using Node.Js](https://stackblogger.com/bypass-google-recaptcha/)

## Conclusion

In this article in we learnt how to bypass captcha on websites using Node.Js. You can solve many captchas using this tool. More detail [here](https://2captcha.com/).

Must Read:
[Post Photo / Link to Tumblr using Node.Js](https://stackblogger.com/tag/tumblr/)
[Get data from website that does not provide API](https://stackblogger.com/how-to-get-data-from-website-that-does-not-provide-api/)