Skip to content
SearchBrave Search API5 credits

search_web

A live web index, as JSON. Results come from the Brave Search API's independent web index. Each result carries the title, URL, snippet and a highlighted copy of the snippet, alongside a metadata block that says how long the search took. Site and file-type filters are applied as search operators; language, recency and safe search are passed as search filters.

Use Cases

Research Pipelines

Find sources for a topic, then feed the URLs straight into batch_scrape or extract_content.

Site-Scoped Search

Set site to search inside one domain — a substitute for a site search box that does not exist or works badly.

Document Hunting

Combine file_type with a query to find PDFs, spreadsheets or slide decks on a subject.

Recency Monitoring

Restrict to the last day or week with time_range to catch new coverage of a topic or a brand.

Competitive Discovery

See which pages a live web search surfaces for the terms you care about. For your exact Google position, use serp_rank.

Agent Grounding

Give a model current search results to work from, instead of relying on what it memorised.

Endpoint

POST/api/v1/tools/search_web
Auth Required
1 req/s on Free plan
5 credits

Parameters

NameTypeRequiredDefaultDescription
query
stringOptional-
The search terms. Operators such as `site:`, `filetype:` and quoted phrases work as they do in a search box, and `site` and `file_type` are appended as operators on top. Send exactly one of `query` or `queries`.
Example: mcp server for web scraping
queries
string[]Optional-
Between 1 and 10 search queries to run in one call, instead of `query`. Each one runs the same pipeline a single search does, and the payloads come back in `results_by_query` — a list in the order you sent them, one entry per query carrying its own `query` plus that search's fields, or `query` and `error` when that one search failed. `queries` echoes your input and `count` is its length. A `search_web` call costs 5 credits for every query that returned results — a single `query` costs 5, and a `queries` batch is projected at 5 × the number of queries sent, which is a ceiling: each query that failed is not charged, so a batch in which none succeeded costs nothing. A query repeated in the list runs twice and is charged twice when both runs return results. A batch in which none succeeded is still a **200** carrying the normal envelope: `count` as sent, one `{ query, error }` entry per query, and `credits_used: 0`. Send exactly one of `query` or `queries` — both, or neither, is a 400.
Example: ["mcp server for web scraping", "model context protocol tools"]
limit
numberOptional10
Results to return, 1-100 — but a single request is capped at 10, so anything above 10 behaves as 10.
Example: 10
offset
numberOptional0
Zero-based index of the first result. Use 10, 20, 30 to page, up to 90: results past the 100th are not available, and a page beyond them comes back with an empty `results` array. Each page is a separate search and costs 5 credits.
Example: 10
lang
stringOptional-
Prefer documents in one language, as an ISO 639-1 code; regional forms such as `zh-TW` and `pt-BR` are accepted too. It is a preference, not a strict filter, so pages in other languages can still appear, and a code the search backend does not support is dropped rather than failing the search. Echoed back in `search_metadata.lang`, which defaults to `en` when you omit it.
Example: es
site
stringOptional-
Limit to one domain. Appended to your query as `site:<domain>`, so it behaves exactly like typing it.
Example: docs.anthropic.com
safe_search
booleanOptional-
Turn on strict safe-search filtering. Off unless you set it.
Example: true
time_range
stringOptional-
Restrict by recency: `day`, `week`, `month`, `year` or `all`. `all` applies no restriction, which is also the default.
Example: week
file_type
stringOptional-
Limit to one file extension. Appended as `filetype:<ext>`, so `pdf`, `xlsx` and `pptx` all work.
Example: pdf
redact_pii
boolean | objectOptionalfalse
Remove personal data from the text this call returns, before the result is stored or sent back. Applies to the titles and snippets the search returns; the `query` you sent is echoed back untouched. `true` is shorthand for `{ mode: "fast" }` — all four regex classes, tagged. Whenever you ask for redaction the response carries `redaction: { entities, count, mode }` inside `data`, even when nothing matched (`count: 0`), so "found nothing" is never mistaken for "the parameter was ignored"; a class with no hits is left out rather than reported as `0`. Redaction runs **before** the result is stored, so an oversized result read back later with [read_result](/docs/api-reference/tools/read-result) is already redacted. Two deliberate limits: addresses (`url`, `link`, `href`, `canonical_url`) are never redacted, and counters derived from the text (`content_length`, `word_count`, `character_count`) describe it as extracted, before redaction.
Example: true
max_inline_chars
numberOptional40000
Largest result to return inline, in characters of its JSON (1,000-10,000,000). Over it the response carries `preview` (the first `max_inline_chars` characters of the pretty-printed JSON), `result_handle`, `total_chars`, `truncated: true` and `expires_at`, and [read_result](/docs/api-reference/tools/read-result) reads the rest for 1 credit per call. Stored results are kept for 1 hour.
Example: 40000

Batch Search

Send queries instead of query to run up to 10 searches in one call. Each query is the same single search a query call runs — this API does no query expansion, caching, deduplication or re-ranking — and each query that returned results is charged 5 credits.

terminalBash
curl -X POST https://crawlforge.dev/api/v1/tools/search_web \
  -H "X-API-Key: cf_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "queries": [
      "mcp server for web scraping",
      "model context protocol tools"
    ],
    "limit": 10,
    "redact_pii": true
  }'

Batch Response

results_by_query is a list in the order you sent the queries, one entry per query, so a repeated query appears twice. A query that failed carries error in place of its results and is not charged; the call returns 200 either way, including when every query failed, so credits_used is the count that actually succeeded times 5. A single-query call is unchanged: none of queries, count or results_by_query appears in it.

response.jsonJson
{
  "success": true,
  "data": {
    "queries": ["mcp server for web scraping", "model context protocol tools"],
    "count": 2,
    "results_by_query": [
      {
        "query": "mcp server for web scraping",
        "search_metadata": { "total_results": null, "results_returned": 10 },
        "results": [
          {
            "title": "CrawlForge MCP Server",
            "url": "https://www.crawlforge.dev/",
            "snippet": "Write to <EMAIL> for access."
          }
        ]
      },
      {
        "query": "model context protocol tools",
        "error": "Search request timeout"
      }
    ],
    "redaction": { "entities": { "EMAIL": 1 }, "count": 1, "mode": "fast" }
  },
  "credits_used": 5,
  "credits_remaining": 995,
  "processing_time": 720
}

Request Examples

terminalBash
curl -X POST https://crawlforge.dev/api/v1/tools/search_web \
  -H "X-API-Key: cf_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "mcp server for web scraping",
    "limit": 10,
    "time_range": "month",
    "safe_search": true
  }'

Response Example

200 OK460ms
{
"success": true,
"data": {
"query": "mcp server for web scraping",
"search_metadata": {
"total_results": null,
"results_returned": 1,
"offset": 0,
"search_time": 0.312,
"lang": "en",
"safe_search": false,
"time_range": "month",
"site": null,
"file_type": null
},
"results": [
{
"title": "CrawlForge MCP Server — 31 web tools for Claude",
"url": "https://www.crawlforge.dev/",
"snippet": "Search, scrape, crawl and extract from any site through one MCP server.",
"displayLink": "www.crawlforge.dev",
"formattedUrl": "https://www.crawlforge.dev/",
"htmlSnippet": "Search, scrape, crawl and extract from any site through one MCP server.",
"htmlTitle": "CrawlForge MCP Server — 31 web tools for Claude",
"pagemap": {
"cse_thumbnail": [
{
"src": "https://imgs.search.brave.com/example-thumbnail"
}
],
"metatags": [
{
"article:published_time": "2026-10-01T00:00:00"
}
]
}
}
],
"spelling_correction": null,
"related_searches": []
},
"credits_used": 5,
"credits_remaining": 995,
"processing_time": 460
}
Field Descriptions
data.queryThe query that was searched, as you sent it, with any `site` and `file_type` operators left off
data.search_metadata.total_results`null`: the search backend does not report a total match count. Page with `offset` until `results_returned` is 0
data.search_metadata.results_returnedLength of `results` — at most 10
data.search_metadata.search_timeSeconds the upstream search took, measured by CrawlForge. Not your request's total latency
data.results[].urlThe destination link. `formattedUrl` carries the same address
data.results[].htmlSnippetThe snippet with the search engine's `<strong>` term highlighting left in. Escape it before rendering
data.results[].pagemapPage details when the search engine has them: `cse_thumbnail[0].src` (a thumbnail URL) and `metatags[0]['article:published_time']` (the page's age). Absent when there is neither
data.spelling_correctionThe corrected query when the search engine searched a corrected spelling, or `null`
data.related_searchesAlways an empty array: the current search backend returns no related searches. Kept so existing code does not break
credits_usedFixed 5 credits per search, whatever `limit` you asked for

Error Handling

Invalid Query (400 Bad Request)

VALIDATION_ERROR. query is required and must not be empty. The same status covers a limit outside 1-100, a negative offset, or a time_range that is not one of the five accepted values. Sending both query and queries, or neither, is the same 400, as is a queries array that is empty or holds more than 10 entries, a redact_pii object naming an entity this API cannot redact, or redact_pii with mode: "model" — which needs an LLM this API does not run.

Search Failed (500 Internal Server Error)

TOOL_ERROR. Covers an upstream search error, a rate limit at the search provider, and a timeout after 10 seconds. The message names the cause. Nothing is charged for a failed search. This is the single-query path: one failing search errors as it always has. A queries batch never reaches here — a failed query is reported inside its own results_by_query entry and the call still returns 200, even when every query failed.

Credit Cost

5 credits
5 credits per search
One search is one charge, whether it returns 10 results or none. Paging with offset means another search, so ten pages cost 50 credits. Failed searches are not charged. A search_web call costs 5 credits for every query that returned results — a single query costs 5, and a queries batch is projected at 5 × the number of queries sent, which is a ceiling: each query that failed is not charged, so a batch in which none succeeded costs nothing. Ten queries in one call are projected at 50 and cost 50 only if all ten returned results. redact_pii in its default fast mode adds nothing.

What's Included:

A live web index (Brave Search API), not a cached copy

Title, URL, snippet and a highlighted copy of the snippet

Search time, plus thumbnail and page age when available

site, file_type, lang, time_range and safe-search filters

Spelling correction when the search engine applied one

Plan Recommendations:

Free Plan: 1,000 one-time trial credits = 200 searches

Hobby Plan: 5,000 credits = 1,000 searches ($19/mo)

Professional Plan: 100,000 credits = 20,000 searches ($99/mo)

Related Tools