# Duckduckgo API (`epctex/duckduckgo-api`) Actor

DuckDuckGo search over a simple HTTP API: get web results, images, news and videos by search term, region and safe-search setting. Always-on Standby Actor with JSON responses in seconds. Flat pay per successful request on every endpoint, with no DuckDuckGo account or API key needed.

- **URL**: https://apify.com/epctex/duckduckgo-api.md
- **Developed by:** [epctex](https://apify.com/epctex) (community)
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.97 / 1,000 search results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 API

DuckDuckGo API is an Apify actor that retrieves search results from DuckDuckGo: standard web results (links), images, news and videos, by search term, region and safe-search setting. Pricing is a flat $0.004 per successful request, on every endpoint.

DuckDuckGo API exposes 4 endpoints, accepts up to 5 query parameters per endpoint, and bills one pay-per-event charge per successful request — the event depends on which endpoint you call — with no subscription and no monthly minimum on paid plans.

### How It Works

DuckDuckGo API runs as an [Apify Standby Actor](https://docs.apify.com/platform/actors/running/standby): an always-on HTTP server, not a classic Actor run. There is no run to start and no dataset to poll — you send a plain `GET` request to an endpoint and the JSON comes back in the response itself.

| | Classic dataset Actor | DuckDuckGo API (Standby) |
| --- | --- | --- |
| How you call it | Start a run, wait, then read the dataset | One `GET` request |
| Result | Items accumulate in a dataset | JSON in the HTTP response, synchronously |
| Billing | Per run or per dataset item | Per successful request, by endpoint |

Authenticate with your Apify API token as an `Authorization: Bearer <token>` header (the OpenAPI spec declares bearer authentication). The token is only used to identify and bill the caller — it is **never forwarded** to the upstream data service.

### Who Uses DuckDuckGo API?

- **SEO and rank-tracking tools** run `/search` for a keyword in a chosen `region` and read the `url`, `hostname` and `title` of each result.
- **Media monitoring and PR teams** pull `/search/news` for a brand or topic, filtered by time (`d`, `w`, `m`, `y`), and read each article's `title`, `url`, `syndicate` and `relativeTime`.
- **Content and image research workflows** query `/search/images` and collect `image`, `thumbnail`, `width` and `height` for a term.
- **Video research tools** query `/search/videos` and read `title`, `duration`, `publisher` and `viewCount`.
- **AI agents and chatbots** call it directly as a tool: plain JSON over HTTP with a published OpenAPI spec.

### Endpoints & Parameters

All endpoints are `GET`. Base URL: `https://epctex--duckduckgo-api.apify.actor` — see the note under [Request Example](#request-example).

All endpoints take the same core query parameters. `region` and `safeSearch` are required on every endpoint; `time` is required on `/search` and `/search/news`, optional on `/search/videos`, and not available on `/search/images`. There are no default values.

#### Web search

| Endpoint | Field | Type | Description | Default |
| --- | --- | --- | --- | --- |
| `/search` | `term` | string | Keyword to search on DuckDuckGo, e.g. `food` | required |
| | `region` | enum | Region to initiate the search from (see [Regions](#regions)) | required |
| | `safeSearch` | enum | `off`, `moderate` or `strict` | required |
| | `time` | enum | `a` (All Time), `d` (Past Day), `w` (Past Week), `m` (Past Month), `y` (Past Year) | required |
| | `offset` | integer | Number to offset the search results by | — |

#### Images

| Endpoint | Field | Type | Description | Default |
| --- | --- | --- | --- | --- |
| `/search/images` | `term` | string | Keyword to search for images, e.g. `vodafone` | required |
| | `region` | enum | Region to initiate the search from | required |
| | `safeSearch` | enum | `off`, `moderate` or `strict` | required |
| | `offset` | integer | Number to offset the search results by | — |

#### News

| Endpoint | Field | Type | Description | Default |
| --- | --- | --- | --- | --- |
| `/search/news` | `term` | string | Keyword to search for news, e.g. `vodafone` | required |
| | `region` | enum | Region to initiate the search from | required |
| | `safeSearch` | enum | `off`, `moderate` or `strict` | required |
| | `time` | enum | `a`, `d`, `w`, `m` or `y` (as above) | required |
| | `offset` | integer | Number to offset the search results by | — |

#### Videos

| Endpoint | Field | Type | Description | Default |
| --- | --- | --- | --- | --- |
| `/search/videos` | `term` | string | Keyword to search for videos, e.g. `vodafone` | required |
| | `region` | enum | Region to initiate the search from | required |
| | `safeSearch` | enum | `off`, `moderate` or `strict` | required |
| | `time` | enum | `a`, `d`, `w`, `m` or `y` (as above) | — |
| | `offset` | integer | Number to offset the search results by | — |

`offset` is optional on every endpoint and must be an integer when given.

#### Regions

`region` accepts one of: `wt-wt`, `ar-es`, `au-en`, `at-de`, `be-fr`, `be-nl`, `br-pt`, `bg-bg`, `ca-en`, `ca-fr`, `ct-ca`, `cl-es`, `cn-zh`, `co-es`, `hr-hr`, `cz-cs`, `dk-da`, `ee-et`, `fi-fi`, `fr-fr`, `de-de`, `gr-el`, `hk-tzh`, `hu-hu`, `in-en`, `id-en`, `ie-en`, `il-en`, `it-it`, `jp-jp`, `kr-kr`, `lv-lv`, `lt-lt`, `my-en`, `mx-es`, `nl-nl`, `nz-en`, `no-no`, `pk-en`, `pe-es`, `ph-en`, `pl-pl`, `pt-pt`, `ro-ro`, `ru-ru`, `xa-ar`, `sg-en`, `sk-sk`, `sl-sl`, `za-en`, `es-ca`, `es-es`, `se-sv`, `ch-de`, `ch-fr`, `tw-tzh`, `th-en`, `tr-tr`, `uk-en`, `us-en`, `us-es`, `ua-uk`, `vn-en`.

### Request Example

> **Standby base URL:** Apify Standby actors are reachable at `https://{apify-username}--{actor-name}.apify.actor`. This actor is published under the epctex account, so its Standby base URL is `https://epctex--duckduckgo-api.apify.actor`, used in the examples below.

Standard search:

```bash
curl -G "https://epctex--duckduckgo-api.apify.actor/search" \
  --data-urlencode "term=food" \
  --data-urlencode "region=wt-wt" \
  --data-urlencode "safeSearch=off" \
  --data-urlencode "time=a" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

Charges `search-results` ($0.004) on success.

Image search:

```bash
curl -G "https://epctex--duckduckgo-api.apify.actor/search/images" \
  --data-urlencode "term=vodafone" \
  --data-urlencode "region=wt-wt" \
  --data-urlencode "safeSearch=off" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

Charges `image-results` ($0.004) on success.

News from the past week:

```bash
curl -G "https://epctex--duckduckgo-api.apify.actor/search/news" \
  --data-urlencode "term=vodafone" \
  --data-urlencode "region=wt-wt" \
  --data-urlencode "safeSearch=off" \
  --data-urlencode "time=w" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

Charges `news-results` ($0.004) on success.

### Pricing Model

DuckDuckGo API is priced per successful request, by endpoint. It bills one pay-per-event charge per successful request, based on the endpoint called. Only the called endpoint's event is charged, and only once per request. Every endpoint currently has its own event, and all four are priced the same.

| Endpoint | Event | Price |
| --- | --- | --- |
| `/search` | `search-results` | $0.004 |
| `/search/images` | `image-results` | $0.004 |
| `/search/news` | `news-results` | $0.004 |
| `/search/videos` | `video-results` | $0.004 |

#### Cost examples

| Scenario | Requests | Cost |
| --- | --- | --- |
| One web search | 1 | $0.004 |
| One image search | 1 | $0.004 |
| Web, image, news and video search for one term | 4 | 4 x $0.004 = $0.016 |
| Pull 10 pages of news results with `offset` | 10 | 10 x $0.004 = $0.04 |
| 1,000 web searches | 1,000 | 1,000 x $0.004 = $4.00 |
| 1,000 video searches | 1,000 | 1,000 x $0.004 = $4.00 |
| 5,000 searches across all endpoints | 5,000 | 5,000 x $0.004 = $20.00 |

**Cost optimization tips:** don't retry on `400`/`403`/`404`/`429` — they're not charged but they also won't succeed on retry without changing the request; cache results for terms you don't expect to change between calls; each request is billed once however many results it contains, so request only the pages you need.

| Status | Meaning | Charged? |
| --- | --- | --- |
| `200` | Successful response, contains `data` | Yes — the called endpoint's event |
| `400` | Bad request — a query parameter failed validation | No |
| `403` | Standby access not available on your plan, or your access was restricted by the developer | No |
| `404` | Endpoint not matched | No |
| `429` | Monthly free-request limit reached | No |
| `502` | Bad gateway — the request to the upstream data service failed | No |
| `503` | Your plan could not be checked right now | No |

#### Demo Mode

Apify Free-plan users can try DuckDuckGo API without a subscription, capped at **10 requests per calendar month**. Once that limit is used up, every call answers `429` ("You have used all free requests for this month. Upgrade your Apify plan to keep going.") until the next month. A paid Apify plan removes the monthly cap.

### Output Example

Every successful response wraps the results in `status`, `message` and `data`, where `data` is an array.

Standard search (`GET /search`):

```json
{
  "status": 200,
  "message": "OK",
  "data": [
    {
      "title": "Vodafone - Our Best Ever Network | Now With 5G",
      "description": "<b>Vodafone</b> - Our Best Ever Network | Now With 5G Shop Why <b>Vodafone</b> Help My <b>Vodafone</b>",
      "rawDescription": "<b>Vodafone</b> - Our Best Ever Network | Now With 5G Shop Why <b>Vodafone</b> Help My <b>Vodafone</b>",
      "hostname": "www.vodafone.co.uk",
      "icon": "https://external-content.duckduckgo.com/ip3/www.vodafone.co.uk.ico",
      "url": "https://www.vodafone.co.uk/",
      "bang": {
        "prefix": "fn",
        "title": "foodnetwork.com",
        "domain": "www.foodnetwork.com"
      }
    }
  ]
}
```

`bang` is nullable.

Image search (`GET /search/images`), each item:

```json
{
  "height": 800,
  "image": "https://diginomica.com/sites/default/files/images/2016-10/vodafone.jpg",
  "image_token": "3076a837cc3d6218f3182c8c3454a58e328f31cb41d22c9aec2db6677ff0fc82",
  "source": "Bing",
  "thumbnail": "https://tse3.mm.bing.net/th?id=OIP.qAfClOqIY8qSjFWruBy35wHaEo&pid=Api",
  "thumbnail_token": "9577c37b5ccdc0d1e7e40f24b982483f77a873fd68fcec148bf99aeee62616d6",
  "title": "Vodafone's £4.6m CRM fine - when IT projects attack",
  "url": "https://diginomica.com/vodafones-4-6m-customer-service-fine-when-it-projects-attack",
  "width": 1280
}
```

News search (`GET /search/news`), each item:

```json
{
  "date": 1676883300,
  "excerpt": "This year has got off to a great start for holders of <b>Vodafone</b>.",
  "image": "https://media.zenfs.com/en/fool.co.uk/e38b69e9eb81e5844e7110527930e60c",
  "relativeTime": "7 days ago",
  "syndicate": "Bing",
  "title": "Vodafone shares leap in 2023. Are they still a bargain?",
  "url": "https://uk.movies.yahoo.com/vodafone-shares-leap-2023-still-085500857.html",
  "isOld": false
}
```

Video search (`GET /search/videos`), each item:

```json
{
  "url": "https://www.youtube.com/watch?v=W0ml8acNb1w",
  "title": "Here Are Key Takeaways From Vodafone Idea's Conference Call | Trading Hour | CNBC-TV18",
  "description": "Here are the key takeaways from Vodafone Idea's Conference Call. Reema gives more details.",
  "image": "https://tse1.mm.bing.net/th?id=OVF.VCNwYCTdox%2f9bge3vbY7jg&pid=Api",
  "duration": "2:11",
  "publishedOn": "YouTube",
  "published": "2023-02-16T06:18:52.000Z",
  "publisher": "CNBC-TV18",
  "viewCount": 685
}
```

`viewCount` is nullable.

Errors use the same envelope without `data`, for example:

```json
{ "status": 400, "message": "Bad request" }
```

A `400` response also carries an `errors` array naming the failing parameters.

### Limitations

- **`region`, `safeSearch` and (on `/search` and `/search/news`) `time` are required.** A request that omits them, or sends a value outside the allowed enum, is answered `400` and is not charged.
- **`/search/images` has no `time` filter.**
- **Pagination is by `offset` only** — pass an integer `offset` to move through results. Each call is a separate, separately charged request.
- **Per-endpoint pricing, not per-result pricing.** Each request charges the called endpoint's event once, regardless of how many results the response contains.
- **Result fields vary by endpoint** — web, image, news and video results each have their own shape (see [Output Example](#output-example)); `description` and `excerpt` can contain `<b>` highlight markup.

### Which DuckDuckGo API Questions Come Up Most Often?

#### Does DuckDuckGo API need a DuckDuckGo account or API key?

No. You only need an Apify API token.

#### How much does it cost?

Every endpoint costs $0.004 per successful request (see the [Pricing Model](#pricing-model) table), so 1,000 requests cost $4.00. Failed, invalid or rejected responses are never charged, and a request never charges more than one event.

#### Am I charged per result, or per request?

Per request. The charge is the called endpoint's event, once per successful request.

#### How do I get more results?

Pass an integer `offset` query parameter. Each call is a separate, separately charged request.

#### What happens when I hit the free-plan limit?

Every call returns `429` with "You have used all free requests for this month. Upgrade your Apify plan to keep going." until the next calendar month, or until you move to a paid Apify plan.

#### Why did my request return `403`?

Either Standby access isn't available on your current Apify plan, or your access to this Actor has been specifically restricted by its developer.

#### Can I retry a `502` or `503`?

Yes. `502` means the request to the upstream data service failed; `503` means your plan/quota couldn't be checked. Neither is charged.

#### Why did my request return `400`?

A query parameter failed validation, for example a missing `term`, a `region` or `safeSearch` outside the allowed values, a missing required `time`, or a non-integer `offset`. The response's `errors` array lists what failed.

#### Can I use this from an AI agent or bot?

Yes. It's a plain HTTP JSON API with a published OpenAPI spec, so it fits LLM tool calls, bots, backends, and any no-code tool that can make HTTP requests.

### Contact

DuckDuckGo API is published by epctex. Visit [epctex.com](https://epctex.com) to see all available products. For custom integrations, reach out through the chat box on epctex.com. For support, contact business@epctex.com.

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("epctex/duckduckgo-api").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("epctex/duckduckgo-api").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 '{}' |
apify call epctex/duckduckgo-api --silent --output-dataset

```

## MCP server setup

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

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/6HcUBxAQOK2j2abH6/builds/Bu35xWFp6Ybl9Y7GJ/openapi.json
