# Web Search API for AI Agents – Live Results (`publicrows/web-search-api`) Actor

Live web search for agents, RAG and research: send queries, get ranked results with title, URL, domain and snippet as clean JSON, any country and language. Licensed search data, no CAPTCHAs, no blocks, every answer checked against your query. $0.004 per 10-result search, first 10 results free.

- **URL**: https://apify.com/publicrows/web-search-api.md
- **Developed by:** [PublicRows](https://apify.com/publicrows) (community)
- **Categories:** AI, Agents, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.28 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/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 API for AI Agents – Live Results

Live web search for agents, RAG and research: send queries, get ranked results with title, URL, domain and snippet as clean JSON, any country and language. Licensed search data, no CAPTCHAs, no blocks, every answer checked against your query. $0.004 per 10-result search, first 10 results free.

### Who this is for

AI agents and LLM apps that need fresh web results to ground an answer, researchers running hundreds of queries at once, and developers who want a search API without managing keys or quotas: a query in, ranked results out, callable as an MCP tool.

### Sample output

```json
{
  "query": "best crm for small business",
  "rank": 2,
  "title": "10 Best Small Business CRM Software Of 2026 - Forbes",
  "url": "https://www.forbes.com/advisor/business/software/best-crm-small-business/",
  "domain": "www.forbes.com",
  "snippet": "2 days ago · To find the best small business CRMs, we evaluated 41 providers and ranked 33 features and tools that have the biggest impact on SMBs.",
  "breadcrumb": "https://www.forbes.com › advisor › business",
  "row_key": "best crm for small business|2",
  "source_url": "https://dataforseo.com/apis/serp-api"
}
```

### What you get

One row per page. Every row also carries `_source` (attribution) and the recipe version.

| Field | Type |
| --- | --- |
| `query` | string, always present |
| `rank` | number, always present |
| `title` | string, always present |
| `url` | url, always present |
| `domain` | string |
| `snippet` | string |
| `breadcrumb` | string |
| `row_key` | string, always present |
| `source_url` | string |

Results are Yahoo's organic web results for the country and language you pick, bought live from the licensed supplier on every run; ads and widgets are left out so the list is what an agent can cite.

Every answer is checked against your query before it becomes rows: if the results do not mention the query's words (a supplier mix-up), the search is asked again, so you never pay for another query's results.

Through MCP (mcp.apify.com) the actor is a tool an agent can call with `queries`; through the API it answers synchronously with run-sync-get-dataset-items.

Need Google instead? [SERP Rank Checker](https://apify.com/publicrows/serp-rank-checker) returns Google's top results with your domain's position.

### Pricing

Pay per page: $0.0004 each ($0.40 per 1,000). The first 10 rows of every run are free, so a test costs nothing.

**Launch price. From mid-January 2027 a result costs $0.0006 ($0.006 per 10-result search).**

### How to run

1. Keep the defaults for the standard sample, or set the inputs (listed last, below).
2. Run. Results land in the dataset as JSON, CSV or Excel.
3. From code or an agent: call it through the API, or as an MCP tool via mcp.apify.com.

### Source and fair use

Data: Yahoo web results through the DataForSEO SERP API, licensed. The data is bought from the supplier under its API terms on every run; nothing is scraped from any website. Rows are facts about pages, and no personal data of individuals is included.

### FAQ

**How fresh is the data?** Each run fetches live from the source.
**Can I get more fields?** Open an issue naming the field and where it appears at the source.
**Something broke?** Open an issue. Issues are answered within 12 hours.
**Found it useful?** A short review on this page helps other people find it, and tells us what to improve.

### Inputs

- `queries`: What to search, one query per line. Each line is one search.
- `location`: Country the results are for.
- `language`: Language of the results.
- `resultsPerQuery`: Results per query, 10 to 50.
- `sandbox`: Use the supplier's free test environment: dummy rows, nothing charged. For trying the inputs only.
- `dfsLogin`: Optional: your own DataForSEO API login, if you prefer the supplier charge on your account.
- `dfsPassword`: Optional: your own DataForSEO API password.
- `maxItems`: Stop after this many rows.

# Actor input Schema

## `queries` (type: `string`):

What to search, one query per line. Each line is one search.

## `location` (type: `string`):

Country the results are for.

## `language` (type: `string`):

Language of the results.

## `resultsPerQuery` (type: `integer`):

Results per query, 10 to 50.

## `sandbox` (type: `boolean`):

Use the supplier's free test environment: dummy rows, nothing charged. For trying the inputs only.

## `dfsLogin` (type: `string`):

Optional: your own DataForSEO API login, if you prefer the supplier charge on your account.

## `dfsPassword` (type: `string`):

Optional: your own DataForSEO API password.

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

Stop after this many rows.

## Actor input object example

```json
{
  "queries": "best crm for small business\npython list comprehension",
  "location": "2840",
  "language": "en",
  "resultsPerQuery": 10,
  "sandbox": false,
  "maxItems": 1000
}
```

# Actor output Schema

## `rows` (type: `string`):

Dataset items, one per page (query, rank, title, url, domain, snippet, breadcrumb, row_key, source_url). Append ?format=csv or ?format=xlsx for other formats.

## `runSummary` (type: `string`):

Pages fetched, response classes, cost estimate and the quality-gate checks for this run.

# 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 crm for small business
python list comprehension`,
    "location": "2840",
    "language": "en",
    "resultsPerQuery": 10,
    "maxItems": 1000
};

// Run the Actor and wait for it to finish
const run = await client.actor("publicrows/web-search-api").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 crm for small business
python list comprehension""",
    "location": "2840",
    "language": "en",
    "resultsPerQuery": 10,
    "maxItems": 1000,
}

# Run the Actor and wait for it to finish
run = client.actor("publicrows/web-search-api").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 crm for small business\\npython list comprehension",
  "location": "2840",
  "language": "en",
  "resultsPerQuery": 10,
  "maxItems": 1000
}' |
apify call publicrows/web-search-api --silent --output-dataset

```

## MCP server setup

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

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/IB4v2EFemmiGgghAa/builds/hPBBlh0brHr3S3UEU/openapi.json
