# Web Search Reader: results + clean page text (FR/CA by default) (`tolca/web-search-reader`) Actor

One search, done: 10 web results plus the clean text of the top pages (title, text, sha256, fetch time). French/Canada by default, official-sources mode (.gc.ca, .gouv.qc.ca, .gov, CanLII). No charge when a query returns nothing.

- **URL**: https://apify.com/tolca/web-search-reader.md
- **Developed by:** [Yasser Boughazli](https://apify.com/tolca) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 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 Reader: results + clean page text

One search, done. For each query you get **10 web results** (title, URL, snippet, age) **plus the clean text of the top pages** (default 3, up to 5), each with its title, character count, sha256 and fetch time. Built for research agents, RAG pipelines and anyone who is tired of opening ten tabs.

- **French / Canada by default.** Language is detected from the query; country ranking defaults to CA. Both are adjustable.
- **Official-sources mode.** Keep only government, court and regulator sites (.gc.ca, .gouv.qc.ca, .gov, CanLII, SOQUIJ, SEC...).
- **Freshness filter** (24 h, 7 days, 30 days) and **site restriction** (e.g. `hydroquebec.com`).
- **Clean text, not HTML.** Navigation, footers and forms are stripped; you get the article body, capped at the length you choose.
- **A query with zero results is not charged.**

### Output (one item per query)

| Field | What it is |
|---|---|
| `query`, `lang`, `country`, `official`, `freshness` | What was searched and how |
| `count`, `results[]` | Up to 10 results: `rank`, `title`, `url`, `snippet`, `age`, `official` |
| `pages[]` | Clean text of the top pages: `url`, `title`, `text`, `chars`, `truncated`, `sha256`, `fetched_at`, `read_ms` |
| `pages_skipped[]` | Pages that could not be read (blocked, timeout) |
| `took_ms` | Total time for the query |

### Typical uses

- Feed an LLM with fresh, cited context in one call instead of search + scrape + clean.
- Monitor a topic (grants, regulations, tenders) with the 7-day freshness filter.
- Research Québec and Canadian questions where official sources matter.

### Also available

The same engine is sold pay-per-call to AI agents over x402 (USDC on Base) at `https://tolca.tonbot.ca/v1/web-search`, and as an MCP server at `https://tolca.tonbot.ca/mcp`. Company and Québec contractor checks by the same publisher: [Business Verification](https://apify.com/tolca/business-verification), [Québec Contractor Check](https://apify.com/tolca/quebec-contractor-check).

# Actor input Schema

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

One search per line (2 to 300 characters each).

## `read` (type: `integer`):

How many of the top results to open and convert to clean text (0 to 5).

## `official` (type: `boolean`):

Keep only government, court and regulator sites (.gc.ca, .gouv.qc.ca, .gov, CanLII, SOQUIJ, SEC...).

## `lang` (type: `string`):

Auto detects the language from the query.

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

Two-letter country code used to rank results (CA, US, FR...).

## `freshness` (type: `string`):

Only return pages published or updated within this window.

## `site` (type: `string`):

Optional domain, e.g. hydroquebec.com

## `max_chars` (type: `integer`):

Length cap for the clean text of each page read (1000 to 20000).

## Actor input object example

```json
{
  "queries": [
    "subvention thermopompe Québec 2026",
    "RBQ licence requirements general contractor"
  ],
  "read": 3,
  "official": false,
  "lang": "auto",
  "country": "CA",
  "freshness": "none",
  "max_chars": 6000
}
```

# Actor output Schema

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

Dataset items: query, count, results\[] (rank, title, url, snippet, age, official) and pages\[] (url, title, text, chars, sha256, fetched_at, read_ms).

# 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": [
        "subvention thermopompe Québec 2026",
        "RBQ licence requirements general contractor"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tolca/web-search-reader").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": [
        "subvention thermopompe Québec 2026",
        "RBQ licence requirements general contractor",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("tolca/web-search-reader").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": [
    "subvention thermopompe Québec 2026",
    "RBQ licence requirements general contractor"
  ]
}' |
apify call tolca/web-search-reader --silent --output-dataset

```

## MCP server setup

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

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/9c1qvLaQrH4cOfnPr/builds/Hz0qMLvr44HDk7l5F/openapi.json
