As artificial intelligence (AI) driven automation increasingly reshapes real-world workflows, Agno stands out as a high-performance, privacy-focused framework for developing autonomous multi-agent systems. These AI agents frequently interact with websites for tasks such as web scraping, data collection, and automated browsing. However, a common challenge arises: CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) verification. CAPTCHAs are designed to prevent automated access, posing a significant hurdle for seamless AI agent operations.
CapSolver offers a robust solution to this problem, enabling Agno agents to reliably bypass CAPTCHA-protected web pages without disrupting the automation flow. The synergy between Agno and CapSolver facilitates the creation of scalable, hands-off automation solutions that function effectively across diverse real-world websites. This integration is crucial for developers aiming to build advanced AI agents capable of navigating the modern web efficiently.
Understanding Agno: A Framework for Autonomous AI Agents
Agno is an innovative open-source multi-agent framework and runtime specifically engineered for building AI systems that operate entirely within your own infrastructure. Its core design principles emphasize performance and data privacy, ensuring no external control plane interference and complete data residency within your environment.
Key Features of Agno for AI Automation
- Exceptional Performance: Agno is engineered for speed and memory efficiency, often outperforming other agent frameworks, making it ideal for demanding AI automation tasks.
- Privacy-First Architecture: Offering full self-hosting capabilities, Agno provides developers with complete control over their data and execution environment, crucial for sensitive applications.
- Advanced Multi-Agent Systems: It supports complex collaborations, specialization, and coordinated task execution among multiple AI agents, enhancing problem-solving capabilities.
- Flexible Model Integration: Agno boasts broad compatibility with leading large language model (LLM) providers, including OpenAI, Anthropic, Google, and many others, offering versatility in AI model selection.
- Production-Ready Runtime: Featuring a FastAPI-based runtime, Agno simplifies the deployment of AI agents into production environments.
- Comprehensive Tooling: Equipped with built-in tools for web automation, API interactions, database management, and more, Agno streamlines development.
- Persistent Memory: Agents can maintain context across sessions through agentic RAG (Retrieval Augmented Generation) and support for over 20 vector stores, enabling more intelligent and continuous operations.
Agno's Core Architectural Components
| Component | Description |
|---|---|
| Agents | Autonomous AI units endowed with memory, specialized tools, and integrated AI models for task execution. |
| Teams | Collaborative groups of agents designed to tackle complex tasks through coordinated efforts. |
| Workflows | Structured pipelines that ensure predictable and efficient execution of agent tasks. |
| AgentOS | A FastAPI-based runtime environment optimized for the production deployment of Agno agents. |
Introducing CapSolver: Your Solution for CAPTCHA Bypass
CapSolver is a premier CAPTCHA solving service that leverages AI-powered solutions to overcome various CAPTCHA challenges. Known for its rapid response times and seamless integration, CapSolver is an indispensable tool for automated workflows, ensuring uninterrupted access to web resources.
Diverse CAPTCHA Types Supported by CapSolver
CapSolver's extensive support covers a wide array of CAPTCHA mechanisms, including:
- reCAPTCHA v2 (both Image and Invisible variants)
- reCAPTCHA v3
- Cloudflare Turnstile
- Cloudflare Challenge (5s)
- AWS WAF
- And many other emerging CAPTCHA types...
The Strategic Advantage: Integrating CapSolver with Agno
When developing Agno agents for web-centric operations—be it for comprehensive data extraction, automated testing, or content aggregation—CAPTCHA challenges invariably emerge as a significant barrier. For a deeper understanding of bypassing CAPTCHAs in automated browser environments, explore our detailed guide on how to solve CAPTCHA in Puppeteer. The integration of CapSolver with Agno offers several compelling advantages:
- Uninterrupted Agent Workflows: Ensures that AI agents can complete their assigned tasks without manual intervention, maintaining continuous operation. For more insights into CAPTCHA solutions for web scraping, refer to our article: Best Way to Solve CAPTCHA While Web Scraping.
- Enhanced Data Privacy: Both Agno and CapSolver are designed to give users control over their data, aligning with privacy-first development practices.
- Scalable Automation Capabilities: The integration allows for efficient handling of numerous CAPTCHA challenges across concurrent AI agent operations, facilitating large-scale automation.
- Cost-Effective Solutions: CapSolver's pricing model ensures you only pay for successfully solved CAPTCHAs, optimizing operational costs.
- High Success Rates: Benefit from industry-leading accuracy in solving all supported CAPTCHA types, ensuring reliable automation.
Step-by-Step Integration: Installing and Configuring Agno with CapSolver
To begin integrating CapSolver with your Agno projects, first install the necessary Python packages:
pip install agno
pip install requests
Agno's design emphasizes model-agnosticism, providing built-in support for over 23 leading large language model (LLM) providers. This flexibility allows developers to choose the best AI model for their specific needs:
# Example: OpenAI Integration
from agno.models.openai import OpenAIChat
# Example: Anthropic Claude Integration
from agno.models.anthropic import Claude
# Example: Google Gemini Integration
from agno.models.google import Gemini
# And many more LLM providers are supported...
Crafting a Custom CapSolver Tool for Agno Agents
Agno empowers developers to extend its functionality by creating custom tools that agents can utilize to accomplish diverse tasks. Here’s how to implement a specialized CapSolver tool for effectively managing and solving CAPTCHA challenges within your Agno agents:
Basic CapSolver Tool Implementation for CAPTCHA Solving
import requests
import time
from agno.tools import tool
CAPSOLVER_API_KEY = "YOUR_CAPSOLVER_API_KEY"
@tool
def solve_captcha(
website_url: str,
website_key: str,
captcha_type: str = "ReCaptchaV2TaskProxyLess"
) -> str:
"""
Solves CAPTCHA challenges using the CapSolver API. This universal tool can handle various CAPTCHA types.
Args:
website_url: The URL of the website presenting the CAPTCHA.
website_key: The site key (data-sitekey) associated with the CAPTCHA.
captcha_type: Specifies the type of CAPTCHA to solve (e.g., ReCaptchaV2TaskProxyLess, ReCaptchaV3TaskProxyLess, AntiTurnstileTaskProxyLess).
Returns:
The CAPTCHA solution token or an error message if the task fails or times out.
"""
# Create task with CapSolver API
payload = {
"clientKey": CAPSOLVER_API_KEY,
"task": {
"type": captcha_type,
"websiteURL": website_url,
"websiteKey": website_key
}
}
response = requests.post("https://api.capsolver.com/createTask", json=payload)
result = response.json()
if result.get("errorId") != 0:
return f"Error creating CAPTCHA task: {result.get(\'errorDescription\')}"
task_id = result.get("taskId")
# Poll for CAPTCHA solution result
for _ in range(60):
time.sleep(2)
result = requests.post(
"https://api.capsolver.com/getTaskResult",
json={"clientKey": CAPSOLVER_API_KEY, "taskId": task_id}
).json()
if result.get("status") == "ready":
solution = result.get("solution", {})
return solution.get("gRecaptchaResponse") or solution.get("token")
elif result.get("status") == "failed":
return f"CAPTCHA task failed: {result.get(\'errorDescription\')}"
return "Timeout: CAPTCHA solution not received within the expected timeframe."
Specialized CAPTCHA Solvers for Enhanced Control
For more granular control over specific CAPTCHA types, you can implement dedicated solver functions within your Agno tools. These specialized functions streamline the process for common CAPTCHA challenges.
reCAPTCHA v2 Solver Implementation
import requests
import time
from agno.tools import tool
CAPSOLVER_API_KEY = "YOUR_CAPSOLVER_API_KEY"
@tool
def solve_recaptcha_v2(website_url: str, website_key: str) -> str:
"""
Specifically solves reCAPTCHA v2 challenges using CapSolver, returning the response token.
Args:
website_url: The URL of the website protected by reCAPTCHA v2.
website_key: The site key (data-sitekey attribute) for reCAPTCHA v2.
Returns:
The g-recaptcha-response token required for submission, or an error message.
"""
payload = {
"clientKey": CAPSOLVER_API_KEY,
"task": {
"type": "ReCaptchaV2TaskProxyLess",
"websiteURL": website_url,
"websiteKey": website_key
}
}
response = requests.post("https://api.capsolver.com/createTask", json=payload)
result = response.json()
if result.get("errorId") != 0:
return f"Error creating reCAPTCHA v2 task: {result.get(\'errorDescription\')}"
task_id = result.get("taskId")
for attempt in range(60):
time.sleep(2)
result = requests.post(
"https://api.capsolver.com/getTaskResult",
json={"clientKey": CAPSOLVER_API_KEY, "taskId": task_id}
).json()
if result.get("status") == "ready":
return result["solution"]["gRecaptchaResponse"]
if result.get("status") == "failed":
return f"reCAPTCHA v2 task failed: {result.get(\'errorDescription\')}"
return "Timeout: reCAPTCHA v2 solution not received."
reCAPTCHA v3 Solver Implementation
import requests
import time
from agno.tools import tool
CAPSOLVER_API_KEY = "YOUR_CAPSOLVER_API_KEY"
@tool
def solve_recaptcha_v3(
website_url: str,
website_key: str,
page_action: str = "submit",
min_score: float = 0.7
) -> str:
"""
Handles reCAPTCHA v3 challenges, which involve score-based verification, using CapSolver.
Args:
website_url: The URL of the website utilizing reCAPTCHA v3.
website_key: The site key for the reCAPTCHA v3 implementation.
page_action: The action parameter defined for reCAPTCHA v3 (e.g., 'submit', 'login').
min_score: The minimum score required for a successful verification (typically between 0.1 and 0.9).
Returns:
The g-recaptcha-response token or an error message.
"""
payload = {
"clientKey": CAPSOLVER_API_KEY,
"task": {
"type": "ReCaptchaV3TaskProxyLess",
"websiteURL": website_url,
"websiteKey": website_key,
"pageAction": page_action,
"minScore": min_score
}
}
response = requests.post("https://api.capsolver.com/createTask", json=payload)
result = response.json()
if result.get("errorId") != 0:
return f"Error creating reCAPTCHA v3 task: {result.get(\'errorDescription\')}"
task_id = result.get("taskId")
for attempt in range(60):
time.sleep(2)
result = requests.post(
"https://api.capsolver.com/getTaskResult",
json={"clientKey": CAPSOLVER_API_KEY, "taskId": task_id}
).json()
if result.get("status") == "ready":
return result["solution"]["gRecaptchaResponse"]
if result.get("status") == "failed":
return f"reCAPTCHA v3 task failed: {result.get(\'errorDescription\')}"
return "Timeout: reCAPTCHA v3 solution not received."
Cloudflare Turnstile Solver Implementation
import requests
import time
from agno.tools import tool
CAPSOLVER_API_KEY = "YOUR_CAPSOLVER_API_KEY"
@tool
def solve_turnstile(website_url: str, website_key: str) -> str:
"""
Solves Cloudflare Turnstile challenges, providing the necessary token for verification.
Args:
website_url: The URL of the website protected by Cloudflare Turnstile.
website_key: The site key of the Turnstile widget on the page.
Returns:
The Turnstile token or an error message.
"""
payload = {
"clientKey": CAPSOLVER_API_KEY,
"task": {
"type": "AntiTurnstileTaskProxyLess",
"websiteURL": website_url,
"websiteKey": website_key
}
}
response = requests.post("https://api.capsolver.com/createTask", json=payload)
result = response.json()
if result.get("errorId") != 0:
return f"Error creating Turnstile task: {result.get(\'errorDescription\')}"
task_id = result.get("taskId")
for attempt in range(60):
time.sleep(2)
result = requests.post(
"https://api.capsolver.com/getTaskResult",
json={"clientKey": CAPSOLVER_API_KEY, "taskId": task_id}
).json()
if result.get("status") == "ready":
return result["solution"]["token"]
if result.get("status") == "failed":
return f"Turnstile task failed: {result.get(\'errorDescription\')}"
return "Timeout: Turnstile solution not received."
Cloudflare Challenge (5s) Solver Implementation
import requests
import time
from agno.tools import tool
CAPSOLVER_API_KEY = "YOUR_CAPSOLVER_API_KEY"
@tool
def solve_cloudflare_challenge(website_url: str, proxy: str) -> dict:
"""
Addresses Cloudflare's 5-second challenge pages, returning cookies and user-agent for access.
Args:
website_url: The URL of the Cloudflare-protected page.
proxy: Proxy string in the format: http://user:pass@ip:port.
Returns:
A dictionary containing cookies and user_agent necessary to access the protected page, or an error.
"""
payload = {
"clientKey": CAPSOLVER_API_KEY,
"task": {
"type": "AntiCloudflareTask",
"websiteURL": website_url,
"proxy": proxy
}
}
response = requests.post("https://api.capsolver.com/createTask", json=payload)
result = response.json()
if result.get("errorId") != 0:
return {"error": f"Error creating Cloudflare challenge task: {result.get(\'errorDescription\')}"}
task_id = result.get("taskId")
for attempt in range(60):
time.sleep(3)
result = requests.post(
"https://api.capsolver.com/getTaskResult",
json={"clientKey": CAPSOLVER_API_KEY, "taskId": task_id}
).json()
if result.get("status") == "ready":
return {
"cookies": result["solution"]["cookies"],
"user_agent": result["solution"]["userAgent"]
}
if result.get("status") == "failed":
return {"error": f"Cloudflare challenge task failed: {result.get(\'errorDescription\')}"}
return {"error": "Timeout: Cloudflare challenge solution not received."}
Comprehensive Agno Agent Example with CapSolver Integration
This section provides a complete, runnable example demonstrating how an Agno agent can leverage CapSolver to automatically manage and solve CAPTCHA challenges during its operations. This illustrates the practical application of the custom tools developed above.
import os
import requests
import time
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools import tool
# Configuration for API Keys
CAPSOLVER_API_KEY = "YOUR_CAPSOLVER_API_KEY"
os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY"
@tool
def solve_recaptcha_v2(website_url: str, website_key: str) -> str:
"""
Solves reCAPTCHA v2 challenges using CapSolver, returning the response token.
Args:
website_url: The URL of the website with reCAPTCHA v2.
website_key: The site key (data-sitekey attribute).
Returns:
The g-recaptcha-response token or an error message.
"""
payload = {
"clientKey": CAPSOLVER_API_KEY,
"task": {
"type": "ReCaptchaV2TaskProxyLess",
"websiteURL": website_url,
"websiteKey": website_key
}
}
response = requests.post("https://api.capsolver.com/createTask", json=payload)
result = response.json()
if result.get("errorId") != 0:
return f"Error: {result.get(\'errorDescription\')}"
task_id = result.get("taskId")
for _ in range(60):
time.sleep(2)
result = requests.post(
"https://api.capsolver.com/getTaskResult",
json={"clientKey": CAPSOLVER_API_KEY, "taskId": task_id}
).json()
if result.get("status") == "ready":
return result["solution"]["gRecaptchaResponse"]
if result.get("status") == "failed":
return f"Failed: {result.get(\'errorDescription\')}"
return "Timeout"
@tool
def solve_turnstile(website_url: str, website_key: str) -> str:
"""
Solves Cloudflare Turnstile challenges, providing the necessary token.
Args:
website_url: The URL of the website with Turnstile.
website_key: The site key of the Turnstile widget.
Returns:
The Turnstile token or an error message.
"""
payload = {
"clientKey": CAPSOLVER_API_KEY,
"task": {
"type": "AntiTurnstileTaskProxyLess",
"websiteURL": website_url,
"websiteKey": website_key
}
}
response = requests.post("https://api.capsolver.com/createTask", json=payload)
result = response.json()
if result.get("errorId") != 0:
return f"Error: {result.get(\'errorDescription\')}"
task_id = result.get("taskId")
for _ in range(60):
time.sleep(2)
result = requests.post(
"https://api.capsolver.com/getTaskResult",
json={"clientKey": CAPSOLVER_API_KEY, "taskId": task_id}
).json()
if result.get("status") == "ready":
return result["solution"]["token"]
if result.get("status") == "failed":
return f"Failed: {result.get(\'errorDescription\')}"
return "Timeout"
@tool
def check_capsolver_balance() -> str:
"""
Retrieves the current CapSolver account balance.
Returns:
A string indicating the current balance or an error message.
"""
response = requests.post(
"https://api.capsolver.com/getBalance",
json={"clientKey": CAPSOLVER_API_KEY}
)
result = response.json()
if result.get("errorId") != 0:
return f"Error: {result.get(\'errorDescription\')}"
return f"Balance: ${result.get(\'balance\', 0):.4f}"
# Initialize the Web Scraper Agent with CAPTCHA Solving Capabilities
web_scraper_agent = Agent(
name="Web Scraper Agent",
model=OpenAIChat(id="gpt-4o"),
tools=[solve_recaptcha_v2, solve_turnstile, check_capsolver_balance],
description="An expert web scraping agent designed to autonomously handle CAPTCHA challenges.",
instructions=[
"You are a specialized web scraping agent equipped with advanced CAPTCHA solving capabilities.",
"Upon encountering a CAPTCHA, you must accurately identify its type and utilize the appropriate CapSolver tool.",
"For reCAPTCHA v2, invoke `solve_recaptcha_v2` with the target URL and site key.",
"For Cloudflare Turnstile, use `solve_turnstile` with the relevant URL and site key.",
"Always perform a balance check using `check_capsolver_balance` before initiating extensive web scraping operations."
],
markdown=True
)
def main():
print("=" * 60)
print("Agno + CapSolver Integration Demo: Automated CAPTCHA Bypass")
print("=" * 60)
# Define a task for the agent: Solve a reCAPTCHA v2 challenge
task = """
Please solve a reCAPTCHA v2 challenge for me.
Website URL: https://www.google.com/recaptcha/api2/demo
Site Key: 6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-
After solving, report the first 50 characters of the token. Additionally, verify the CapSolver balance prior to starting the task.
"""
response = web_scraper_agent.run(task)
print("\nAgent Response:")
print(response.content)
if __name__ == "__main__":
main()
Leveraging Agno Teams for Collaborative CAPTCHA Solving
Agno's multi-agent architecture extends to teams, enabling specialized agents to collaborate on complex tasks, including CAPTCHA resolution. This approach enhances efficiency and robustness for large-scale automation projects.
from agno.agent import Agent
from agno.team import Team
from agno.models.openai import OpenAIChat
from agno.tools import tool
import requests
import time
CAPSOLVER_API_KEY = "YOUR_CAPSOLVER_API_KEY"
@tool
def solve_any_captcha(
website_url: str,
website_key: str,
captcha_type: str = "ReCaptchaV2TaskProxyLess"
) -> str:
"""A universal CAPTCHA solver tool capable of addressing multiple CAPTCHA types within an Agno team context."""
payload = {
"clientKey": CAPSOLVER_API_KEY,
"task": {
"type": captcha_type,
"websiteURL": website_url,
"websiteKey": website_key
}
}
response = requests.post("https://api.capsolver.com/createTask", json=payload)
result = response.json()
if result.get("errorId") != 0:
return f"Error creating universal CAPTCHA task: {result.get(\'errorDescription\')}"
task_id = result.get("taskId")
for _ in range(60):
time.sleep(2)
result = requests.post(
"https://api.capsolver.com/getTaskResult",
json={"clientKey": CAPSOLVER_API_KEY, "taskId": task_id}
).json()
if result.get("status") == "ready":
solution = result.get("solution", {})
return solution.get("gRecaptchaResponse") or solution.get("token")
if result.get("status") == "failed":
return f"Universal CAPTCHA task failed: {result.get(\'errorDescription\')}"
return "Timeout: Universal CAPTCHA solution not received."
# Define the CAPTCHA Specialist Agent for the team
captcha_agent = Agent(
name="CAPTCHA Specialist",
model=OpenAIChat(id="gpt-4o"),
tools=[solve_any_captcha],
description="An expert agent dedicated to identifying and solving various CAPTCHA types within a collaborative team.",
instructions=[
"Your primary role is to identify the CAPTCHA type through page analysis.",
"Utilize the `solve_any_captcha` tool with the correct parameters to resolve the CAPTCHA.",
"Clearly report the success or failure of the CAPTCHA resolution to the team."
]
)
# Define the Data Extraction Agent for the team
data_agent = Agent(
name="Data Extractor",
model=OpenAIChat(id="gpt-4o"),
description="Responsible for extracting and processing data from web pages, coordinating with the CAPTCHA specialist when needed.",
instructions=[
"Extract structured data efficiently from HTML content.",
"When a CAPTCHA is encountered, request its solving from the CAPTCHA Specialist.",
"Ensure extracted data is validated and cleaned for accuracy."
]
)
# Create the Web Scraping Team
scraping_team = Team(
name="Web Scraping Team",
agents=[captcha_agent, data_agent],
# Further team configuration can be added here, e.g., shared memory, communication protocols
)
Submitting CAPTCHA Tokens: Best Practices for Integration
Once a CAPTCHA is solved by CapSolver, the resulting token or solution needs to be correctly submitted to the target website. The method of submission varies depending on the CAPTCHA type and the web automation library used.
reCAPTCHA v2/v3 - Token Injection Method
For reCAPTCHA v2 and v3, the solved token is typically injected into a hidden textarea element on the page, followed by a form submission. This example uses Selenium for demonstration.
from selenium import webdriver
from selenium.webdriver.common.by import By
def submit_recaptcha_token(driver, token: str):
"""Injects the reCAPTCHA token into the appropriate element and submits the form."""
recaptcha_response = driver.find_element(By.ID, "g-recaptcha-response")
driver.execute_script("arguments[0].style.display = \'block\';", recaptcha_response)
recaptcha_response.clear()
recaptcha_response.send_keys(token)
form = driver.find_element(By.TAG_NAME, "form")
form.submit()
Cloudflare Turnstile - Token Injection Method
Similar to reCAPTCHA, Turnstile tokens are injected into a specific hidden input field before form submission.
def submit_turnstile_token(driver, token: str):
"""Injects the Cloudflare Turnstile token into its designated input field and submits the form."""
turnstile_input = driver.find_element(By.NAME, "cf-turnstile-response")
driver.execute_script("arguments[0].value = arguments[1];", turnstile_input, token)
form = driver.find_element(By.TAG_NAME, "form")
form.submit()
Cloudflare Challenge - Utilizing Cookies and User-Agent
For Cloudflare's 5-second challenge, the solution often involves using specific cookies and a user-agent string provided by CapSolver to bypass the challenge at the HTTP request level.
import requests
def access_cloudflare_protected_page(url: str, cf_solution: dict):
"""Accesses a Cloudflare-protected page using the provided cookies and user-agent from the CapSolver solution."""
session = requests.Session()
for cookie in cf_solution["cookies"]:
session.cookies.set(cookie["name"], cookie["value"])
headers = {"User-Agent": cf_solution["user_agent"]}
response = session.get(url, headers=headers)
return response.text
Advanced Best Practices for Robust CAPTCHA Integration
To ensure the highest reliability and efficiency in your Agno-CapSolver integration, consider implementing these advanced best practices:
1. Error Handling with Automated Retries
Implementing robust error handling with retry mechanisms is crucial for maintaining uninterrupted automation, especially when dealing with transient network issues or occasional CAPTCHA solving failures.
from agno.tools import tool
import time
@tool
def solve_with_retry(
website_url: str,
website_key: str,
max_retries: int = 3
) -> str:
"""Attempts to solve a reCAPTCHA v2 challenge with automatic retries and exponential backoff on failure."""
for attempt in range(max_retries):
try:
result = solve_recaptcha_v2(website_url, website_key)
if not result.startswith("Error") and not result.startswith("Failed"):
return result
except Exception as e:
if attempt == max_retries - 1:
return f"All retry attempts failed: {str(e)}"
time.sleep(2 ** attempt) # Implement exponential backoff
return "Maximum retries exceeded for CAPTCHA solution."
2. Proactive Balance Management
Regularly checking your CapSolver account balance prevents interruptions in your automation workflows due to insufficient funds. Integrate balance checks into your agent's operational logic.
@tool
def check_balance() -> float:
"""Checks and returns the current CapSolver account balance to ensure continuous service."""
response = requests.post(
"https://api.capsolver.com/getBalance",
json={"clientKey": CAPSOLVER_API_KEY}
)
return response.json().get("balance", 0)
3. Asynchronous Support for Enhanced Concurrency
Agno's support for asynchronous operations can significantly boost the performance and concurrency of your CAPTCHA solving agents, allowing them to handle multiple tasks simultaneously.
import asyncio
import aiohttp
from agno.tools import tool
@tool
async def solve_captcha_async(website_url: str, website_key: str) -> str:
"""An asynchronous CAPTCHA solver designed for improved concurrency and performance in Agno agents."""
async with aiohttp.ClientSession() as session:
payload = {
"clientKey": CAPSOLVER_API_KEY,
"task": {
"type": "ReCaptchaV2TaskProxyLess",
"websiteURL": website_url,
"websiteKey": website_key
}
}
async with session.post(
"https://api.capsolver.com/createTask",
json=payload
) as response:
result = await response.json()
if result.get("errorId") != 0:
return f"Error in async CAPTCHA task creation: {result.get(\'errorDescription\')}"
task_id = result.get("taskId")
for _ in range(60):
await asyncio.sleep(2)
async with session.post(
"https://api.capsolver.com/getTaskResult",
json={"clientKey": CAPSOLVER_API_KEY, "taskId": task_id}
) as response:
result = await response.json()
if result.get("status") == "ready":
solution = result.get("solution", {})
return solution.get("gRecaptchaResponse") or solution.get("token")
if result.get("status") == "failed":
return f"Async CAPTCHA task failed: {result.get(\'errorDescription\')}"
return "Timeout: Async CAPTCHA solution not received."
Conclusion: Empowering AI Agents with Seamless CAPTCHA Bypass
Integrating CapSolver with Agno represents a significant leap forward in unlocking the full capabilities of autonomous AI agents for complex web-based tasks. By combining Agno's cutting-edge, privacy-first multi-agent orchestration with CapSolver's industry-leading CAPTCHA solving prowess, developers are now equipped to construct exceptionally robust automation solutions. These solutions can effectively navigate and overcome even the most sophisticated web protection mechanisms.
Whether your objective is to build efficient data extraction pipelines, develop resilient automated testing frameworks, or deploy intelligent web agents, the powerful combination of Agno and CapSolver delivers the essential speed, unwavering reliability, and scalable performance demanded by modern production environments.
Ready to enhance your AI automation? Sign up for CapSolver today and utilize bonus code AGNO to receive an extra 6% bonus on your initial recharge! Start building smarter, more resilient AI agents now.
Frequently Asked Questions (FAQ) about Agno and CapSolver Integration
What is Agno and its primary benefits?
Agno is an advanced multi-agent framework, runtime, and control plane designed for building sophisticated AI products. It boasts remarkable performance, being significantly faster (e.g., 529× faster than LangGraph) and more memory-efficient (e.g., 24× lower memory usage). Crucially, Agno operates entirely within your infrastructure, ensuring maximum data privacy and control.
How does CapSolver integrate with Agno's AI agents?
CapSolver seamlessly integrates with Agno through custom tools, which are Python functions decorated with @tool. Developers create these functions to wrap the CapSolver API, allowing Agno's AI agents to automatically detect and solve various CAPTCHA challenges encountered during web operations, such as scraping or automated browsing.
What range of CAPTCHA types can CapSolver effectively solve?
CapSolver provides comprehensive support for a broad spectrum of CAPTCHA types. This includes popular challenges like reCAPTCHA v2, reCAPTCHA v3, Cloudflare Turnstile, Cloudflare Challenge, AWS WAF, GeeTest, and many other emerging and proprietary CAPTCHA systems.
What are the cost considerations for using CapSolver?
CapSolver offers a competitive and flexible pricing structure, which is determined by the specific type and overall volume of CAPTCHAs solved. For the most current and detailed pricing information, please visit capsolver.com. Remember to use the code AGNO for an exclusive 5% bonus on your first recharge.
Is Agno compatible with various Large Language Model (LLM) providers?
Absolutely. Agno is designed to be highly model-agnostic, offering extensive compatibility with over 50 leading LLM providers. This includes prominent names such as OpenAI, Anthropic Claude, Google Gemini, Groq, and numerous others, providing developers with unparalleled flexibility in choosing their preferred AI models.
Is Agno available for free use?
Yes, Agno is an open-source project released under the permissive MIT license, making the framework itself free to use. However, users should anticipate incurring costs associated with API calls to large language models (LLMs) and for utilizing specialized CAPTCHA solving services like CapSolver.
How can I locate the CAPTCHA site key on a webpage?
The CAPTCHA site key is typically embedded within the HTML source code of the webpage. For reCAPTCHA, you would generally look for the data-sitekey attribute or a grecaptcha.render() function call. For Cloudflare Turnstile, the data-sitekey attribute within the Turnstile widget's HTML element is the key identifier.


Top comments (0)