CAPTCHA Solving API in Python: Integration and Automation Guide

Anyone who has worked with web scraping or browser automation has inevitably run into CAPTCHAs. Websites deploy them as bot-mitigation barriers, and for Python scripts this presents a real obstacle. Manual solving is not an option when you need to process thousands of pages. That is exactly why CAPTCHA-solving services with clean APIs exist — and why they integrate so naturally into Python-based workflows.
This article covers how these APIs work under the hood, which CAPTCHA types they support, and provides ready-to-run Python integration examples. No filler — just what you actually need to get it working.
How a CAPTCHA Solving API Works
CAPTCHA-solving services follow a straightforward model: you submit CAPTCHA data to the service endpoint, and it returns click coordinates or performs the required interaction on your behalf. On the server side, a neural network trained on millions of CAPTCHA samples handles the recognition.
The most convenient approach for Python is a module that accepts a browser page object and handles all CAPTCHA interactions autonomously — clicking image tiles, dragging sliders, performing other visual actions. You no longer need to manually extract parameters and inject token responses. The entire process takes between 2 and 40 seconds depending on the CAPTCHA type and current service load.
Supported CAPTCHA Types
Modern solving services go well beyond simple distorted-text images. Here are the main categories:
Image-based CAPTCHAs. Challenges that require selecting specific objects in an image, clicking target coordinates, or completing a visual task. These are typically resolved the fastest.
reCAPTCHA v2. Google's widely deployed CAPTCHA, present on millions of websites. Presents a "I'm not a robot" checkbox and occasionally requires image tile selection.
hCaptcha. A popular reCAPTCHA alternative commonly found on sites that monetise CAPTCHA impressions rather than paying Google. The bypass workflow mirrors reCAPTCHA v2: obtain a token from the solving service and inject it into the form.
GeeTest, FunCaptcha (Arkose Labs), Amazon WAF. Less common but increasingly present on high-traffic platforms. GeeTest requires assembling a sliding puzzle; FunCaptcha asks users to rotate an object. Amazon WAF protects AWS-hosted services. All three require passing additional parameters to the API.
Search engine and platform-specific CAPTCHAs. If your automation targets large web platforms — collecting rankings, analysing search results, monitoring behavioural metrics — you will encounter their proprietary anti-bot systems. These differ significantly from Google reCAPTCHA, and not all international providers support them. Choose a service that explicitly lists support for the platforms you need.
Python Integration: the Cap.Guru Module
The Cap.Guru module operates at the browser level: you pass it a Playwright page object or a Selenium WebDriver instance, and it autonomously locates the CAPTCHA on the page, submits the relevant data to the solving server, and executes the required interactions — clicking image tiles, moving sliders, assembling puzzles. Your code only needs to call a single method.
Installation
The module is distributed as a captcha_solver directory that you copy into your project. Download the latest version from the Cap.Guru documentation.
Playwright + Stealth (recommended)
For maximum stealth, use Playwright together with the stealth library, which suppresses browser automation fingerprints:
# pip install playwright playwright-stealth
# playwright install chrome
import asyncio
from playwright.async_api import async_playwright
from playwright_stealth import stealth_async
from captcha_solver import CaptchaSolver
async def main():
async with async_playwright() as p:
browser = await p.chromium.launch(
headless=False,
channel="chrome",
args=["--disable-blink-features=AutomationControlled"],
)
page = await browser.new_page()
await stealth_async(page)
await page.goto("https://site.com/page-with-captcha")
solver = CaptchaSolver(
page=page,
api_key="YOUR_KEY",
debug=True,
attempts=5,
)
await solver.solve_recaptcha2()
await browser.close()
asyncio.run(main())
The attempts parameter controls how many retries the module will make if the first attempt fails. Setting debug=True enables verbose console logging, which is useful during development and troubleshooting.
Selenium + undetected-chromedriver
If your existing stack uses Selenium, the module supports it as well. Combined with undetected-chromedriver, the setup looks like this:
# pip install undetected-chromedriver
import undetected_chromedriver as uc
from captcha_solver import CaptchaSolver
def main():
driver = uc.Chrome(headless=False)
try:
driver.get("https://site.com/page-with-captcha")
solver = CaptchaSolver(
driver=driver,
api_key="YOUR_KEY",
debug=True,
attempts=5,
)
solver.solve_other()
finally:
driver.quit()
if __name__ == "__main__":
main()
Note that in the Selenium variant all solver methods are called synchronously (no await), whereas the Playwright variant is fully asynchronous.
Available Methods
The module exposes a dedicated method for each CAPTCHA type:
await solver.solve_recaptcha2() # Google reCAPTCHA v2
await solver.solve_hcaptcha() # hCaptcha
await solver.solve_geetest() # GeeTest (puzzles, sliders)
await solver.solve_funcaptcha() # Arkose FunCAPTCHA
await solver.solve_tiktok() # TikTok CAPTCHA
await solver.solve_other() # Universal fallback
solve_other() is a universal fallback. Use it when the CAPTCHA type is unknown or when the site employs non-standard protection mechanisms. The module will detect the type automatically and attempt to solve it.
If you need to target a specific CAPTCHA container on the page — for example when multiple are present — pass a CSS selector via the selector parameter:
solver = CaptchaSolver(
page=page,
api_key="YOUR_KEY",
selector="#captcha-container", # CSS selector for the CAPTCHA container
)
When This Approach Shines
Passing a page object directly to the solver works especially well in several scenarios. First: CAPTCHAs that require visual interaction — clicking image tiles, drag-and-drop, sliders. The Cap.Guru module handles all clicks and slider movements automatically.
Second: CAPTCHAs that appear unpredictably. If you cannot determine in advance whether a page will present reCAPTCHA, hCaptcha, or something else entirely, solve_other() eliminates the need to branch on CAPTCHA type.
Third: rapid prototyping. When you need a working script in 15 minutes, the "pass the page, call the method" pattern saves significant development time.
Error Handling
In production, CAPTCHAs do not always resolve on the first attempt. The service may be under load, the API key balance may be exhausted, or the image may be unreadable. The Cap.Guru module raises a RuntimeError if all retry attempts are exhausted without a successful result:
try:
await solver.solve_recaptcha2()
except RuntimeError as e:
if "ERROR_CAPTCHA_UNSOLVABLE" in str(e):
print("CAPTCHA could not be solved — consider increasing attempts")
else:
print(f"Solver error: {e}")
The attempts parameter passed to the CaptchaSolver constructor controls the maximum number of attempts. The default is 5. For highly variable CAPTCHAs such as GeeTest and FunCaptcha, raising this to 8–10 is advisable.
If the service returns an incorrect solution, you should report it via the report method. This improves recognition quality over time and may trigger a refund for the failed solve.
Choosing a Solving Service: What to Look For
There are several evaluation criteria beyond price alone.
Throughput and latency. Expected solve time for simple CAPTCHAs is 5–10 seconds; reCAPTCHA typically falls in the 2–10 second range. If you are running concurrent scrapers, latency directly impacts overall throughput.
Accuracy. Reputable services achieve above 95% solve rates. Not all providers guarantee consistent results on complex CAPTCHA variants.
CAPTCHA type coverage. reCAPTCHA v2 is supported by virtually every provider. GeeTest v4 and platform-specific CAPTCHAs are a different story — coverage varies significantly.
Documentation and SDK quality. A well-maintained Python module with clear documentation is a major time-saver. Look for examples covering different automation stacks: Selenium, Playwright, undetected-chromedriver.
Pricing model. Pricing varies considerably across providers. Some charge a flat subscription fee; others bill only for successfully solved CAPTCHAs. The latter model is generally preferable, particularly early on when volumes are unpredictable.
Common Integration Mistakes
A few pitfalls that come up repeatedly:
1. Stale CAPTCHA parameters. If the site has updated its protection layer or you copied parameters from a different page, the token will fail validation. Always fetch parameters dynamically, immediately before submission.
2. Polling the server too aggressively. Polling intervals below 5 seconds can trigger rate-limiting responses from the service. An interval of 5–10 seconds between status checks is optimal.
3. Ignoring timeouts. reCAPTCHA can occasionally take 2–3 minutes to resolve. A 30-second timeout will cause your script to abort and waste the solve fee.
4. No retry logic. The service may return a transient error. A single retry after 10 seconds resolves the issue in most cases.
Conclusion
Integrating a CAPTCHA solving API into a Python project requires no deep specialised knowledge — just an understanding of the basic mechanics. The Cap.Guru module reduces the integration to a handful of lines: pass the page object, call the method for the target CAPTCHA type, and the module handles all clicks, slider movements, and browser-level interactions automatically.
For CAPTCHAs that require visual interaction — image tile clicks, sliders, GeeTest puzzles — this is the simplest and most reliable automation approach available. Both Playwright and Selenium are supported, and the solve_other() universal fallback covers unpredictable scenarios.
One final note: always test against real targets. Demo CAPTCHA pages often behave differently from production environments, which may apply additional checks such as User-Agent analysis, cookie validation, and browser fingerprinting.
Cap.guru