Socket
Book a DemoInstallSign in
Socket

ts-duckduckgo-search

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-duckduckgo-search

DuckDuckGo search scraper with TypeScript API

latest
npmnpm
Version
0.3.1
Version published
Maintainers
1
Created
Source

DuckDuckGo Search Scraper

TypeScript wrapper for scraping DuckDuckGo results from the lite HTML endpoint.

Getting Started

npm install
npm run build

Usage

import { searchDuckDuckGo } from 'ts-duckduckgo-search';

const results = await searchDuckDuckGo('privacy focused search');

console.log(results);
/*
[
  {
    title: 'DuckDuckGo — Privacy, simplified.',
    url: 'https://duckduckgo.com/',
    description: 'DuckDuckGo is an internet search engine...'
  },
  ...
]
*/

Options

await searchDuckDuckGo('typescript', {
  maxResults: 20,
  locale: 'us-en',
  safeSearch: 'strict',
});
  • maxResults – Maximum number of results to return (default 10).
  • locale – Locale string passed as the kl parameter (us-en, pt-pt, etc.).
  • safeSearch – Safe-search level (off, moderate, strict).
  • offset – Result offset in multiples of 50, passed as the s parameter.
  • userAgent – Custom user-agent header.
  • signalAbortSignal used to cancel the underlying fetch.

Testing

npm test

Keywords

duckduckgo

FAQs

Package last updated on 31 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts