> ## Content Index
> Fetch the complete content index at: https://serpapi.com/blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Scrape DuckDuckGo Search Results
- URL: https://serpapi.com/blog/how-to-scrape-duckduckgo-results/
- Published: 2023-12-27T04:36:49.000Z
- Updated: 2026-03-24T07:57:48.000Z
- Description: Learn how to scrape DuckDuckGo search results with a simple API. Collect organic results, AI answers, and more.
- Author: Andy L
- Tags: DuckDuckGo

DuckDuckGo returns different results than Google and Bing. It's now one of the top search engine people use in the internet.

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/03/CleanShot-2026-03-24-at-15.52.24.png)

DuckDuckGo search result

When you need results with prioritized user privacy, scraping DuckDuckGo results can be useful. Besides that, you can scrape DuckDuckGo results to do competitor analysis, improve your SEO, and aggregate content.

In my previous blog post, we explored how we can easily scrape [Google](https://serpapi.com/blog/how-to-scrape-google-search-results-serps-2023-guide/) and [Bing](https://serpapi.com/blog/how-to-scrape-bing-search-results/) results with APIs from [SerpApi](https://serpapi.com/). It would be easy with DuckDuckGo too.

![](https://lh7-us.googleusercontent.com/5w7u0whBbeAgsw3AqvAhiJljzz2t-YBoc5HjPdwh37ghPQSZUzOlFGdC1bAVEiPdyZB9VjBP1xs1f7dfk6_sbMt2nSQXZcwrewkQnKAVATUXbPB-Hno2uO-Q_Wydhsw7KG8-7RgBseuqb0HBHKTRvOw)

SerpApi playground - DuckDuckGo

Here is a video tutorial on how to scrape DuckDuckGo results in Python:

## Preparation

You can play around with [our playground feature](https://serpapi.com/playground?engine=duckduckgo) first to see all the response we return on our API.

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2023/12/Screenshot-2023-12-15-at-17.25.59.png)
  
  
**Get your API Key**  
Once you are familiar with all the results, you can register a free acount at serpapi.com to get your API key. You can use this API Key to access all of our APIs, including the DuckDuckGo search API.

**cURL Implementation**

Here is the basic implementation in cURL:

```bash
curl --get https://serpapi.com/search \
 -d engine="duckduckgo" \
 -d q="Apple" \
 -d kl="us-en" \
 -d api_key="YOUR_API_KEY"
```

## **Scrape your first DuckDuckGo Search Result with SerpApi**

Let's start calling the API in Python.

- Create a new `main.py` file
- Install requests with:

```
pip install requests
```

Here is what the basic setup looks like:

```python
import requests
SERPAPI_API_KEY = "YOUR_REAL_SERPAPI_API_KEY"

params = {
    "api_key": SERPAPI_API_KEY, #replace with your real API Key
    # soon
}

search = requests.get("https://serpapi.com/search", params=params)
response = search.json()
print(response)
```

With these few lines of code, we can access all of the search engines available at SerpApi, including the DuckDuckGo Search API

```python
import requests
SERPAPI_API_KEY = "YOUR_SERPAPI_API_KEY"

params = {
    "api_key": SERPAPI_API_KEY, 
    "engine" : "duckduckgo",
    "q": "Why is DuckDuckGo better?",
}

search = requests.get("https://serpapi.com/search", params=params)
response = search.json()
print(response)
```

To make the response easier to see, let's add indentation to the output.

```python
import json

# ...
# ...
# all previous code

print(json.dumps(response, indent=4))
```

> You can always refer to the [DuckDuckGo Search API documentation](https://serpapi.com/duckduckgo-search-api) for details.

Running this Python file should show you the search results:

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/03/CleanShot-2026-03-24-at-13.16.38.png)

DuckDuckGo scraper result example

### **Export to a CSV file**

You can store DuckDuckGo Search Results JSON data in databases or export it to a CSV file.

```python
import csv

...
results = response["organic_results"]

header = ['position', 'title', 'link', 'favicon', 'snippet']

with open('duckduckgo.csv', 'w', encoding='UTF8', newline='') as f:
    writer = csv.writer(f)

    writer.writerow(header)

    for item in results:
        print(item)
        writer.writerow([item.get('position'), item.get('title'), item.get('link'), item.get('favicon'), item.get('snippet')])

```

This example is using Python, but you can also use all your favorite programming languages like Ruby, NodeJS, Java, PHP, and more.

## Scrape search assist (AI overview) answer

SEO is not just about organic results anymore, there are many other points on the search results that [useful to track in this AI era](https://serpapi.com/blog/rank-tracking-in-the-age-of-ai-overviews-whats-changed/).

For example, DuckDuckGo offers "Search Assist" answer for visitors to find answers quickly:  

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/03/CleanShot-2026-03-24-at-15.51.01.png)

search assist answer from DuckDuckGo

In order to get this result, you just need to include `"search_assist": True` in the parameter. For example:

```python
params = {
    "api_key": SERPAPI_API_KEY,
    "engine" : "duckduckgo",
    "q": "Why is DuckDuckGo better?",
    "search_assist": True
}

search = requests.get("https://serpapi.com/search", params=params)
response = search.json()

print(json.dumps(response, indent=2))
```

You should see the `search_assist` answer before the `organic_results`

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/03/CleanShot-2026-03-24-at-15.57.00.png)

search assist API form DuckDuckGo

Check more API you can use for [Generative Engine Optimization](https://serpapi.com/use-cases/ai-seo-geo-api).