Skip to main content

CAPTCHA solving API for AI agents. Free tier: 100 solves. Supports Turnstile, reCAPTCHA, hCaptcha.

Project description

gatesolve

Solve CAPTCHAs with x402 micropayments. Built for AI agents.

PyPI Python

Install

pip install gatesolve

Quick Start

from gatesolve import GateSolve

gs = GateSolve()

# Solve a Cloudflare Turnstile CAPTCHA
solution = gs.solve(
    captcha_type="turnstile",
    sitekey="0x4AAAAAAAB...",
    pageurl="https://example.com",
)

print(solution.token)  # Use this to bypass the CAPTCHA
print(solution.solve_time)  # e.g. "1.8s"
print(solution.payment.amount)  # e.g. "0.02"

Async

import asyncio
from gatesolve import AsyncGateSolve

async def main():
    async with AsyncGateSolve() as gs:
        solution = await gs.solve(
            captcha_type="turnstile",
            sitekey="0x4AAAAAAAB...",
            pageurl="https://example.com",
        )
        print(solution.token)

asyncio.run(main())

With Playwright

from gatesolve import GateSolve
from playwright.sync_api import sync_playwright

gs = GateSolve()

with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page()
    page.goto("https://protected-site.com")
    
    sitekey = page.locator("[data-sitekey]").get_attribute("data-sitekey")
    
    solution = gs.solve(
        captcha_type="turnstile",
        sitekey=sitekey,
        pageurl=page.url,
    )
    
    page.evaluate(f"""
        document.querySelector('[name="cf-turnstile-response"]')
            .value = '{solution.token}';
    """)
    page.click("button[type=submit]")

Configuration

gs = GateSolve(
    base_url="https://api.gatesolve.dev",  # API endpoint
    wallet_address="0x...",                  # Your USDC wallet
    network="base",                          # Base L2 (default)
    max_price=0.05,                          # Max price per solve
    timeout=30,                              # Timeout in seconds
    max_retries=3,                           # Auto-retry on failure
)

Supported CAPTCHAs

Type SDK Name Price
Cloudflare Turnstile turnstile $0.02
reCAPTCHA v2 recaptcha_v2 $0.03
reCAPTCHA v3 recaptcha_v3 $0.02
hCaptcha hcaptcha $0.03

How x402 Works

  1. You call gs.solve()
  2. SDK sends request to GateSolve API
  3. API returns HTTP 402 with payment details
  4. SDK pays via USDC on Base L2
  5. API returns the CAPTCHA solution

No API keys. No accounts. The payment IS the authentication.

Error Handling

from gatesolve import GateSolve, SolveError, RateLimitError

gs = GateSolve()

try:
    solution = gs.solve(...)
except RateLimitError as e:
    print(f"Rate limited, retry in {e.retry_after}s")
except SolveError as e:
    print(f"Solve failed: {e.message} (status: {e.status_code})")

Links

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gatesolve-0.2.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gatesolve-0.2.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file gatesolve-0.2.0.tar.gz.

File metadata

  • Download URL: gatesolve-0.2.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for gatesolve-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a2df89c7cbba39043f7001b874b5d13af3bdd400ddffafd3e5d6b2c304047bfb
MD5 affdd1ce138fafbd0e87c3e1ac95d1e5
BLAKE2b-256 0c36f24c50401adcbb361b8e7d802884368dedcf35f2a89de10bd4dd3d8fae49

See more details on using hashes here.

File details

Details for the file gatesolve-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gatesolve-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for gatesolve-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64a4907ca17e549c24c3d3743d59ff0a6359e3c99298f6d6434ec652abc48451
MD5 9a8a2a3705a7e132c79f237073036469
BLAKE2b-256 cae2c846b1662fd030067e7dfa1d769610856f36b4b9c3fec1679d183fff8543

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page