# Web Search Scraper — Search Results + Page Markdown for AI (`fabrikit/web-search-scraper`) Actor

Web search for AI agents and RAG without Google: ranked results (title, URL, snippet) from DuckDuckGo with Bing as backup, plus optional Markdown of the top pages. Plain HTTP, no API key, no browser. From US$1.60 per 1,000 results.

- **URL**: https://apify.com/fabrikit/web-search-scraper.md
- **Developed by:** [Fabrikit](https://apify.com/fabrikit) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 1,000 search results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Web Search Scraper — Search Results + Page Markdown for AI

Web Search Scraper extracts ranked web search results (title, URL, snippet) from DuckDuckGo, with Bing as a backup engine, and can fetch the top result pages as clean Markdown. It is the "search the web, then read the pages" step of an AI agent or RAG pipeline **without Google, without a browser and without an API key**: plain HTTP requests, so a query returns in a few seconds and costs **US$1.60 per 1,000 results**.

### What you get per result

- `query` — the search you asked for
- `rank` — position within that query (1 = first organic result)
- `title`, `url`, `displayUrl`, `domain` — the engine's redirect wrappers are resolved to the real URL
- `snippet` — the text shown under the result
- `engine` — `duckduckgo` or `bing`
- With **Fetch page content** on, for the top N results of each query: `markdown` (and/or `text`), `pageTitle`, `pageWordCount`, `pageStatusCode`, `pageFetched`, `needsBrowser`, `pageError`
- `scrapedAt` — ISO timestamp

Ads and "people also search" blocks are skipped; only organic results are returned.

### Features

- One record per result, flat and ready for CSV, JSON or a vector database
- Several queries per run, `maxResultsPerQuery` up to 100 (DuckDuckGo pages are followed automatically) and a global `maxItems`
- `engine`: `auto` (DuckDuckGo, Bing only if DuckDuckGo blocks or returns nothing), `duckduckgo` or `bing`
- `region` in DuckDuckGo style (`us-en`, `uk-en`, `de-de`...), mapped to Bing's country/language parameters
- Page content through the same extractor as the [Website to Markdown Scraper](https://apify.com/fabrikit/website-to-markdown-scraper): navigation, footers and cookie banners removed, headings, lists, tables and code blocks kept. JavaScript-only pages are flagged `needsBrowser` and **not charged**
- Polite by design: search requests to the same engine are spaced 1.5 s apart, sessions keep their cookies and browser fingerprint
- Anti-block ladder: Safari, Firefox and Chrome fingerprints are rotated when an engine challenges a session, and the run moves from datacenter to residential Apify Proxy automatically if the blocks continue

### Input example

```json
{
  "queries": ["python asyncio tutorial", "apify web scraping"],
  "maxResultsPerQuery": 10,
  "engine": "auto",
  "fetchPageContent": true,
  "maxPagesToFetch": 2,
  "maxItems": 100
}
```

### Output example

```json
{
  "query": "python asyncio tutorial",
  "rank": 1,
  "title": "Python's asyncio: A Hands-On Walkthrough - Real Python",
  "url": "https://realpython.com/async-io-python/",
  "displayUrl": "realpython.com/async-io-python/",
  "domain": "realpython.com",
  "snippet": "Python's asyncio library enables you to write concurrent code using the async and await keywords. ...",
  "engine": "duckduckgo",
  "pageTitle": "Python's asyncio: A Hands-On Walkthrough – Real Python",
  "pageStatusCode": 200,
  "pageWordCount": 7500,
  "pageFetched": true,
  "needsBrowser": false,
  "pageError": null,
  "markdown": "# Python's asyncio: A Hands-On Walkthrough\n\nPython's `asyncio` library enables you to write concurrent code using the `async` and `await` keywords. ...",
  "text": null,
  "scrapedAt": "2026-10-20T14:02:11.512Z"
}
```

Results 3 to 10 of the same query carry the search fields only (`pageFetched: false`, content fields `null`) when `maxPagesToFetch` is 2.

### Pricing

| Event | Price | When |
|---|---|---|
| `search-result` | US$0.0016 (US$1.60 / 1,000) | per search result saved |
| `page-content` | US$0.001 (US$1.00 / 1,000) | per result page fetched and converted (add-on, only with `fetchPageContent`) |

Examples: 100 queries × 10 results = 1,000 results = **US$1.60**. Adding the Markdown of the top 3 pages of each query = 300 pages = **+US$0.30**. Pages that fail, return an error status or need a browser are not charged. Set a maximum charge per run in the Apify Console and the Actor stops at that budget.

### Use cases

- Tool for an LLM agent: "search the web and read the top pages", returned as JSON in one call
- Fresh context for RAG answers without maintaining a crawl of the whole web
- Monitoring which pages rank for a set of queries (SEO, brand or competitor tracking)
- Building seed URL lists for other scrapers from a list of topics

### How it compares

- **Google-based SERP tools** need a browser or expensive residential proxies and break often. This Actor reads DuckDuckGo's HTML endpoint, which its robots.txt allows, over plain HTTP: cheaper and steadier, at the cost of DuckDuckGo's ranking instead of Google's.
- **Apify's RAG Web Browser** does a similar search-and-read job through Google at about US$2.28 per 1,000. This Actor costs US$1.60 per 1,000 results, charges page content separately so you only pay for the pages you read, and returns one flat record per result.
- **DuckDuckGo-only scrapers** stop at the snippet. Here the page Markdown is optional and comes from the same extractor as our Website to Markdown Scraper.

What it does not do: no images, news or video tabs, no Google results, no JavaScript rendering of result pages (those come back flagged `needsBrowser`).

### Integrations

Run it from the Apify API or the JavaScript/Python clients, schedule it, or call it from n8n, Make, Zapier, LangChain, LlamaIndex or an MCP server through Apify's integrations. The dataset can be exported as JSON, CSV or Excel, or sent to a webhook when the run finishes.

### FAQ

**Which engine should I use?** Leave `auto`. DuckDuckGo answered every test query with 10 organic results per page. Bing works as a backup, but to anonymous clients it sometimes serves a generic result set or an empty page, so it is only used when DuckDuckGo fails.

**Do I need a proxy?** The default Apify datacenter proxy is tried first. If DuckDuckGo shows its bot challenge to datacenter IPs, the Actor rotates browser fingerprints and then switches to a residential proxy for the rest of the run; the run log says when that happens.

**Are there limits?** Up to 100 results per query and 10 fetched pages per query. Queries are processed one at a time with a short pause between search requests, so very large query lists take longer rather than hammering the engine.

**Is it legal?** The Actor only reads public search result pages and public web pages, stores no personal data of its own, and respects the search engines' robots.txt (DuckDuckGo allows `/html/`). Check the terms of the sites whose content you fetch before republishing it.

**Why is `markdown` null for some results?** Only the first `maxPagesToFetch` results of each query are fetched. For fetched pages, `pageError` explains failures (HTTP errors, timeouts) and `needsBrowser: true` marks JavaScript-only pages; neither is charged.

### En español

Busca en la web para agentes de IA y RAG sin Google: resultados ordenados (título, URL, snippet) desde DuckDuckGo, con Bing como respaldo, y opcionalmente el Markdown de las primeras páginas de cada consulta usando el mismo extractor que nuestro Website to Markdown Scraper. Solo HTTP, sin navegador ni clave de API. Soporta varias consultas por corrida, región (`us-en`, `es-es`...), tope de resultados por consulta y total, y una escalera anti-bloqueo (huellas Safari/Firefox/Chrome y paso automático a proxy residencial). Precio: US$1,60 por 1.000 resultados; páginas convertidas a Markdown US$1,00 por 1.000 (las que fallan o requieren JavaScript no se cobran).

### Changelog

- **0.1** (October 2026) — first release: DuckDuckGo HTML with pagination, Bing backup, region codes, page content as Markdown/text, fingerprint and proxy ladder.

# Actor input Schema

## `queries` (type: `array`):

One web search per entry. Operators the engine understands work too, e.g. site:docs.python.org asyncio or "exact phrase".

## `maxResultsPerQuery` (type: `integer`):

How many organic results to return for each query (1 to 100). DuckDuckGo serves 10 on the first page and about 15 per extra page; each extra page is one more request.

## `engine` (type: `string`):

Auto uses DuckDuckGo and falls back to Bing only when DuckDuckGo blocks the request or returns nothing. Bing alone can return generic result sets for anonymous clients, so use it as a backup rather than the default.

## `region` (type: `string`):

Optional region code in DuckDuckGo style: us-en, uk-en, de-de, es-es, br-pt, fr-fr... Leave empty for worldwide results. On Bing it is mapped to the country and language parameters.

## `fetchPageContent` (type: `boolean`):

Open the top result pages of every query and add their main content as Markdown (and plain text). Charged as an extra 'page-content' event per page converted; pages that fail or need JavaScript are not charged.

## `maxPagesToFetch` (type: `integer`):

How many of the top results of each query get their content fetched (only when 'Fetch page content' is on).

## `pageOutputFormats` (type: `array`):

Which content fields to fill for fetched pages.

## `maxItems` (type: `integer`):

Stop after this many results across all queries.

## `proxyConfiguration` (type: `object`):

Apify datacenter proxy by default. If the search engine blocks datacenter IPs the Actor switches to a residential proxy automatically.

## Actor input object example

```json
{
  "queries": [
    "python asyncio tutorial",
    "apify web scraping"
  ],
  "maxResultsPerQuery": 10,
  "engine": "auto",
  "region": "",
  "fetchPageContent": false,
  "maxPagesToFetch": 3,
  "pageOutputFormats": [
    "markdown"
  ],
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All results collected during the run, one record per result

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "python asyncio tutorial",
        "apify web scraping"
    ],
    "maxResultsPerQuery": 10,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("fabrikit/web-search-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "queries": [
        "python asyncio tutorial",
        "apify web scraping",
    ],
    "maxResultsPerQuery": 10,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("fabrikit/web-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "python asyncio tutorial",
    "apify web scraping"
  ],
  "maxResultsPerQuery": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call fabrikit/web-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fabrikit/web-search-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/2IHpcUjlmw6if8kpV/builds/u7mtHWYNcrPFOLbxt/openapi.json
