> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindcase.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Search API

> Search the web for AI agents: ranked results with a page-text excerpt for each one, the published date when the page has one, and the domain. One result set per query, ready to drop into a prompt.

`POST /v1/data/web/search/run`

**Pricing:** $0.001 per result ($1.00 per 1,000).

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**query** `string[]` *required*

One or more search queries, written the way you would ask a search engine. Each query returns its own ranked results.

**maxResults** `integer` (default: 10)

How many results to return for each query, up to 20. Defaults to 10; use 0 for the maximum of 20.

Min `0`; max `20`.

**country** `string`

Two-letter country code to localise results to, e.g. us, in or gb. Leave blank for no country preference.

**freshness** `string` (default: any)

Only return pages published within this window. Pages with no published date are kept.

Allowed values: `any` (Any time), `day` (Past day), `week` (Past week), `month` (Past month), `year` (Past year).

**includeDomains** `string[]`

Only return results from these domains (and their subdomains), e.g. reuters.com. Up to 20.

Format e.g. `stripe.com`.

**excludeDomains** `string[]`

Never return results from these domains (and their subdomains), e.g. pinterest.com. Up to 20.

Format e.g. `stripe.com`.

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/web/search/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "query": [
      "best open source vector database",
      "RBI repo rate decision"
    ],
    "maxResults": 5,
    "freshness": "year"
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/web/search/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "query": [
        "best open source vector database",
        "RBI repo rate decision"
    ],
    "maxResults": 5,
    "freshness": "year"
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/web/search/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "query": [
    "best open source vector database",
    "RBI repo rate decision"
  ],
  "maxResults": 5,
  "freshness": "year"
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one result, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `query` | Query | text |
| `position` | Position | integer |
| `title` | Title | text |
| `url` | URL | url |
| `domain` | Domain | text |
| `excerpt` | Excerpt | text |
| `publishedDate` | Published Date | date |
| `engine` | Engine | text |
| `fetchedAt` | Fetched At | datetime |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "web/search",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "publishedDate": null,
      "excerpt": "Best open source Vector Databases: ranked and compared\n\n8 open source Vector Databases rated criterion by criterion (Ease of use, Maturity & stability, Integ...",
      "position": 1,
      "url": "https://faun.dev/toolbox/compare-open-source-vector-databases",
      "title": "Best open source Vector Databases: ranked and compared",
      "engine": "primary",
      "fetchedAt": "2026-11-09T10:16:56.112206+00:00",
      "domain": "faun.dev",
      "query": "best open source vector database"
    }
  ]
}
```

## Related APIs

For Google's own ranking use [`google/search`](https://docs.mindcase.co/apis/google/search); for the full text of a result use [`web/scrape`](https://docs.mindcase.co/apis/web/scrape).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.