---
title: "DuckDuckGo API: A Developer's Guide for 2026"
description: "Learn about DuckDuckGO API, how to use the official version, leverage the ddg Python package with proxies, and navigate potential restrictions and legal hurdles."
url: "https://iproyal.com/blog/duckduckgo-api/"
---

- [EN - English](https://iproyal.com/)
   
  [中文 - Chinese](https://china-iproyal.com/)

[Book a Demo](https://iproyal.com/request-a-demo/) [Create Account](https://dashboard.iproyal.com/register/) [Create Account](https://dashboard.iproyal.com/register/) [Login](https://dashboard.iproyal.com/login/) [Login](https://dashboard.iproyal.com/login/)

[Book a Demo](https://iproyal.com/request-a-demo/)

[Back to blog](https://iproyal.com/blog/)

# DuckDuckGo API: A Developer's Guide for 2026

[Nerijus Kriaučiūnas](https://iproyal.com/blog/authors/nerijus-kriauciunas/)

[Last updated - June 22, 2026 ‐ 8 min read](https://iproyal.com/blog/authors/nerijus-kriauciunas/)

[Tutorials](https://iproyal.com/blog/category/tutorials/)

## Key Takeaways

- DuckDuckGo's search results are better suited to less personalized search result use cases and may be easier to collect than those from engines like Google or Bing.

- Three main ways to access DuckDuckGo's search results programmatically are using the official API, scraping data using HTML endpoints, or using the *ddgs* Python package.

- Quality rotating proxy servers and randomized delays between requests are necessary in most cases when collecting data from DuckDuckGo.

As the most popular privacy-focused search engine, DuckDuckGo is sought after by developers wanting to access its search results programmatically. Unfortunately, the documentation for the official Instant Answer API is sparse, and you may be left to rely on guesswork or unofficial approaches.

Accessing full DuckDuckGo search results programmatically might require accessing the HTML endpoints directly or using the *ddgs* Python Package. Neither of them is officially allowed, so consider the possible restrictions, including legal consequences, depending on your use of Duck Duck Go API data.

## Introduction to the DuckDuckGo API Landscape

Developers look into DuckDuckGo’s libraries and API because it solves common problems with other search APIs. DuckDuckGo allows you to build search into your application or data pipeline without the privacy and data-leakage baggage of traditional search engines like Google.

The results are less biased and personalized, which is important for many use cases. Since there’s less data gathered about the user, it’s also considered better for compliance with data protection regulations like GDPR and CCPA.

Additionally, [Google’s API ](https://iproyal.com/blog/best-google-serp-api/), at least the official one, is free only up to 100 queries per day, while the methods to access DuckDuckGo results are free. [Scraping Google results ](https://iproyal.com/blog/scrape-google-search-results/)is also more difficult, as their bot detection is notoriously aggressive when it comes to limiting access to their Search Engine Results Page (SERP).

There are three primary ways developers use DuckDuckGo’s search results programmatically.

- **Instant Answers API&#x20;**&#x69;s DuckDuckGo’s only official API. It returns structured, factual snippets, such as definitions, Wikipedia abstracts, and similar, for well-known queries. It’s not SERP data, but the access is free, and no API key is required.
- **HTML endpoints,&#x20;**&#x73;uch as `http://html.duckduckgo.com` and `lite.duckduckgo.com`, are an unofficial way to access the DuckDuckGo SERP. You can send HTTP requests directly and parse the returned HTML yourself. Requires maintaining your own parser and handling various restrictions.
- **The *ddgs* Python package&#x20;**&#x69;s an unofficial, open-source library that handles HTML endpoint scraping for you. It’s convenient since you don’t need manual parsing, but you become dependent on the developers’ fixes when DuckDuckGo changes its structure.

## Official DuckDuckGo Instant Answer API

[Instant Answer API ](https://github.com/duckduckgo/duckduckgo-publisher/blob/master/share/site/duckduckgo/api.tx), the only officially supported API for DuckDuckGo, is a free public service allowing developers to integrate concise, specialized answers directly into their applications. It helps to easily source topic summaries, definitions, quick facts, Wikipedia summaries, unit conversions, and similar zero-click results.

Its endpoint is `https://api.duckduckgo.com/` but there’s a lack of official sources with a well-documented query format. Through trial and error, community users have developed working implementations in various formats. The one below is a good start for testing, but it will likely require modifications depending on your use case.

```javascript
https://api.duckduckgo.com/?q={query}&format=json&t=nameofapp
```

It returns fields like *Abstract, AbstractText, AbstractURL, RelatedTopics, Answer,* and *Type* in machine-readable JSON. The best part is that no authentication or API key is required.

The main limitation is that Instant Answers is not a full search API. It will only cover well-known entities or facts, and most deep queries (non-topic names) will return blank. Actual SERP data requires a different approach entirely.

## HTML Endpoint for DuckDuckGo Search Results

For full SERP-style results, developers must turn to DuckDuckGo HTML endpoints - html.duckduckgo.com/html/ and lite.duckduckgo.com/lite/. They both accept HTTP POST requests. While the HTML endpoint returns fuller results, the lite version is easier to parse. For region and language-specific results, append the specific locale.

```javascript
https://html.duckduckgo.com/html/&kl=de-de
lite.duckduckgo.com/lite/&kl=fr-fr
```

You'll also need to use *BeautifulSoup* to parse the collected data, as the returned items are raw HTML. If data from more than one page is collected, you'll need to insert \*vdq \*tokens with each request. It's a version query data token that DuckDuckGo generates on the server-side and embeds in the HTML of the first response.

It's tied to your specific query and session context, and must be inserted into each subsequent request. Without the *vdq* token, DuckDuckGo will either return the first page again or block your requests entirely. Automating requires some advanced Python programming, so many developers prefer to use the *ddgs* library instead.

## Using the ddgs Python Package (Formerly duckduckgo_search)

Compared to coding your own DuckDuckGo scraper, the [ddgs Python Package ](https://pypi.org/project/ddgs/)is much more straightforward to use. It can be installed with a pip command in your terminal.

```javascript
pip install -U ddgs
```

A basic text search query in a Python script follows a simple format.

```python
from ddgs import DDGS
results = DDGS().text("your query", max_results=10)
print(results)
```

Search queries can be supplemented with *region, timelimit, max_results,* and other parameters. Special queries, such as image, video, news, and books searches, have various unique parameters. The *ddgs* Python library is a powerful wrapper that can help you deal with common issues scraping DuckDuckGo, but it's not an official API and is vulnerable to site changes.

## CLI Usage and Automation Workflows

The *ddgs* package can be used in command-line tools, but it's not a search tool in a traditional sense. Normally, search results APIs send requests directly to the search engine, in this case, DuckDuckGo. The newest version of the *ddgs* package can start a small web server on your own machine, which acts as an intermediary.

This is required due to the Model Context Protocol (MCP) used by AI tools, which simplifies how they connect to external data sources. It also centralizes proxy and rate limit settings. Besides the optional deployment of the server, the CLI commands are quite straightforward:

- *api* - start/stop the DDGS API server.
- *books* - CLI function to perform a DDGS books metasearch.
- *extract* - CLI function to extract content from a URL.
- *images* - CLI function to perform a DDGS images metasearch.
- *mcp* - Start DDGS MCP server over stdio for local MCP clients.
- *news* - CLI function to perform a DDGS news metasearch.
- *text* - CLI function to perform a DDGS text metasearch.
- *version* - Print and return version.
- *videos* - CLI function to perform a DDGS videos metasearch.

## Proxies, Rate Limiting, and Error Handling

Unless you're collecting data on a one-time basis, proxies are necessary. Any meaningful scale of data collection with the *DDG* library or a custom DuckDuckGo scraper requires them. Rotating [residential proxies ](https://iproyal.com/residential-proxies/)are typically best for such tasks, as other proxies tend to get flagged faster.

In *ddgs,* you can set up proxies via the proxy parameter, while for custom scrapers, rotating the IP address for each request is recommended. Yet, proxies alone will not ensure the success of your scraping efforts.

While there's no official threshold published, it's best to start with fewer than 30 requests per minute per IP address. Such a best practice is a good start, but you'll still need to add randomized delays between requests and test different fingerprints when using a custom scraper.

These strategies will help you to minimize failures, but some errors are unavoidable. Be prepared to handle the most common errors and their fallbacks when scraping DuckDuckGo.

- **RatelimitException&#x20;**&#x68;appens when the site wants to signal to you that you're sending too many requests. Back off and add a randomized delay, rotate the proxy server before retrying.
- **DuckDuckGoSearchException&#x20;**&#x69;s the *ddg* libraries' general catch-all for anything unexpected. Error message typically specifies the issue, but it's often related to network or parsing failures due to a changed HTML structure.
- **202 responses&#x20;**&#x61;re a soft rate limit signaling that DuckDuckGo received your request but won't respond. Treat it the same as *RatelimitException.*
- **A 403 response&#x20;**&#x69;ndicates that the server won't respond due to insufficient permissions. In this case, it often means your IP address is flagged. Rotate your proxy and adjust the delay to fix it.
- **vqd token extraction failures&#x20;**&#x63;an be noticed from failed pagination while using custom scrapers. Re-fetch the first page, extract the new *vqd* token, and try again.

## Legal, Ethical, and Branding Considerations

If you're using the official API, the only requirements from DuckDuckGo are to identify your app in the *\&t=nameofapp,* attribute results with their logo, and get email approval before any commercial use. Unlike Microsoft or Google, DuckDuckGo is known to at least answer emails asking for approval.

It's important to know that DuckDuckGo actively fights against automated requests using its HTML endpoints. Expect rate limits and restrictions in the form of 202, 403, and similar errors. Even if collecting publicly available data is legal, scraping endpoints violates the terms of DuckDuckGo and potentially worsens the service for other users.

The same reservations apply to using the *ddgs* Python library. So, before implementing any integration with these tools, test it at low volumes, follow known rules, and have a fallback solution ready in case the solution no longer works.

## Conclusion

None of the methods to scrape DuckDuckGo search results is perfect. Yet, DuckDuckGo has some unique benefits, and accessing data might be easier compared to similar alternatives. Scraping DuckDuckGo is definitely worth a try and works with [specialized proxy servers ](https://iproyal.com/use-cases/seo-proxies/)for the task.

## FAQ

Is it safe and allowed to scrape DuckDuckGo's HTML search results?

DuckDuckGo's terms of service prohibit automated, non-personal use of the site, and it actively blocks web scrapers. However, collecting publicly available data is legal in most countries, so the practice remains in a legally grey area. Consider your use case and seek legal counsel if in doubt.

What is the difference between ddgs and duckduckgo_search?

The unofficial *ddgs* Python library has been renamed to *duckduckgo_search.* They're essentially the same tool, with the new *ddgs* version also working as a meta-search library aggregating results from multiple providers, including Google and Bing.

Do I need a proxy to use the DuckDuckGo API reliably?

Using a proxy server for the search API is necessary if you send requests consistently or at a larger scale. Rate limits are a common complaint among *ddgs* users, and proxies help to avoid them. The *ddgs* package has a built-in proxy support, and the documentation recommends using rotating proxies.

How many requests per minute can I safely send?

DuckDuckGo hasn't officially published any rate limit thresholds. Community reports indicate that it triggers bot detection mechanisms well before 30 requests per minute from one IP address. However, the exact rate limits depend on the proxies, user agent strings, delays, and other settings you use to collect data.

What happens if DuckDuckGo changes its HTML structure?

Your custom or *ddgs* library-based scraper breaks. It's one of the reasons why using a custom scraper for accessing HTML endpoints yourself might be better. With third-party libraries like *ddgs,* you're dependent on the developers pushing a quick fix. A custom scraper allows you to potentially find a solution faster.

[Create Account](https://dashboard.iproyal.com/)

[Author](https://iproyal.com/blog/authors/nerijus-kriauciunas/)

[Nerijus Kriaučiūnas](https://iproyal.com/blog/authors/nerijus-kriauciunas/)

[Senior DevOps](https://iproyal.com/blog/authors/nerijus-kriauciunas/)

With a strong background in system administration, Nerijus has honed his expertise in web hosting and infrastructure management through roles at various companies. As the Head of DevOps at IPRoyal, he oversees product administration while playing a key role in managing residential and ISP proxies. His vast technical expertise ensures streamlined operations across all IPRoyal’s services. When he’s not focused on work, Nerijus enjoys cycling, playing basketball, and hitting the slopes for a ski session.

[Learn More About Nerijus Kriaučiūnas ](https://iproyal.com/blog/authors/nerijus-kriauciunas/)[Meet all Writers](https://iproyal.com/blog/authors/)

Share on

### In This Article

- [Introduction to the DuckDuckGo API Landscape](https://iproyal.com/blog/duckduckgo-api/#Introduction-to-the-DuckDuckGo-API-Landscape)
- [Official DuckDuckGo Instant Answer API](https://iproyal.com/blog/duckduckgo-api/#Official-DuckDuckGo-Instant-Answer-API)
- [HTML Endpoint for DuckDuckGo Search Results](https://iproyal.com/blog/duckduckgo-api/#HTML-Endpoint-for-DuckDuckGo-Search-Results)
- [Using the ddgs Python Package (Formerly duckduckgo_search)](https://iproyal.com/blog/duckduckgo-api/#Using-the-ddgs-Python-Package-\(Formerly-duckduckgo_search\))
- [CLI Usage and Automation Workflows](https://iproyal.com/blog/duckduckgo-api/#CLI-Usage-and-Automation-Workflows)
- [Proxies, Rate Limiting, and Error Handling](https://iproyal.com/blog/duckduckgo-api/#Proxies,-Rate-Limiting,-and-Error-Handling)
- [Legal, Ethical, and Branding Considerations](https://iproyal.com/blog/duckduckgo-api/#Legal,-Ethical,-and-Branding-Considerations)
- [Conclusion](https://iproyal.com/blog/duckduckgo-api/#Conclusion)
- [FAQ](https://iproyal.com/blog/duckduckgo-api/#FAQ)

Ready to get started?

[Register now](https://dashboard.iproyal.com/register/)

Data News in Your Inbox

No spam whatsoever, just pure data gathering news, trending topics and useful links. Unsubscribe anytime.

No spam. Unsubscribe anytime.

## Related articles

[View all](https://iproyal.com/blog/category/tutorials/)

[Tutorials](https://iproyal.com/blog/the-most-common-payment-processing-obstacles-and-solutions-for-saas-companies/)

## [The Most Common Payment Processing Obstacles and Solutions for SaaS Companies](https://iproyal.com/blog/the-most-common-payment-processing-obstacles-and-solutions-for-saas-companies/)

[Here are the most common payment processing obstacles SaaS companies face and the solution that helped us focus on growth and our services!](https://iproyal.com/blog/the-most-common-payment-processing-obstacles-and-solutions-for-saas-companies/)

[August 8, 2022](https://iproyal.com/blog/the-most-common-payment-processing-obstacles-and-solutions-for-saas-companies/)

[3 min read](https://iproyal.com/blog/the-most-common-payment-processing-obstacles-and-solutions-for-saas-companies/)

[Tutorials](https://iproyal.com/blog/easy-programmatic-seo-with-wordpress/)

## [Easy Programmatic SEO with WordPress](https://iproyal.com/blog/easy-programmatic-seo-with-wordpress/)

[Our fourth and final entry in the pSEO series explains how to combine programmatic SEO with WordPress using plugins or code snippets.](https://iproyal.com/blog/easy-programmatic-seo-with-wordpress/)

[March 30, 2023](https://iproyal.com/blog/easy-programmatic-seo-with-wordpress/)

[10 min read](https://iproyal.com/blog/easy-programmatic-seo-with-wordpress/)

[Tutorials](https://iproyal.com/blog/api-for-dummies-the-coders-and-no-coders-guide/)

## [API for Dummies — The Coder’s and No-coder’s Guide](https://iproyal.com/blog/api-for-dummies-the-coders-and-no-coders-guide/)

[Learn API basics with this guide for coders and non-coders. Discover the different components of an API call.](https://iproyal.com/blog/api-for-dummies-the-coders-and-no-coders-guide/)

[June 1, 2023](https://iproyal.com/blog/api-for-dummies-the-coders-and-no-coders-guide/)

[11 min read](https://iproyal.com/blog/api-for-dummies-the-coders-and-no-coders-guide/)
