Solve reCaptcha v2

Logo of Capsolver

CapSolver Blogger

How to use capsolver

18-May-2023

Solving reCaptcha V2 with CapSolver API

If you're struggling with reCaptcha v2 and need a way to solve it, this guide is for you. We'll use the CapSolver API to solve reCaptcha v2 easily. You can either use your own proxies with ReCaptchaV2Task or use the server's built-in proxy with ReCaptchaV2TaskProxyLess.

Creating a Task

To solve reCaptcha v2, you first need to create a task using the createTask method.

Here's the structure of the task object:

  • type: Required. This should be ReCaptchaV2Task or ReCaptchaV2TaskProxyLess.
  • websiteURL: Required. This is the web address of the website using reCaptcha v2.
  • websiteKey: Required. This is the domain's public key.
  • proxy: Optional. If you're using a proxy, you can include it here.
  • isInvisible: Optional. If the reCaptcha doesn't have pageAction, set this to true.
  • userAgent: Optional. If you're emulating a browser, include its User-Agent here.
  • cookies: Optional. If you need to use cookies, include them here.

Here's an example request:

{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "ReCaptchaV2Task",
    "websiteURL": "site",
    "websiteKey": "site key",
    "isInvisible": false,
    "userAgent": "",
    "cookies": [
      {
        "name": "__Secure-3PSID",
        "value": "sdadasdasdsda"
      },
      {
        "name": "__Secure-3PAPISID",
        "value": "sd/AytXQTb6RUALqxSEL"
      }
    ],
    "proxy": ""
  }
}

Once the task is successfully submitted, you'll receive a Task ID in the response:

{
    "errorId": 0,
    "errorCode": "",
    "errorDescription": "",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}

Getting Results

Once you have the Task ID, you can use it to retrieve the solution. Submit the Task ID with the getTaskResult method. The results should be ready within an interval of 1s to 10s.

Here's an example request:

{
    "clientKey": "YOUR_API_KEY",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}

The response will include the solution token:

{
    "errorId": 0,
    "errorCode": null,
    "errorDescription": null,
    "solution": {
        "userAgent": "xxx", 
        "expireTime": 1671615324290, 
        "gRecaptchaResponse": "3AHJ....." // This is the solution token
    },
    "status": "ready"
}

Solve reCaptcha v2 with Python:

# Install the CapSolver SDK
# pip install --upgrade capsolver

# Set the CapSolver API key
# export CAPSOLVER_API_KEY='YOUR_API_KEY'

import capsolver
# capsolver.api_key = 'YOUR_API_KEY'

# Solve a reCAPTCHA v2 challenge
solution = capsolver.solve({
    "type": "ReCaptchaV2TaskProxyLess",
    "websiteURL": "site url",
    "websiteKey": "site key",
})

Solve reCaptcha v2 with GO:

package main

import (
    "fmt"
    capsolver_go "github.com/capsolver/capsolver-go"
    "log"
)

func main() {
    // Install the CapSolver SDK
    // go get github.com/capsolver/capsolver-go

    // Set the CapSolver API key
    // export CAPSOLVER_API_KEY='YOUR_API_KEY'
    // or
    // capSolver := CapSolver{apiKey:"YOUR_API_KEY"}

    capSolver := capsolver_go.CapSolver{}
    solution, err := capSolver.Solve(map[string]any{
        "type": "ReCaptchaV2TaskProxyLess",
        "websiteURL": "https://www.google.com/recaptcha/api2/demo",
        "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
    })
    if err != nil {
        log.Fatal(err)
        return
    }
    fmt.Println(solution)
}

Please replace YOUR_API_KEY with your actual CapSolver API key, and replace the websiteURL and websiteKey with the actual website URL and website key for the reCAPTCHA challenge you are trying to solve

Pricing

For information on pricing, please visit our pricing page.

More Information of how to solve reCaptcha v2

Visit this page

Capsolver Team 💜

更多

reCAPTCHA
reCAPTCHA自动解决器 - 自动解决reCAPTCHAs

在当今数字环境中,保护网站免受自动机器人的攻击变得至关重要,这就是为什么reCAPTCHA被广泛采用的原因。尽管reCAPTCHA具有重要的作用,但手动解决它们可能会耗费时间并令人沮丧...

reCAPTCHA

23-Feb-2024

如何以0.9分识别所有reCAPTCHA类型,包括v2以及v3和v3的企业版
如何以0.9分识别所有reCAPTCHA类型,包括v2以及v3和v3的企业版

本文将为您提供一种解决方案,如果您正在处理许多无效令牌的情况。只需三个简单的步骤,您就可以使用CapSolver轻松通过0.9分的reCAPTCHA Enterprise v2 / v2隐形和v3 / v3企业版。

reCAPTCHA

28-Jun-2023

如何识别和查找 reCAPTCHA v3 的值
如何识别和查找 reCAPTCHA v3 的值

recaptcha分数是什么意思?如何识别和查找 reCAPTCHA v3 的值?提供有关 Capsolver 服务的自动 reCAPTCHA V3 解析的全面指南。

reCAPTCHA

27-Jun-2023

使用CapSolver自动识别谷歌验证码
使用CapSolver自动识别谷歌验证码

Google的reCAPTCHA是一种网站反垃圾和防恶意活动的保护措施。这个高级安全功能利用了先进的风险分析机制以及灵活的CAPTCHA,以阻止自动化软件在您的网站上进行有害操作,同时确保真实用户的顺畅通行

reCAPTCHA

16-Jun-2023

使用CapSolver解决reCAPTCHAv2隐形验证码
使用CapSolver解决reCAPTCHAv2隐形验证码

reCAPTCHA v2隐形版本是reCAPTCHA v2的一个变体,它在后台工作,为用户提供更无缝的体验,不需要任何特定的用户交互,就像以前的版本一样。

reCAPTCHA

16-Jun-2023

如何绕过/自动识别reCAPTCHA v3验证码
如何绕过/自动识别reCAPTCHA v3验证码

在本技术博客中,我们将通过使用CapSolver指导您绕过reCaptcha v3的过程。

reCAPTCHA

22-May-2023