DuckDuckGo API Documentation

DuckDuckGo API uses /api/v1/search?engine=duckduckgo API endpoint to scrape real-time results.

API Parameters

Search Query

  • Name
    q
    Required
    Required
    Description

    Defines the search term for DuckDuckGo. You can also use advanced operators supported by DuckDuckGo, such as site:, intitle:, or inurl: to refine your search.

Localization

  • Name
    locale
    Required
    Optional
    Description

    Specifies the country and language for your search. The default parameter is us-en. Check the full list of supported DuckDuckGo locales.

Filters

  • Name
    safe
    Required
    Optional
    Description

    Specifies the filter level for adult content. Available values are:

    • on Default
    • moderate
    • off

  • Name
    time_period
    Required
    Optional
    Description

    Filters results by date. Predefined values are:

    • any_time Default
    • past_year
    • past_month
    • past_week
    • past_day
    Also possible to filter by a spcific date range, use following format for that:
    • YYYY-MM-DD..YYYY-MM-DD

Pagination

  • Name
    page
    Required
    Optional
    Description

    Defines the page index for retrieving search results. The first page contains approximately 20–30 organic_results, while each subsequent page retrieves 50 results.

Engine

  • Name
    engine
    Required
    Required
    Description

    Parameter defines an engine that will be used to retrieve real-time data. It must be set to duckduckgo.

Api Key

  • Name
    api_key
    Required
    Required
    Description

    The api_key authenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).

API Examples

Organic Results

Organic Results
GET
https://www.searchapi.io/api/v1/search?engine=duckduckgo&q=x
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "duckduckgo",
  "q": "x"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "organic_results": [
    {
      "position": 1,
      "title": "X - Official Site",
      "link": "https://www.x.com/",
      "snippet": "From breaking news and entertainment to sports and politics, get the full story with all the live commentary.",
      "snippet_highlighted_words": [
        "news",
        "entertainment",
        "sports",
        "politics"
      ],
      "sitelinks": [
        {
          "title": "Download the X app",
          "link": "https://help.x.com/en/using-x/download-the-x-app",
          "snippet": "Download X for iOS. Download X for Android. Download the X app on your device. The X app is the trusted global digital town square for everyone. With X, you can: Post content for the world to see and join public conversations. Stay up to date on breaking news and follow your interests. Stay better informed with extra context from Community Notes."
        },
        ...
      ],
      "favicon": "https://external-content.duckduckgo.com/ip3/www.x.com.ico"
    },
    ...
  ]  
}

Ads

Ads
GET
https://www.searchapi.io/api/v1/search?engine=duckduckgo&q=dropshipping
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "duckduckgo",
  "q": "dropshipping"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "ads": [
    {
      "position": 1,
      "title": "Shopify Dropshipping Success - Shopify Dropshipping for $1",
      "tracking_link": "https://duckduckgo.com/y.js?ad_domain=autods.com&ad_provider...",
      "link": "https://platform.autods.com/register/?cta...",
      "source": "autods.com",
      "snippet": "Find winning dropshipping products instantly without hours of manual research. Save time with automated dropshipping on Shopify, eBay, Amazon and more. Try it for $1",
      "snippet_highlighted_words": [
        "dropshipping"
      ],
      "structured_snippet": "Service catalog: Shopify, eBay, Facebook, Etsy, WooCommerce, Amazon",
      "promotion": {
        "description": "Try It For $1",
        "code": "BF2024",
        "expiration": "October 31, 2024",
        "occasion": "Black Friday",
        "link": "https://platform.autods.com/...",
        "tracking_link": "https://duckduckgo.com/y.js?ad_domain=autods.com&ad_provider..."
      },
      "sitelinks": [
        {
          "title": "Login Now",
          "link": "https://duckduckgo.com/y.js?ad_domain=autods.com&ad_provider...",
          "tracking_link": "https://platform.autods.com/...",
          "snippet": "Login To Autods.com Manage Your Account Today!"
        },
        ...
      ],
      "favicon": "https://external-content.duckduckgo.com/ip3/autods.com.ico"
    },
    ...
  ]
}

Knowledge Graph

