skip to content
superbot.gg

duckduckgo_search library error

duckduckgo_search.exceptions.RatelimitException: https://lite.duckduckgo.com/lite/ 202 Ratelimit

DuckDuckGo answered a scripted search with a bot check (a 202) instead of results, and the legacy duckduckgo_search library raised it as a rate limit. Older releases print the same line as https://duckduckgo.com/ 202 Ratelimit. To fix it, run pip install -U ddgs, catch DDGSException, wait before you retry and send fewer searches.

DuckDuckGo stopped answering the script.
The library calls that a rate limit.

What it means

DuckDuckGo answers some scripted searches with a 202 and a bot-check page instead of results. The library read that status as a rate limit and raised this exception (line 155 of duckduckgo_search.py in version 7.5.4).

Version 7.5.4 raises it for a 202, 301, 403, 400, 429 or 418. The url in the message is the endpoint it called.

The library is now ddgs. It raises DDGSException instead, so current versions do not print this exact line.

Fix it

  1. Move to ddgs: pip install -U ddgs. The repository moved to deedy5/ddgs.
  2. Catch DDGSException in new code. ddgs defines RatelimitException but never raises it (ddgs issue 478), so a rate limit arrives as a plain DDGSException.
  3. Wait before you retry, and send fewer searches per minute.
  4. If you need volume, use a search API with a key instead of scraping results pages.

Other forms of the message

https://duckduckgo.com/ 202 Ratelimit

duckduckgo_search 6.2.13 posts to https://duckduckgo.com for a token before a default text search and before every image, video and news search, so the wall names that url. It is the same check, and the same fix clears it: move to ddgs, wait, and send fewer searches.

https://html.duckduckgo.com/html 202 Ratelimit

Version 7 searches the html and lite pages in random order, so the message names whichever one hit the wall. Both clear the same way.

ddgs rate limit

ddgs defines RatelimitException but never raises it (ddgs issue 478). A block from DuckDuckGo arrives as a plain DDGSException, so catch that, wait, and retry with fewer searches.

DuckDuckGo rate limit

The wall is on scripted searches of DuckDuckGo's results pages. Waiting and searching less often clears it. For steady volume, use a search API with a key instead of scraping results pages.

With superbot

superbot's web search runs several keyless engines in turn, so one engine's wall does not end the search. The answer names the engine that replied.

It needs no search key.

ask

Search the web for the ddgs python metasearch library and tell me which search engine answered.

reply
DuckDuckGo HTML, DuckDuckGo Lite and Brave HTML answered the search.

…

deedy5/ddgs on GitHub: "A metasearch library that aggregates results from diverse web search services", installable as pip install -U ddgs.
A real answer on 2026-10-18, trimmed. The first line names the engines that replied.

This needs an account.
An agent with none signs you in through /auth.md.
You read back one emailed code.

Source: duckduckgo_search 7.5.4, duckduckgo_search.py, duckduckgo_search 6.2.13, duckduckgo_search.py and ddgs issue 478. Read on 2026-11-26.