Search
Perform web searches and optionally scrape content from search results using DuckDuckGo.
Creating Search Robots
import { Search } from 'maxun-sdk';
const searcher = new Search({
apiKey: process.env.MAXUN_API_KEY
});
const robot = await searcher.create(
'Tech News Search',
{
query: 'artificial intelligence 2025',
mode: 'discover',
limit: 10
}
);
Configuration
Required Options
query (required)
The search query in natural language.
{
query: 'latest AI developments'
}
Optional Configuration
mode (optional)
Search mode. Defaults to discover.
discover- Returns only search result metadata (title, URL, description)scrape- Visits each result page and extracts full content
{
mode: 'discover' // or 'scrape'
}
limit (optional)
Maximum number of search results to return. Defaults to 10.
{
limit: 20
}
filters (optional)
Search filters for time range and region.
{
filters: {
timeRange: 'week', // 'day', 'week', 'month', 'year'
region: 'us-en' // Region code
}
}
provider (optional)
Search provider. Currently only duckduckgo is supported. Defaults to duckduckgo.
{
provider: 'duckduckgo'
}
Search Modes
Discover Mode
Returns search result metadata only. Fast and lightweight.
const robot = await searcher.create(
'Quick Research',
{
query: 'web scraping tools',
mode: 'discover',
limit: 10
}
);
const result = await robot.run();
Returns:
- Title
- URL
- Description
Scrape Mode
Visits each search result and extracts full page content.
const robot = await searcher.create(
'Deep Research',
{
query: 'machine learning tutorials',
mode: 'scrape',
limit: 10
}
);
const result = await robot.run();
Returns all above plus:
- Full page metadata
- HTML content
- Clean text content
- Links found on page
- HTTP status code