# DuckDuckGo Scraper (`ivanvs/duckduckgo-scraper`) Actor

Scrape search results from DuckDuckGo without any limits! Export your search result data into XML, JSON, CSV or Excel!

- **URL**: https://apify.com/ivanvs/duckduckgo-scraper.md
- **Developed by:** [Gen First](https://apify.com/ivanvs) (community)
- **Categories:** Automation, Integrations, SEO tools
- **Stats:** 129 total users, 11 monthly users, 99.5% runs succeeded, 4 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## DuckDuckGo Scraper

Scrape search result data from [DuckDuckGo](https://duckduckgo.com/) easily with DuckDuckGo Scraper.

### About

DuckDuckGo is an American software company focused on online privacy, whose flagship product is a search engine named DuckDuckGo. Founded by Gabriel Weinberg in 2008, its later products include browser extensions and a custom DuckDuckGo web browser. Headquartered in Paoli, Pennsylvania, DuckDuckGo is a privately held company with about 200 employees. The company's name is a reference to the children's game duck, duck, goose.

### Why should you use it?

It provides the realtime scraping of search results from DuckDuckGo, without requiring any other configuration and without any limits.

### How to use it?

DuckDuckGo Scraper has number of input parameters that can be used.

| Input parameter | Description                                                                                                                                                                                | Required | Default value |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | ------------- |
| query           | Query which you want to get search results                                                                                                                                                 | `true`   | `""`          |
| maxResult       | Number of results that you want to scrape from DuckDuckGo                                                                                                                                  | false    | `100`         |
| timeFrame       | Time frame from which you want to retrive search results. Possible values: **'a'** - `Anytime`, **'d'** - `Past day`, **'w'** - `Past week`, **'m'** - `Past month`, **'y'** - `Past year` | false    | `'a'`         |
| safeSearch      | Filter out websites that contain explicit or mature content. Possible values: **0** - `Strict`, **-1** - `Moderate`, **-2** - Off                                                          | false    | -2            |

#### Examples

##### Input

Scrape search results for query "Senior java developer job" and scrape maximum of 100 results:

```json
{
  "query": "Senior java developer job",
  "maxResults": 100,
  "timeFrame": "a",
  "safeSearch": -2
}
```

##### Output

```json
{
  "title": "Behavox: Senior Java Developer - indexventures.com",
  "description": "As a **Senior** **Java** **Developer** , you will be a part of an engineering\nteam responsible for one of our products. You will partner up with the product\nmanagement, design and other engineering teams to solve complex technical\nproblems and deliver outstanding products to our clients, on time. For the\nright Talent this is a great opportunity because: 1.\n\n",
  "rawDescription": "As a <b>Senior</b> <b>Java</b> <b>Developer</b>, you will be a part of an engineering team responsible for one of our products. You will partner up with the product management, design and other engineering teams to solve complex technical problems and deliver outstanding products to our clients, on time. For the right Talent this is a great opportunity because: 1.",
  "hostname": "www.indexventures.com",
  "icon": "https://external-content.duckduckgo.com/ip3/www.indexventures.com.ico",
  "url": "https://www.indexventures.com/startup-jobs/behavox/senior-java-developer-91/",
  "time": "2025-05-17T00:00:00.0000000"
}
```

### DuckDuckGo Scraper data output

The output from DuckDuckGo Scraper is stored in the dataset. After the run is finished, you can download the dataset in various data formats (JSON, CSV, XML, RSS, HTML Table).

### ❓FAQ

#### Do I need proxies to scrape search results from DuckDuckGo?

Proxy for this scraper is already preconfigured for optimal performance.

### Support

For more custom/simplify outputs or Bug report please contact the developer (support (at) getmediumdata.com) or report an issue.

Icon used for scraper can be found [here](https://icon-icons.com/icon/duckduckgo/66966)

# Actor input Schema

## `query` (type: `string`):

Search that you want to execute

## `timeFrame` (type: `string`):

Select time frame that allows you to retrive search results from given time frame

## `maxRecords` (type: `integer`):

Maximum number of records to be scraped

## `safeSearch` (type: `string`):

Filter out websites that contain explicit or mature content

## Actor input object example

```json
{
  "query": "java developer",
  "maxRecords": 10
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "java developer",
    "maxRecords": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("ivanvs/duckduckgo-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "query": "java developer",
    "maxRecords": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("ivanvs/duckduckgo-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "java developer",
  "maxRecords": 10
}' |
apify call ivanvs/duckduckgo-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ivanvs/duckduckgo-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/kwclt82m1EBNn0VPq/builds/ZP1kgBASUbx2UsvCP/openapi.json
