--- title: "DuckDuckGo search API in 2026: what exists and the alternatives" category: "guides" url: https://keirolabs.cloud/blog/duckduckgo-search-api --- ## The 60-second version **DuckDuckGo has no official web search API.** What it offers is the Instant Answer API at `api.duckduckgo.com`, which returns a short summary for well-known entities (a Wikipedia abstract, an official website, related topics), not a list of web results. For a query like "best web search api" it returns nothing useful. - **What exists:** the free Instant Answer API: no key, JSON output, answers for entities and definitions only. - **What does not exist:** an endpoint that returns DuckDuckGo's ten blue links. - **What people use instead:** third-party SERP APIs that scrape DuckDuckGo, or a privacy-respecting search API with its own index. We tested the endpoint ourselves on October 19, 2026. The results are below. ## Does DuckDuckGo have a search API? **Not for web results.** DuckDuckGo's results page is built from its own crawler and partner indexes, and none of that is exposed as a public, paid or free API. The only official programmatic access is the Instant Answer API, which predates the current search product and covers what DuckDuckGo calls zero-click information: the box that answers a question without a click. That distinction matters because most search results for "duckduckgo api" are libraries that wrap the results page itself. Those are scrapers, not an API, and they break whenever the page changes. ## What does the Instant Answer API return? **A structured summary of one topic, when DuckDuckGo has one.** The request is a single GET with no key: ```bash curl "https://api.duckduckgo.com/?q=python+programming+language&format=json&no_html=1" ``` For that query the response (October 19, 2026) contained: | Field | Value | |---|---| | `Heading` | Python (programming language) | | `AbstractText` | A one-paragraph Wikipedia summary | | `AbstractSource` / `AbstractURL` | Wikipedia, with the article link | | `OfficialWebsite` | https://www.python.org/ | | `Infobox` | Structured facts | | `RelatedTopics` | 21 related entries | | `Results` | 1 entry: the official site | | `Type` | `A` (article) | Now the same call for a query a developer would actually send: ```bash curl "https://api.duckduckgo.com/?q=best+web+search+api&format=json" ``` Every content field came back empty; only the `meta` block was populated. **No abstract, no related topics, no results.** That is the API working as designed: it answers "what is X" for entities it knows, and nothing else. ## Can you scrape DuckDuckGo results instead? **Technically yes, but you inherit every scraper problem.** The HTML results page (`html.duckduckgo.com`) and its JavaScript endpoints are not a supported interface. Libraries that parse them stop working when the markup changes, DuckDuckGo rate-limits automated traffic, and its terms do not grant a license to resell or store results. If you need DuckDuckGo's results specifically, a SERP API vendor that supports the engine takes on the parsing and the blocking. SerpApi lists DuckDuckGo among its engines, priced like any other search on its plans; see [SerpApi pricing](/blog/serpapi-pricing). You are still paying for scraped results, with the same legal exposure that put SERP scraping in the news this year ([the search API crackdown](/blog/search-api-crackdown-2026-serpapi-lawsuit-bing-shutdown)). ## DuckDuckGo search API alternatives **Most people searching for a DuckDuckGo API want one of two things: private search without tracking, or a free search API. Both exist, just not from DuckDuckGo.** | Option | What you get | Price | Notes | |---|---|---|---| | DuckDuckGo Instant Answer API | Entity summaries only | Free, no key | No web results | | SerpApi (DuckDuckGo engine) | Scraped DuckDuckGo results | $25 down to $1.96 per 1,000 | 250 free searches a month | | Brave Search API | Brave's own web index | $5 per 1,000 | $5 credit a month ([pricing](https://brave.com/search/api/)) | | Keirolabs | Web results, plus clean page content on `/search/content` | From $0.25 per 1,000 | 1,250 credits a month, no card | | Google Custom Search JSON API | Google results for a set of sites | $5 per 1,000 | Closed to new customers, ends Jan 1, 2027 ([details](/blog/google-custom-search-api)) | | Bing Web Search API | — | — | Retired August 11, 2025 ([alternatives](/blog/bing-search-api-alternatives)) | **For privacy, read the vendor's data policy, not its marketing.** The reason most people reach for DuckDuckGo is that it does not profile searchers. When you pick an API, check two things: whether it logs your queries, and where it gets its results. Brave runs its own index and offers a zero-data-retention option on its enterprise plan. **For a free search API, pick one whose free tier refills.** Keirolabs gives 1,250 credits every month with no card, which is 12,500 `/search/lite` searches. Brave gives a $5 credit each month. The full list is in [free web search APIs](/blog/best-free-web-search-apis-2026). ## A drop-in replacement in Python **If your code called a DuckDuckGo wrapper for web results, the swap is a dozen lines.** Same shape: a query in, a list of title, URL and snippet out. Keirolabs' `/search/lite` costs 0.1 credit a call, so the free tier covers 12,500 searches a month. ```python import os, requests def web_search(query: str, n: int = 10) -> list[dict]: r = requests.post( "https://api.keirolabs.cloud/api/v2/search/lite", headers={"Authorization": f"Bearer {os.environ['KEIRO_API_KEY']}"}, json={"query": query}, timeout=30, ) r.raise_for_status() return r.json()["results"][:n] for hit in web_search("duckduckgo search api alternatives"): print(hit["title"], hit["url"]) ``` Keep the Instant Answer API for what it does well. It is free and fast for "what is X" lookups like a definition, an official site or a Wikipedia summary. Send everything else to a real search API.