> ## 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 Knowledge Graph Results
- URL: https://serpapi.com/blog/how-to-scrape-duckduckgo-knowledge-graph-results/
- Published: 2023-12-31T08:17:31.000Z
- Updated: 2024-01-03T23:54:18.000Z
- Author: Andy L

In my series of blog posts guiding you to scrape Knowledge Graph results from large search engine platforms, I already guided you through how to scrape [Google](https://serpapi.com/blog/how-to-scrape-google-knowledge-graph-results/), [Bing](https://serpapi.com/blog/how-to-scrape-bing-knowledge-graph-results/), and [Yahoo](https://serpapi.com/blog/how-to-scrape-yahoo-knowledge-graph-results/) Knowledge Graph results effortlessly with [SerpApi](https://serpapi.com/).

DuckDuckGo is one of the popular search engines which is focusing on privacy. Surely DuckDuckGo returns a Knowledge Graph result for specific keywords.

The source of the Knowledge Graph is not public. Some search engines get results from Wikipedia and we can trust it.

![](https://lh7-us.googleusercontent.com/MBEXZKbLvVhOhQ0DJbrE5z0Sc_CNq6I2jR99wIXqYG8SobZUClMn15GQblZqvjbyfYPrAx53R1_8XAfn5MK7v8M3MxWDAI9ZfEurvO5G_2MPLfj9OJ0J37tbe0r-9Qp1xl1hEjqpMNjhJiQnpJQO99k)

###   
Setting up a SerpApi account

[SerpApi](https://serpapi.com/) offers a free plan for newly created accounts. Head to the [sign-up](https://serpapi.com/users/sign%5Fup?plan=free) page to register an account and complete your first search with our [interactive playground](https://serpapi.com/playground?engine=duckduckgo). When you want to do more searches with us, please visit the [pricing page](https://serpapi.com/pricing).

Once you are familiar with all results, you can utilize SERP APIs using your [API Key](https://serpapi.com/manage-api-key).

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2023/12/Screenshot-2023-12-29-at-11.10.24.png)

### Scrape your first DuckDuckGo Knowledge graph result with SerpApi

Head to the DuckDuckGo Knowledge Graph Results from the [documentation](https://serpapi.com/yahoo-knowledge-graph) on [SerpApi](https://serpapi.com/) for details.

In this tutorial, let's scrape some basic information from my favorite author: "Malcolm Gladwell". If you haven't picked up any of his books, try it. He's an excellent storyteller. The data contains: "name", "description", "thumbnail", "website", "education", and "notable\_work". You can also scrape even more information with [SerpApi](https://serpapi.com/)!

First, you need to install the [SerpApi client library](https://github.com/serpapi/serpapi-python).

```python
pip install google-search-results
```

Set up the[ SerpApi](https://serpapi.com/?ref=serpapi.com)[ credentials](https://serpapi.com/manage-api-key?ref=serpapi.com) and search.

```python
import serpapi, os, json

params = {
    'api_key': 'YOUR_API_KEY',         # your serpapi api
    'engine': 'duckduckgo',            # SerpApi search engine	
    'q': 'malcolm gladwell'
}

```

To retrieve DuckDuckGo Knowledge Graph Results for a given search term, you can use the following code:

```python

results = serpapi.Client().search(params).get_dict()['knowledge_graph']
```

You can store DuckDuckGo Knowledge Graph Results JSON data in databases or export them to a CSV file.

```python
import csv

header = ['name', 'description', 'thumbnail', 'website', 'education', 'notable_work']

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

    writer.writerow(header)

    writer.writerow([results.get('title'), results.get('description'), results.get('thumbnail'), results.get('website'), results.get('facts', {}).get('education'), results.get('facts', {}).get('notable_work')])

```

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

If you have any questions, please feel free to [contact me](mailto:andy@serpapi.com).