Skip to content

About

DuckDuckGo Search API by Autom: DuckDuckGo search results as structured JSON. Python, TypeScript, cURL, PHP, C#, Go, Java, Ruby examples.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DuckDuckGo Search API by Autom

DuckDuckGo Search API

Discord Get API key API docs License: MIT

The Autom DuckDuckGo Search API returns DuckDuckGo organic results as structured JSON, with country (gl) and language (hl) options.

  • DuckDuckGo Search API — Query DuckDuckGo via API and retrieve structured organic results with region and language.

Use it for privacy-focused search monitoring, SEO research or LLM grounding.

Endpoint Request Credits
DuckDuckGo Search API GET /v1/duckduckgo/search 1

Table of contents

How it works

  1. Create a Autom account and copy your API key from the dashboard.
  2. Call https://api.autom.dev with the header x-api-key: YOUR_API_KEY.
  3. Use the result in your app — no infrastructure to run.
export AUTOM_API_KEY="your-api-key"
pip install requests        # Python
# TypeScript: Node.js 18+ (native fetch), run with `npx tsx file.ts`

DuckDuckGo Search API

Query DuckDuckGo via API and retrieve structured organic results with region and language.

GET https://api.autom.dev/v1/duckduckgo/search · 1 credit per request · API reference

Request parameters

Parameter In Type Required Description
query query string ✅ Search query sent to DuckDuckGo Search.
page query number — Page number. Page 1 is the first page of results.
gl query string — Country code, for example us, fr, gb, de, jp.
hl query string — Language code, for example en, fr, de, ja, zh.

Python example

import os

import requests

API_KEY = os.environ["AUTOM_API_KEY"]
HEADERS = {"x-api-key": API_KEY}

response = requests.get(
    "https://api.autom.dev/v1/duckduckgo/search",
    headers=HEADERS,
    params={
        "query": "anthropic",
    },
    timeout=120,
)
response.raise_for_status()

data = response.json()
print(data)

TypeScript example

type DuckduckgoSearchApi = {
  organic_results?: {
    link?: string;
    title?: string;
    domain?: string;
    snippet?: string;
    position?: number;
    displayed_link?: string;
  }[];
  search_parameters?: {
    q?: string;
    gl?: string;
    hl?: string;
    page?: number;
    engine?: string;
  };
};

const headers = { "x-api-key": process.env.AUTOM_API_KEY!, "Content-Type": "application/json" };

const params = new URLSearchParams({
  "query": "anthropic",
});

const response = await fetch(`https://api.autom.dev/v1/duckduckgo/search?${params}`, { headers });
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);

const data = (await response.json()) as DuckduckgoSearchApi;
console.log(data);

Output example

Example response from the API reference, abridged.

{
  "organic_results": [
    {
      "link": "https://www.anthropic.com/",
      "title": "Anthropic",
      "domain": "www.anthropic.com",
      "snippet": "Anthropic is an AI safety company. Claude is its assistant.",
      "position": 1,
      "displayed_link": "https://www.anthropic.com"
    }
  ],
  "search_parameters": {
    "q": "anthropic",
    "gl": "us",
    "hl": "en",
    "page": 1,
    "engine": "duckduckgo"
  }
}

Response fields

Field Type Description
organic_results[] object[]
organic_results[].link string
organic_results[].title string
organic_results[].domain string
organic_results[].snippet string
organic_results[].position integer
organic_results[].displayed_link string
search_parameters object
search_parameters.q string
search_parameters.gl string
search_parameters.hl string
search_parameters.page integer
search_parameters.engine string

Code examples in other languages

Ready-to-run examples live in examples/; each reads your key from AUTOM_API_KEY.

Language duckduckgo-search
cURL (Bash) duckduckgo_search.sh
PHP duckduckgo_search.php
C# DuckduckgoSearch.cs
Go duckduckgo_search.go
Java DuckduckgoSearchExample.java
Ruby duckduckgo_search.rb
Node.js duckduckgo_search.mjs

Use cases

  • Rank tracking — Track positions on DuckDuckGo.
  • LLM grounding — Feed agents with fresh results.

Why Autom?

  • Every SERP in one API — Google Search, AI Mode, Maps, News, Shopping, Images, Videos, Jobs, Autocomplete, plus Bing and Brave.
  • Structured JSON — documented fields instead of brittle HTML parsing.
  • Geo & language targeting — search like a user from the country and language you need.
  • One API key, one header — x-api-key on every request.
  • Copy-paste examples — Python and TypeScript in each README, 7 more languages in examples/.

FAQ

How do I authenticate?

Create an account on Autom, copy your API key and send it in the x-api-key header of every request to https://api.autom.dev.

How much does a request cost?

Credits per call: /v1/duckduckgo/search 1. See Autom pricing.

Which languages are supported?

Any language that can make an HTTP request. This README shows Python and TypeScript; the examples/ folder contains cURL, PHP, C#, Go, Java, Ruby and Node.js.

Official SDKs

Use Autom from your own language with a typed client:

SDK Package Install
Node.js @automdev/sdk npm install @automdev/sdk
Python automdev pip install automdev
Go autom-go go get github.com/automdev/autom-go
.NET Autom dotnet add package Autom
Ruby autom gem install autom
PHP autom/sdk composer require autom/sdk
Java autom-java build from source, see its README
CLI @automdev/cli npm install -g @automdev/cli
MCP server @automdev/mcp npx -y @automdev/mcp

Related repositories

Support


Autom
Built by Autom. Examples are released under the MIT license.

About

DuckDuckGo Search API by Autom: DuckDuckGo search results as structured JSON. Python, TypeScript, cURL, PHP, C#, Go, Java, Ruby examples.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors