# Web Search Scraper - SERP Results, News & Page Markdown (`extraordinary_grasshopper/web-search-scraper`) Actor

Search the web or news for any query in 44 countries and get titles, URLs, snippets and dates, plus the top pages as clean Markdown for AI agents and RAG. Pay per result.

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

## Pricing

from $0.20 / 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 the web or the news for **any query in 44 countries** and get clean, structured results: position, title, URL, domain and snippet for web results, or title, source, publish time and image for news. It can also **open the top results and return their main content as Markdown**, ready for AI agents, LLM prompts and RAG pipelines. No browser or proxy setup is needed, and you **pay only per result**.

### What can this web search scraper do?

- 🔎 **Web search results (SERP)**: organic results with position, title, URL, domain and snippet, up to 5 pages per query.
- 📰 **News search**: up to 30 recent articles per query with source, snippet, relative and ISO publish time, and thumbnail image.
- 🤖 **Search + read for AI**: the top 1-5 results of each query come with their main page content as clean Markdown or text, plus author and publish date. One step from a question to grounded context for your LLM.
- 🌍 **44 countries and languages**, or worldwide results.
- ⏱️ **Time filters**: past hour (news), 24 hours, week, month or year (web).
- 🧩 Search operators work: `site:`, `"exact phrase"`, `-exclude`.
- 🛡️ Safe search: moderate, strict or off.

Use it for SEO rank checks, competitor and brand monitoring, news alerts, lead research, content research, and as a live web search tool for AI agents.

### How much does it cost?

This Actor uses **pay per event** pricing:

| Event | Price |
|---|---|
| Web search result | $0.0002 ($0.20 per 1,000 results, about $0.002 per page of 10) |
| News article | $0.001 ($1 per 1,000) |
| Search result with page content (Markdown / text) | $0.0015 ($1.50 per 1,000) |

A result whose page was read is charged only as **search result with page content**, not twice. Queries that fail are reported in the dataset **for free**. Set a maximum cost per run in the run options and the Actor stops cleanly when it reaches the limit.

### How to use it

1. Enter one or more **search queries**, one per line.
2. Choose **Web results** or **News articles**, a **country** and a **time range**.
3. For AI and RAG, set **Read top results as Markdown** to 1-5.
4. Click **Start**, then download the results as JSON, CSV, Excel or HTML, or get them through the API, Make, Zapier or a webhook.

### Input example

```json
{
    "queries": ["what is retrieval augmented generation", "site:github.com docker compose healthcheck"],
    "mode": "web",
    "country": "us",
    "timeRange": "day",
    "maxPagesPerQuery": 1,
    "readTopResults": 2,
    "contentFormat": "markdown",
    "maxContentChars": 800
}
```

### Output example

Web result with page content (content shortened here):

```json
{
    "query": "what is retrieval augmented generation",
    "type": "organic",
    "page": 1,
    "position": 1,
    "title": "RAG Architecture: A Data-Driven Benchmark of 6 Production Patterns",
    "url": "https://www.linkedin.com/pulse/rag-architecture-data-driven-benchmark-6-production-ekanathan-cykzc",
    "domain": "linkedin.com",
    "snippet": "Most AI prototypes fail in production for one simple reason: teams pick a Retrieval-Augmented Generation (RAG) architecture based on hype rather than workload requirements, latency budgets, and ...",
    "published_time": "2026-11-15T01:28:15.000+00:00",
    "author": "Madhavan Ekanathan",
    "content": "Most AI prototypes fail in production for one simple reason: teams pick a Retrieval-Augmented Generation (RAG) architecture based on hype rather than workload requirements, latency budgets, and failure modes.\n\nAs engineering leaders, we don’t need another \"14 types of RAG\" buzzword list. We need to know:\n\n-   Which architecture solves which business problem? ...",
    "word_count": 484,
    "truncated": true,
    "country": "us",
    "timeRange": "day",
    "scrapedAt": "2026-11-15T06:47:56.621Z"
}
```

Plain web result:

```json
{
    "query": "best open source vector database",
    "type": "organic",
    "page": 2,
    "position": 12,
    "title": "What Is a Vector Database? Top 10 Open Source Options",
    "url": "https://www.instaclustr.com/education/vector-database/top-10-open-source-vector-databases/",
    "domain": "instaclustr.com",
    "snippet": "Top 10 open source vector databases A vector database manages, indexes, and queries high-dimensional vector data, often used in machine learning, data mining, and advanced analytical applications.",
    "country": null,
    "timeRange": null,
    "scrapedAt": "2026-11-15T06:47:35.874Z"
}
```

News article:

```json
{
    "query": "nvidia earnings",
    "type": "news",
    "position": 1,
    "title": "Nvidia earnings — along with the baggage — top next week's markets",
    "url": "https://www.aol.com/articles/nvidia-earnings-along-baggage-top-023700000.html",
    "source": "AOL",
    "snippet": "Time was that earnings reports from chip giant Nvidia provided moments of celebration for the extraordinary success of a U.S.",
    "published": "6h",
    "published_at": "2026-11-15T00:47:46.699Z",
    "image": "https://th.bing.com/th?id=ONUT.5YsD4SegtnyZ4PaPgU2Wpg&pid=News&w=234&h=132&c=14&rs=2&qlt=90",
    "country": "gb",
    "timeRange": "week",
    "scrapedAt": "2026-11-15T06:47:46.701Z"
}
```

`published_at` is computed from the relative time ("6h"), so it is approximate. If a top page can't be read (for example the site blocks robots), the result is still returned as a normal search result with `content: null` and a `read_error`.

### Tips

- **For AI agents and RAG**, use `readTopResults` 3 and `maxContentChars` 4,000-8,000: enough context per source without flooding the prompt.
- **For SEO rank tracking**, use `maxPagesPerQuery` 3-5 and a fixed country, then schedule the Actor and compare positions between runs.
- **For news monitoring**, use mode `news` with time range `day` or `hour` on a schedule, and send new items to Slack or e-mail through an integration.
- Need full pages for a list of URLs you already have? Use our **Web Page to Markdown** Actor.

### Is it legal to scrape search results?

This Actor collects only public search results and public web pages that anyone can see without logging in. It doesn't log in anywhere and doesn't collect personal data on purpose. You are responsible for how you use the data and for following the terms of the websites and the laws that apply to you.

### Need another field or a custom feed?

Open an issue on the **Issues** tab. We usually reply within a day.

# Actor input Schema

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

What to search for, one query per line (max 400 characters each). Operators such as site:, "exact phrase" and -exclude work.

## `mode` (type: `string`):

Web results (organic links with snippets) or news articles (title, source, date, image).

## `country` (type: `string`):

Local results and language for this country. Worldwide gives global web results; news uses the US edition.

## `timeRange` (type: `string`):

Only results from this recent period. Past hour works for news (web uses past 24 hours), past year works for web (news uses any time).

## `maxPagesPerQuery` (type: `integer`):

Web results only. About 10 results per page, up to 5 pages per query. Stops early when there are no more results.

## `maxNewsPerQuery` (type: `integer`):

News only. Up to 30 articles per query.

## `readTopResults` (type: `integer`):

Web results only. Also open the top 1-5 results of each query and add their main content as clean Markdown or text (charged as page read instead of search result). 0 = off.

## `contentFormat` (type: `string`):

Format of the page content when reading top results.

## `maxContentChars` (type: `integer`):

Cut each page's content at this many characters (500-50,000).

## `safeSearch` (type: `string`):

Adult content filter for web results.

## Actor input object example

```json
{
  "queries": [
    "best open source vector database"
  ],
  "mode": "web",
  "country": "all",
  "timeRange": "any",
  "maxPagesPerQuery": 1,
  "maxNewsPerQuery": 20,
  "readTopResults": 0,
  "contentFormat": "markdown",
  "maxContentChars": 8000,
  "safeSearch": "moderate"
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

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

No description

# 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": [
        "best open source vector database"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("extraordinary_grasshopper/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": ["best open source vector database"] }

# Run the Actor and wait for it to finish
run = client.actor("extraordinary_grasshopper/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": [
    "best open source vector database"
  ]
}' |
apify call extraordinary_grasshopper/web-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,extraordinary_grasshopper/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/21X4gldGrhW4TEQ6b/builds/WrwF3M1vRjJA6l3ra/openapi.json
