DuckDuckGo API: What It Returns and What to Use Instead
On this page
Developers who search for a DuckDuckGo API usually want one thing: free web search results for a script or an AI agent, with no key. DuckDuckGo does not sell that, and the free options that exist break under the load an agent puts on them. This page shows what each option returns, why it fails, and what to use instead. cloro is one of the replacements, and it does not scrape DuckDuckGo, so it is not a DuckDuckGo API either.
Does DuckDuckGo have an API?
The only official DuckDuckGo API is the Instant Answer API, and it does not return web results. A GET request to api.duckduckgo.com with format=json returns the box DuckDuckGo shows above some results: an abstract, a definition, an answer or a list of related topics. It needs no key.
We tested it with two queries on November 16, 2026:
| Query | What came back |
|---|---|
python | A Wikipedia abstract, 10 related topics, an empty Results list |
web search api | Every field empty, Results and RelatedTopics included |
So the DuckDuckGo Instant Answer API answers “what is X” for topics with a Wikipedia page or another known source. It does not answer “show me the top 10 pages for this query”, which is what an agent or a rank tracker needs.
DuckDuckGo’s own results also come partly from elsewhere. Its help page says it runs its own crawler, DuckDuckBot, and that its traditional links come “largely” from Bing (DuckDuckGo). Microsoft retired the Bing Search APIs in August 2025, so that route is closed too (Microsoft).
What do the unofficial DuckDuckGo libraries do?
They load DuckDuckGo’s search pages the way a browser does and parse the HTML. None of them is a DuckDuckGo API in the sense of a service with a contract. Three are common.
ddgs for Python
The package duckduckgo-search was renamed ddgs, and its PyPI page now says “Use pip install ddgs instead”. Version 9.16.1 describes itself as “a metasearch library that aggregates results from diverse web search services”: its text() search can use Bing, Brave, DuckDuckGo, Google, Mojeek, Startpage, Yandex, Yahoo and Wikipedia as backends (PyPI).
OpenClaw’s DuckDuckGo provider
OpenClaw calls it “an experimental, unofficial integration that scrapes DuckDuckGo’s non-JavaScript HTML search pages”, and warns: “Expect occasional breakage from bot-challenge pages or HTML changes” (OpenClaw docs). OpenClaw never picks it by itself, because auto-detection only considers providers with a key.
The free libraries cost nothing, and that is why so many agent frameworks ship one as the default. They also carry no promise: DuckDuckGo can change its pages or block the traffic at any time.
Paid DuckDuckGo APIs from scraping vendors
SerpApi sells a DuckDuckGo Search Engine Results API on its normal plans (SerpApi), and it handles the blocking for you.
Why does DuckDuckGo rate-limit an AI agent?
Because an agent searches like a bot. A person runs a few searches a minute; an agent runs ten searches for one task and repeats that for every task. DuckDuckGo answers that pattern with HTTP 202 and a page that says it “may be rate-limiting automated searches”.
The failure is quiet. In AMD’s GAIA agent, DuckDuckGo returned the 202 after several searches in one run. The agent continued without results, and the error text could be saved to the agent’s memory as if it were a fact. The fix, merged in October 2026, added backoff, a lighter endpoint and a fallback to Tavily.
raise_for_status() in Python’s httpx and requests raises on 4xx and 5xx codes only, so a 202 passes it. Check for a 200 explicitly.
Does SearXNG have an API, and why does it get blocked?
Yes. A SearXNG instance returns JSON at /search?q=...&format=json once json is in search.formats in its settings.yml. It is free software, and many agent tools support it.
SearXNG is a metasearch engine: it sends each query to Google, Bing, Brave, DuckDuckGo and others and merges the results. Its own docs explain what happens next: SearXNG “passes through requests from bots and is thus classified as a bot itself”, and the engine “then receives a CAPTCHA or is blocked by the search engine” (SearXNG limiter docs). SearXNG then takes that engine out of rotation. The default suspended_times (search settings) are:
| Error from the engine | Suspension |
|---|---|
| HTTP 429, too many requests | 1 hour |
| CAPTCHA | 24 hours |
| Access denied, HTTP 402 or 403 | 24 hours |
| Google reCAPTCHA | 7 days |
| Cloudflare CAPTCHA | 15 days |
An agent that runs many searches per task can empty an instance’s engine list quickly. A SearXNG discussion from January 2026 lists Google as “completely down”, with Brave and DuckDuckGo limiting requests, and on Hacker News in October 2026 one user wrote that “searxng gets rate limited fast”.
SearXNG is still a good choice for a private assistant: your queries stay on your server, a few dozen searches a day from a home IP often stay under the limits, and it can query sources such as Wikipedia in the same call. It is the wrong choice when the agent runs unattended, searches many times per task, or serves other users.
What can I use instead of SearXNG or DuckDuckGo when they rate-limit my AI agent?
A search API with its own key and quota. The vendor sells you the right to send automated searches, so an agent’s volume is what you pay for.
Prices and speed of the replacements
Prices are for one real-time search with 10 results, read from each vendor’s pricing page on November 16, 2026:
| API | Free allowance | Paid, per 1,000 searches | Results from | Median search time |
|---|---|---|---|---|
| Brave Search API | $5 of credit a month | $5.00 | Brave’s own index | 1.21 s |
| Tavily | 1,000 credits a month | $8.00 pay as you go | Not stated | 2.00 s |
| Exa | $10 of credit a month | $7.00 (auto), $4.00 (lite) | Exa’s own index | 0.74 s |
| Parallel | Not stated | $1.00 (fast), $5.00 (advanced) | Parallel’s own index | 2.99 s (default mode) |
| Serper | 2,500 queries | $1.00 on the $50 pack | Not measured | |
| SerpApi | 250 searches a month | $25.00 on Starter | Google, DuckDuckGo and other engines | 8.20 s |
| cloro | 500 credits on the Free plan | $1.20 async, $2.00 sync, on Hobby | 7.96 s |
The search times come from our benchmark of six web search APIs: the search request alone, without the model, from one machine. The cloro row: Hobby is $100 a month for 250,000 credits, a Google search costs 3 credits, and a synchronous request adds 2. cloro returns Google’s results page as JSON, not the text of each result page, and at about 8 seconds a search it is not the right primary source for an agent that must answer in a few seconds.
Which replacement to pick
For most agents that outgrow a free DuckDuckGo API wrapper, Brave is the closest swap: its own index, a flat price and a free monthly credit. Tavily and Exa fit when the agent wants page content with each result. A Google SERP API fits when the agent must see what Google shows, and the web search API comparison has the accuracy results behind these choices.
How do you build a fallback chain?
Keep the free source if you like, and put a paid API behind it:
- Put the cheapest source first: your SearXNG instance, DuckDuckGo through
ddgs, or a free API allowance. - Treat HTTP 202, HTTP 429, any other non-200 status and an empty result list as a failure.
- Retry once after a short delay, then move to the next provider. Do not loop on a blocked source.
- Return the provider’s name with the results, so the agent and the user know which source answered.
- Never save an error message to the agent’s memory as a fact.
import os, time, httpx
def searxng(q):
r = httpx.get(f"{os.environ['SEARXNG_URL']}/search",
params={"q": q, "format": "json"}, timeout=10)
if r.status_code != 200:
raise httpx.HTTPStatusError("unexpected status", request=r.request, response=r)
return [{"title": x["title"], "url": x["url"], "snippet": x.get("content", "")}
for x in r.json()["results"]]
def brave(q):
r = httpx.get("https://api.search.brave.com/res/v1/web/search",
params={"q": q},
headers={"X-Subscription-Token": os.environ["BRAVE_API_KEY"]},
timeout=10)
if r.status_code != 200:
raise httpx.HTTPStatusError("unexpected status", request=r.request, response=r)
return [{"title": x["title"], "url": x["url"], "snippet": x.get("description", "")}
for x in r.json().get("web", {}).get("results", [])]
CHAIN = [("searxng", searxng), ("brave", brave)]
def search(q):
errors = []
for name, fn in CHAIN:
for attempt in range(2):
try:
results = fn(q)
if results:
return {"provider": name, "results": results}
errors.append(f"{name}: empty")
break
except (httpx.HTTPError, ValueError, KeyError) as e:
errors.append(f"{name}: {e}")
if attempt == 0:
time.sleep(2)
return {"provider": None, "results": [], "error": "; ".join(errors)}
The explicit status check catches DuckDuckGo’s 202 and any other soft block, and the except clause also catches a response that is not the JSON the code expects. The error field lets the agent tell the user that search failed, which is better than an answer built on nothing. To add another provider, write one more function that returns the same three fields and append it to CHAIN.
Which option fits which agent?
| Agent | Use |
|---|---|
| Personal assistant, private, low volume | SearXNG or ddgs, then Brave on its free credit |
| Research agent, many searches per task | Brave or Exa, then Tavily |
| Agent that must see Google’s results | A Google SERP API, then Brave |
| Agent with a strict latency budget | Exa or Parallel in its fast mode, then Brave |
| Agent that needs DuckDuckGo’s own results | SerpApi’s DuckDuckGo API |
At the $1 to $8 per 1,000 searches that most APIs above list, an agent that runs 3,000 searches a month costs $3 to $24 in search.
How this was checked
This article is published by cloro, which is one of the APIs in the price table and does not scrape DuckDuckGo. Every claim links to its source, and the code was written for this article and was not run against live keys.