Knowledge Graph
GET
https://www.searchapi.io/api/v1/search?engine=duckduckgo&q=steve+jobs
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "duckduckgo",
  "q": "steve jobs"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "knowledge_graph": {
    "title": "Steve Jobs",
    "subtitle": "American entrepreneur; co-founder of Apple Inc. (1955–2011)",
    "website": "https://apple.com/stevejobs",
    "description": "Steven Paul Jobs was an American businessman, inventor, and investor best known for co-founding the technology company Apple Inc. Jobs was also the founder of NeXT and chairman and majority shareholder of Pixar. He was a pioneer of the personal computer revolution of the 1970s and 1980s, along with his early business partner and fellow Apple co-founder Steve Wozniak. Jobs was born in San Francisco in 1955 and adopted shortly afterwards. He attended Reed College in 1972 before withdrawing that same year. In 1974...",
    "text": {
      "name": "Wikipedia",
      "link": "https://en.wikipedia.org/wiki/Steve_Jobs"
    },
    "facts": {
      "born": "Steven Paul Jobs, February 24, 1955, San Francisco, California, U.S.",
      "age_at_death": "56 years",
      "died": "October 05, 2011, Palo Alto, California, U.S.",
      "resting_place": "Alta Mesa Memorial Park",
      "education": "Reed College (attended)",
      "years_active": "1971–2011",
      "board_member_of": "The Walt Disney Company, Apple Inc.",
      "partner(s)": "Chrisann Brennan (1972–1977)",
      "children": "4, including Lisa, Reed, and Eve",
      "relatives": "Mona Simpson (sister), Bassma Al Jandaly (cousin), Malek Jandali (cousin)",
      "awards": "Presidential Medal of Freedom (posthumous, 2022)"
    },
    "profiles": [
      {
        "name": "IMDb ID",
        "link": "https://www.imdb.com/name/nm0423418",
        "thumbnail": "https://duckduckgo.com/assets/icons/thirdparty/imdb.svg"
      },
      ...
    ],
    "people_also_search_for": [
      {
        "query": "Steve Jobs Category",
        "link": "https://duckduckgo.com/c/Steve_Jobs"
      },
      ...
    ],
    "thumbnail": "https://duckduckgo.com/i/117a0871ebc7a86a.jpg"
  }
}

AI Overview

AI Overview
GET
https://www.searchapi.io/api/v1/search?engine=duckduckgo&q=Who+is+the+tallest+person+in+the+world%3F
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "duckduckgo",
  "q": "Who is the tallest person in the world?"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "ai_overview": {
    "answer": "The tallest person in the world was Robert Wadlow, who stood at 8 feet 11.1 inches tall. He was born on February 22, 1918, and holds the title for the tallest man ever recorded.",
    "sources": [
      {
        "link": "https://en.wikipedia.org/wiki/List_of_tallest_people",
        "source": "Wikipedia",
        "title": "List of tallest people"
      }
      ...
    ]
  }
}

Top Stories

Top Stories
GET
https://www.searchapi.io/api/v1/search?engine=duckduckgo&q=stock+market+news
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "duckduckgo",
  "q": "stock market news"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "top_stories": [
    {
      "title": "Stock Market Today: Dow futures lean higher after first full week of earnings",
      "link": "https://www.marketwatch.com/livecoverage/stock-market-today-dow-futures-lean-higher-after-first-full-week-of-earnings",
      "source": "MarketWatch",
      "date": "2024-10-25T09:46:00Z",
      "snippet": "Investing legend Jim Rogers expects an 'extremely bad' recession. Why he's buying silver instead of gold.",
      "thumbnail": "https://images.mktw.net/im-00671980/social"
    },
    ...
  ]
}

Inline Images

Inline Images
GET
https://www.searchapi.io/api/v1/search?engine=duckduckgo&q=beaver
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "duckduckgo",
  "q": "beaver"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "inline_images": [
    {
      "title": "Beaver",
      "source": {
        "name": "Bing",
        "link": "https://kids.nationalgeographic.com/animals/mammals/facts/beaver"
      },
      "original": {
        "link": "https://i.natgeofe.com/k/3892766d-ad0e-4027-9cca-a03708fcd1e6/beaver-closeup_16x9.jpg?w=1200",
        "height": 675,
        "width": 1200
      },
      "thumbnail": "https://tse1.mm.bing.net/th?id=OIP.TvjopbcOnAtQInuxLJGQLwHaEK&pid=Api"
    },
    ...
  ]
}

Inline Videos

Inline Videos
GET
https://www.searchapi.io/api/v1/search?engine=duckduckgo&q=bear+videos
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "duckduckgo",
  "q": "bear videos"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "inline_videos": [
    {
      "position": 1,
      "title": "Playful Bear Cub Grows Big Enough to Climb a Tree | Animal Videos For ...",
      "link": "https://www.youtube.com/watch?v=9vhpV8tc_LA",
      "video_link": "http://www.youtube.com/embed/9vhpV8tc_LA?autoplay=1",
      "source": "YouTube",
      "channel": "Dodo Kids",
      "views": 3373430,
      "date": "2020-07-26T12:00:02.0000000",
      "thumbnail": "https://tse1.mm.bing.net/th?id=OVP.yTkY9aIpi2iaW9uFWBpAZwEsDh&pid=Api"
    },
  ...
  ]
}
Related Searches
GET
https://www.searchapi.io/api/v1/search?engine=duckduckgo&q=apple
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "duckduckgo",
  "q": "apple"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "related_searches": [
    {
      "query": "apple store online shopping",
      "link": "https://duckduckgo.com/?q=apple%20store%20online%20shopping"
    },
    ...
  ]
}