ProductsIntegrationsResourcesDocumentationPricing
Start Now

© 2026 CapSolver. All rights reserved.

CONTACT US

Slack: lola@capsolver.com

Products

  • reCAPTCHA v2
  • reCAPTCHA v3
  • Cloudflare Turnstile
  • Cloudflare Challenge
  • AWS WAF
  • Browser Extension
  • Many more CAPTCHA types

Integrations

  • Selenium
  • Playwright
  • Puppeteer
  • n8n
  • Partners
  • View All Integrations

Resources

  • Referral System
  • Documentation
  • API Reference
  • Blog
  • FAQs
  • Glossary
  • Status

Legal

  • Terms & Conditions
  • Privacy Policy
  • Refund Policy
  • Don't Sell My Info
Blog/reCAPTCHA/How to Solve reCAPTCHA v2 with Python
Sep19, 2023

How to Solve reCAPTCHA v2 with Python

Ethan Collins

Ethan Collins

Pattern Recognition Specialist

TL;DR

  • This guide shows how to solve reCAPTCHA v2 using Python and CapSolver, with both Proxy and Proxyless task types.
  • Includes deeper explanations, common troubleshooting tips, and expanded examples for real-world automation scenarios.
  • Ideal for developers working on scraping, SEO automation, SERP data extraction, form-filling bots, and CI testing pipelines.

Introduction

Google reCAPTCHA v2 is widely used to block automated traffic.
If you’re building scrapers, automation workflows, account creators, online form submitters, or SERP tools, solving reCAPTCHA v2 is practically mandatory.

This expanded guide walks you through:

  • Installation
  • How each task type works
  • Detailed Python examples
  • When to use proxy / proxyless
  • Error handling
  • Key implementation notes for high-value targets

⚙️ Prerequisites

  • A working proxy (Optional, read both examples, as one require proxy and other don't require)
  • Python installed
  • CapSolver API key

🤖 Install Necessary Packages

Execute the following commands to install the required packages:

python Copy
pip install capsolver

👨‍💻 Python Code for solve reCaptcha v2 with your proxy

Here's a Python sample script to accomplish the task:

python Copy
import capsolver

# Consider using environment variables for sensitive information
PROXY = "http://username:password@host:port"
capsolver.api_key = "Your Capsolver API Key"
PAGE_URL = "PAGE_URL"
PAGE_KEY = "PAGE_SITE_KEY"

def solve_recaptcha_v2(url,key):
    solution = capsolver.solve({
        "type": "ReCaptchaV2Task",
        "websiteURL": url,
        "websiteKey":key,
        "proxy": PROXY
    })
    return solution


def main():
    print("Solving reCaptcha v2")
    solution = solve_recaptcha_v2(PAGE_URL, PAGE_KEY)
    print("Solution: ", solution)

if __name__ == "__main__":
    main()

👨‍💻 Python Code for solve reCaptcha v2 without proxy

Here's a Python sample script to accomplish the task:

python Copy
import capsolver

# Consider using environment variables for sensitive information
capsolver.api_key = "Your Capsolver API Key"
PAGE_URL = "PAGE_URL"
PAGE_KEY = "PAGE_SITE_KEY"

def solve_recaptcha_v2(url,key):
    solution = capsolver.solve({
        "type": "ReCaptchaV2TaskProxyless",
        "websiteURL": url,
        "websiteKey":key,
    })
    return solution



def main():
    print("Solving reCaptcha v2")
    solution = solve_recaptcha_v2(PAGE_URL, PAGE_KEY)
    print("Solution: ", solution)

if __name__ == "__main__":
    main()

⚠️ Change these variables

  • PROXY: Update with your proxy details. The format should be http://username:password@ip:port. ONLY REQUIRED with ReCaptchaV2Task
  • capsolver.api_key: Obtain your API key from the Capsolver Dashboard.
  • PAGE_URL: Replace with the URL of the website for which you wish to solve reCaptcha v2.
  • PAGE_KEY: Replace with the SITEKEY of the website for which you wish to solve reCaptcha v2.

📌 Conclusion

Solving reCAPTCHA v2 reliably is essential for modern automation — whether you're running large-scale scraping pipelines, automating form submissions, performing SERP data extraction, or building custom AI agents that interact with the web. With CapSolver, the entire process becomes far more predictable, stable, and scalable.
By choosing the correct task type (Proxy vs Proxyless), validating your sitekeys, and ensuring your proxy setup is solid, you can achieve near-instant CAPTCHA resolutions with minimal overhead.

FAQ

1. Do I need a proxy for every website?

No — many websites work perfectly with the Proxyless task. You only need proxies for higher security targets (e.g., marketplaces, ticketing platforms, Google Search, login flows, etc.).


2. What type of proxy works best with reCAPTCHA v2?

Residential or ISP proxies deliver the best stability.
Datacenter proxies may work but often get flagged on high-value sites.


3. How fast does CapSolver return the token?

Most reCAPTCHA v2 tasks resolve in 1–5 seconds, depending on website difficulty and queue load.


4. Can I reuse the same token multiple times?

No. Each token is single-use and expires very quickly (usually within ~120 seconds).


👀 More information

  • How to solve reCaptcha v3 and get a score 0.7-0.9 like a human
  • Solve all types of reCaptcha v2 / v2 invisible / v2 enterprise / v3 / v3 enterprise

Boost your automation budget instantly!
Use bonus code CAPN when topping up your CapSolver account to get an extra 5% bonus on every recharge — with no limits.
Redeem it now in your CapSolver Dashboard

🧾 Key Takeaways

  • Use ReCaptchaV2Task + good proxy for high-value targets.
  • Use Proxyless only for less protected sites.
  • CapSolver drastically simplifies integration — just call capsolver.solve().
  • reCAPTCHA v2 becomes stricter each year; stable solvers are essential for production workflows.
  • Always verify sitekey and URL carefully — 90% of beginner mistakes come from incorrect sitekeys.

More

reCAPTCHAApr 16, 2026

reCAPTCHA Score Explained: Range, Meaning, and How to Improve It

Understand reCAPTCHA v3 score range (0.0 to 1.0), its meaning, and how to improve your score. Learn how to handle low scores and optimize user experience.

Rajinder Singh
Rajinder Singh
reCAPTCHAApr 16, 2026

reCAPTCHA Invalid Site Key or Token? Causes & Fix Guide

Facing "reCAPTCHA Invalid Site Key" or "invalid reCAPTCHA token" errors? Discover common causes, step-by-step fixes, and troubleshooting tips to resolve reCAPTCHA verification failed issues. Learn how to fix reCAPTCHA verification failed please try again.

Contents

Aloísio Vítor
Aloísio Vítor
reCAPTCHAApr 15, 2026

reCAPTCHA Verification Failed? How to Fix "Please Try Again" Errors

Fix reCAPTCHA verification failed errors fast. Step-by-step manual fixes for users and a Python API guide for developers using CapSolver. Covers v2, v3, and Enterprise.

Adélia Cruz
Adélia Cruz
reCAPTCHAApr 15, 2026

reCAPTCHA v2 vs v3: Key Differences Every Developer Should Know

Understand the difference between reCAPTCHA v2 and v3 — how each works, when to use them, and how automated workflows handle both. A clear, technical comparison for developers.

Nikolai Smirnov
Nikolai Smirnov