Duckduckgo_search rate limit issue

How to handle the following excception?
duckduckgo_search.exceptions.DuckDuckGoSearchException: DuckDuckGo 202
Ratelimit

tools=[DuckDuckGoTools(timeout=10)]

1 Like

Hi @Gowri453
thanks for reaching out and supporting Agno!We’ve shared this with the team and are working through requests one by one—we’ll get back to you as soon as we can.We’ve just kicked off the Global Agent Hackathon , so things are a bit busier than usual. If you’re up for it, we’d love for you to join—it’s a great chance to build, win some exciting prizes and connect with the agent community!If it’s urgent, just let us know. Thanks for your patience!

I encountered this error too. Seems like DuckDuckGo API ratelimiting, but couldn’t find any info about actual allowed values of requests per something anywhere…
This is serious issue.

WARNING  Could not run function duckduckgo_search(query=blabla, max_results=1)                                                                                                                   
ERROR    https://html.duckduckgo.com/html 202 Ratelimit                                                                                                                                                                
         Traceback (most recent call last):                                                                                                                                                                            
           File ".../lib/python3.12/site-packages/agno/tools/function.py", line 475, in execute                                                                 
             result = self.function.entrypoint(**entrypoint_args, **self.arguments)                                                                                                                                    
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                    
           File ".../lib/python3.12/site-packages/pydantic/_internal/_validate_call.py", line 39, in wrapper_function                                           
             return wrapper(*args, **kwargs)                                                                                                                                                                           
                    ^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                           
           File ".../lib/python3.12/site-packages/pydantic/_internal/_validate_call.py", line 136, in __call__                                                  
             res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))                                                                                                                 
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                 
           File ".../lib/python3.12/site-packages/agno/tools/duckduckgo.py", line 74, in duckduckgo_search                                                      
             return json.dumps(ddgs.text(keywords=search_query, max_results=actual_max_results), indent=2)                                                                                                             
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                        
           File ".../lib/python3.12/site-packages/duckduckgo_search/duckduckgo_search.py", line 211, in text                                                    
             raise DuckDuckGoSearchException(err)                                                                                                                                                                      
         duckduckgo_search.exceptions.DuckDuckGoSearchException: https://html.duckduckgo.com/html 202 Ratelimit                                                                                                        
2025-04-18 09:59:16,741 -  INFO - LLM response: I am sorry, I cannot access the internet right now.

Hi @ybonda ! The DuckDuckGo API is free to use and hence has ratelimit set up by them. Ideally it is useful for prototyping. For reliable searching I would recommend switching to another search tool.

Here’s the list of all the search tools: Toolkit Index - Agno

Thanks for your reply. Can you suggest any other available search tools? Seems like there is only google search tool…

We need to implement a custom tool for DuckDuckGo search where we can add time to maintain the requests.

Hey,
You can use Exa, FireCrawl, etc
You can find more details and options here: Toolkit Index - Agno