SerpBase
Back to Blog

DuckDuckGo Search API: Web Results as JSON

DuckDuckGo has no official web search API. One POST returns its results as JSON: title, link and snippet, with region, date limit and paging. Tested example.

November 24, 2026
By SerpBase Team2 min read

Short answer: DuckDuckGo has no official web search API, but you can get its results as JSON by POSTing a query to /duckduckgo/search — title, link and snippet for each result, in order.

DuckDuckGo's own "Instant Answer API" is often mistaken for a search API. It returns topic summaries and disambiguation boxes, not the list of web results. For the actual results you need the search page itself, parsed.

The request

curl -X POST 'https://api.serpbase.dev/duckduckgo/search' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{"q":"privacy friendly analytics"}'

What comes back

We ran this on 24 November 2026: 10 results in 2.0 seconds.

{
  "status": 0,
  "organic": [
    {
      "position": 1,
      "title": "Plausible Analytics | Simple, privacy-friendly Google Analytics alternative",
      "link": "https://plausible.io/",
      "display_link": "plausible.io",
      "snippet": "Plausible is a lightweight and open-source Google Analytics alternative..."
    }
  ],
  "pagination": {"has_more": true, "next_cursor": "eyJhcGkiOls..."}
}

For the next page, send the next_cursor value back as cursor.

Region and date

The endpoint accepts DuckDuckGo's own two switches under their original names: kl for the region (for example us-en, uk-en, de-de) and df for a date limit (d day, w week, m month, y year). They are the same codes DuckDuckGo puts in its URL.

Python: results for an agent or a script

import requests

def ddg(q, pages=2):
    body, out = {"q": q}, []
    for _ in range(pages):
        r = requests.post(
            "https://api.serpbase.dev/duckduckgo/search",
            headers={"X-API-Key": "YOUR_API_KEY"},
            json=body, timeout=30,
        ).json()
        if r["status"] != 0:
            break
        out += r.get("organic", [])
        cursor = (r.get("pagination") or {}).get("next_cursor")
        if not cursor:
            break
        body["cursor"] = cursor
    return [{"title": o["title"], "url": o["link"], "snippet": o["snippet"]} for o in out]

print(ddg("privacy friendly analytics")[:3])

Why use DuckDuckGo results at all

  • A second opinion on rankings. DuckDuckGo draws largely on Bing's index plus its own sources, so the order differs from Google's. SEO tools report both.
  • No personalisation. DuckDuckGo does not tailor results to a search history, which makes runs easier to compare.
  • Plain web results. For an AI assistant that only needs ten links and snippets, the page is simple and fast.

If you need Google's richer page — AI Overviews, People Also Ask, local packs — use /google/search instead; the request shape is the same.

Cost and limits

Each request costs 1 credit. Requests that fail are not charged. The response is always HTTP 200 with a status field: 0 means success, anything else comes with an error string, so check status rather than the HTTP code. New accounts get 500 free credits without a card.