About the author
Ricardo Batista
Founder, cloro
Ricardo is one of the founders and engineers behind its SERP and AI-search scraping infrastructure. Before cloro he scaled a financial comparison site to $7M ARR and ran the full-country operations of a unicorn to $65M ARR, then went back to building. He writes about search engine scraping, generative-engine optimization, and turning live search and AI-answer data into something teams can act on.
Frequently asked questions
Does DuckDuckGo have an API?
Only for Instant Answers. The free endpoint at api.duckduckgo.com returns a topic summary, such as a Wikipedia abstract and related topics, and no list of web results. In our test on November 16, 2026, the query "python" returned a Wikipedia abstract, 10 related topics and an empty Results list, and "web search api" returned nothing at all. DuckDuckGo sells no web results API.
Is the DuckDuckGo API free?
The Instant Answer API is free and needs no key, but it does not return web search results. The unofficial libraries that read DuckDuckGo's HTML pages, such as the Python package ddgs, are also free, and DuckDuckGo rate-limits them when they send many searches.
Is there a free API key for DuckDuckGo?
No. DuckDuckGo issues no API keys. For a free allowance with a key, Brave gives $5 of credit a month, Tavily 1,000 credits a month, Exa $10 of credit a month and cloro 500 credits on its Free plan.
What can I use instead of SearXNG or DuckDuckGo when they rate-limit my AI agent?
A search API with its own key and quota. Brave is the closest swap for most agents: its own index, $5 per 1,000 searches and $5 of free credit a month. Tavily and Exa fit when the agent wants page content with each result, and a Google SERP API such as cloro or Serper fits when the agent must see Google's results. Keep SearXNG or DuckDuckGo as the first, free step of a fallback chain if you like.
Is the SearXNG API free?
Yes. SearXNG is free software, and an instance you host returns JSON at /search?format=json once json is enabled in its settings. Your cost is the server. The engines it queries still block it when it sends too many searches.
Related reading

Best Web Search API for AI Agents: 6 APIs Tested
We ran 6 web search APIs on 2,182 questions for accuracy, latency and cost, then ran 500 queries through Brave, Tavily, Exa and the Perplexity Search API to see how close each one gets to Google's live results.

How to Add Web Search to an AI Agent or RAG Pipeline
Two ways to give a language model live web search: search first and put the results in the prompt, or give the model a search tool. Python code for both, a TypeScript agent, and what we measured on accuracy, latency and cost.

cloro OpenClaw Integration: Monitor AI Search
The cloro OpenClaw plugin adds five AI search monitoring tools to your agent. Check how ChatGPT, Gemini, and Google AI Mode answer any prompt. Also connects over MCP.