
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
raven-python-client
Advanced tools
A Python client library for the Raven Captcha API with sync and async support
A Python client library for the Raven Captcha API, providing both synchronous and asynchronous interfaces for solving Google reCAPTCHA v2 and v3 challenges.
Install from PyPI:
pip install raven-captcha-solver
import asyncio
from raven import AsyncRavenClient
async def solve_captcha():
client = AsyncRavenClient(api_key="your-api-key")
# Solve reCAPTCHA v2
result = await client.google.RecaptchaV2(
website_url="https://example.com",
website_key="6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
)
print(f"Solution token: {result.solution.token}")
# Run the async function
asyncio.run(solve_captcha())
from raven import RavenClient
client = RavenClient(api_key="your-api-key")
# Solve reCAPTCHA v3
result = client.google.RecaptchaV3(
website_url="https://example.com",
website_key="6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
action="submit"
)
print(f"Solution token: {result.solution.token}")
client = AsyncRavenClient(
api_key="your-api-key",
base_url="https://ai.ravens.best", # Optional, default shown
timeout=30.0 # Optional, request timeout in seconds
)
client = RavenClient(
api_key="your-api-key",
base_url="https://ai.ravens.best", # Optional, default shown
timeout=30.0 # Optional, request timeout in seconds
)
Both async and sync clients provide the same methods under client.google:
Solves Google reCAPTCHA v2 challenges.
# Async
result = await client.google.RecaptchaV2(
website_url="https://example.com",
website_key="site-key",
invisible=None, # Optional: True for invisible captcha
enterprise=None, # Optional: True for enterprise mode
action=None, # Optional: action string
proxy_scheme=None, # Optional: "http" or "https"
proxy_host=None, # Optional: proxy hostname
proxy_port=None, # Optional: proxy port
proxy_username=None, # Optional: proxy auth username
proxy_password=None, # Optional: proxy auth password
max_retry=None, # Optional: max retry attempts
poll_interval=1.0, # Optional: polling interval in seconds
timeout=None # Optional: max wait time, None = indefinite
)
# Sync - same parameters
result = client.google.RecaptchaV2(...)
Solves Google reCAPTCHA v3 challenges.
# Async
result = await client.google.RecaptchaV3(
website_url="https://example.com",
website_key="site-key",
action=None, # Optional: action for v3 scoring
enterprise=None, # Optional: True for enterprise mode
proxy_scheme=None, # Optional: "http" or "https"
proxy_host=None, # Optional: proxy hostname
proxy_port=None, # Optional: proxy port
proxy_username=None, # Optional: proxy auth username
proxy_password=None, # Optional: proxy auth password
max_retry=None, # Optional: max retry attempts
poll_interval=1.0, # Optional: polling interval in seconds
timeout=None # Optional: max wait time, None = indefinite
)
# Sync - same parameters
result = client.google.RecaptchaV3(...)
All methods return a TaskStatusResponse object:
@dataclass
class TaskStatusResponse:
success: bool # Whether the task completed successfully
status: str # Task status: "completed", "processing", "failed"
created_at: Optional[str] # Task creation timestamp
task_id: str # Unique task identifier
solution: Solution # Contains the captcha solution
@dataclass
class Solution:
token: Optional[str] # The captcha solution token
duration: Optional[Any] # Time taken to solve
Solves Cloudflare Turnstile challenges. This provider supports proxy configuration only; no additional options are sent.
# Async
result = await client.cloudflare.Turnstile(
website_url="https://example.com",
website_key="site-key",
proxy_scheme=None, # Optional: "http" or "https"
proxy_host=None, # Optional: proxy hostname
proxy_port=None, # Optional: proxy port
proxy_username=None,# Optional: proxy auth username
proxy_password=None,# Optional: proxy auth password
max_retry=None, # Optional: max retry attempts
poll_interval=1.0, # Optional: polling interval in seconds
timeout=None # Optional: max wait time, None = indefinite
)
print(result.solution.token)
# Sync - same parameters
result = client.cloudflare.Turnstile(
website_url="https://example.com",
website_key="site-key"
)
result = await client.google.RecaptchaV2(
website_url="https://example.com",
website_key="site-key",
proxy_scheme="http",
proxy_host="proxy.example.com",
proxy_port="8080",
proxy_username="user",
proxy_password="pass"
)
result = await client.google.RecaptchaV3(
website_url="https://example.com",
website_key="site-key",
poll_interval=2.0, # Check every 2 seconds
timeout=120.0, # Give up after 2 minutes
max_retry=3 # Retry failed tasks up to 3 times
)
result = await client.google.RecaptchaV2(
website_url="https://example.com",
website_key="enterprise-site-key",
enterprise=True
)
The library provides specific exceptions for different error conditions:
from raven.exceptions import (
RavenError, # Base exception
InvalidApiKeyError,
TaskFailedError,
MaxConcurrencyReachedError,
# ... and many more specific exceptions
)
try:
result = await client.google.RecaptchaV2(
website_url="https://example.com",
website_key="invalid-key"
)
except InvalidApiKeyError:
print("API key is invalid")
except TaskFailedError:
print("Captcha solving failed")
except RavenError as e:
print(f"Other Raven error: {e}")
InvalidApiKeyError: API key is invalid or missingTaskFailedError: Task failed during processing or timed outMaxConcurrencyReachedError: Account concurrency limit reachedWebsiteUrlRequiredError: Website URL parameter missingWebsiteKeyRequiredError: Website key parameter missingInvalidCaptchaTypeError: Unsupported captcha type requested| Parameter | Default Value | Description |
|---|---|---|
base_url | "https://ai.ravens.best" | API endpoint URL |
timeout | 30.0 | HTTP request timeout (seconds) |
poll_interval | 1.0 | Status polling interval (seconds) |
invisible | None | Auto-detect invisible captcha mode |
enterprise | None | Auto-detect enterprise mode |
action | None | No action specified (v3 uses default) |
max_retry | None | Use service default retry policy |
proxy_* | None | No proxy configuration |
The library is structured with clean separation of concerns:
raven.clients): User-facing sync/async interfacesraven.providers.google): Service-specific implementationsraven.services.captcha_service): Core business logicraven.http.client): Low-level HTTP communicationraven.models): Data structures and serializationraven.exceptions): Error handling and mappingrequests >= 2.28.0This project is licensed under the MIT License.
For issues and questions:
Contributions are welcome! Please feel free to submit a Pull Request.
FAQs
A Python client library for the Raven Captcha API with sync and async support
We found that raven-python-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: whatâs affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.