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

# WebRouter Search

> Search the web on Nimble or any search provider, with one request and one response shape

> [!NOTE]
>
> **WebRouter is in closed beta.** It's available to selected accounts, and the API may still change. To get access, [talk to the Nimble team](https://nimbleway.com/contact-general/).

WebRouter **Search** finds pages for a query and returns ranked results with titles, links, descriptions, and page text. Nimble picks the provider for each call, and every answer comes back in one response shape.

Search answers within seconds and costs little. Call it freely, and again with a better query. Use [Extract](https://docs.nimbleway.com/nimble-sdk/web-router/extract.md) to read a page you already have the URL of. For Nimble's own search API, with every Nimble option, see [Search](https://docs.nimbleway.com/nimble-sdk/web-tools/search.md).

## Quick Start

### Example Request

```python Python theme={"system"}
import requests

response = requests.post(
    "https://sdk.nimbleway.com/v2/web-router/search",
    headers={"Authorization": "Bearer YOUR-API-KEY"},
    json={"query": "how to read a CSV file in Python", "max_results": 2},
)

for result in response.json()["result"]["results"]:
    print(result["title"], result["url"])
```

```typescript TypeScript theme={"system"}
const response = await fetch("https://sdk.nimbleway.com/v2/web-router/search", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR-API-KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ query: "how to read a CSV file in Python", max_results: 2 }),
});

const { result } = await response.json();
for (const item of result.results) {
  console.log(item.title, item.url);
}
```

```bash cURL theme={"system"}
curl -X POST 'https://sdk.nimbleway.com/v2/web-router/search' \
--header 'Authorization: Bearer <YOUR-API-KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "query": "how to read a CSV file in Python",
    "max_results": 2
}'
```

### Example Response

```json theme={"system"}
{
  "meta": { "tool": "search" },
  "result": {
    "provider": "nimble_selection",
    "byok": false,
    "query": "how to read a CSV file in Python",
    "results": [
      {
        "url": "https://realpython.com/python-csv/",
        "title": "Reading and Writing CSV Files in Python - Real Python",
        "description": "Reading and Writing CSV Files in Python. What Is a CSV File?...",
        "content": "Reading and Writing CSV Files in Python. What Is a CSV File?...",
        "score": null,
        "published_date": "2026-10-22T14:00:00.000Z",
        "extra": {}
      }
    ],
    "answer": null
  }
}
```

`result.provider` is `nimble_selection`: Nimble picked the provider. See [Providers](https://docs.nimbleway.com/nimble-sdk/web-router/overview.md#providers).

## How it works

**1. You send a query**

Add options such as `max_results` or `search_depth` when you need them.

**2. Nimble picks the provider**

Your own provider keys first, then Nimble's. A provider that cannot serve an option you set is
skipped. A provider that fails, or returns no results, falls through to the next.

**3. Results come back normalized**

Every provider's results share one shape: `url`, `title`, `description`,
`content`, `score`, and `published_date`. Provider-specific fields stay in `extra`.

## Parameters

> [accordion] query - Required
>
> **query** `string` *required*
>
> The search query.
>
> **Example:** `how to read a CSV file in Python`

> [accordion] max\_results
>
> **max\_results** `integer` (default: 10)
>
> Upper bound on results returned. From 1 to 100.

> [accordion] search\_depth
>
> **search\_depth** `string`
>
> How much page content to retrieve. Unset is the provider's own default.
>
> **Options:**
>
> * `lite`: links and descriptions
> * `fast`: a truncated page body
> * `deep`: the full page, so results are large

> [accordion] include\_domains / exclude\_domains
>
> **include\_domains** `array of strings`
>
> Restrict results to these domains. Up to 50.
>
> **exclude\_domains** `array of strings`
>
> Drop results from these domains. Up to 50.

> [accordion] country / locale
>
> **country** `string`
>
> Country code for geo-targeting, such as `US`.
>
> **locale** `string`
>
> Language code, such as `en`.

> [accordion] include\_answer
>
> **include\_answer** `boolean`
>
> Also return an answer to the query, in `result.answer`. Only Nimble answers: a search another provider serves comes back without one.

> [accordion] optimized\_for
>
> **optimized\_for** `string` (default: balanced)
>
> What Nimble favors when it picks the provider.
>
> **Options:** `speed`, `cost`, `coverage`, `balanced`

## Next Steps

> [card] [Extract](https://docs.nimbleway.com/nimble-sdk/web-router/extract.md)
>
> Read the pages a search found

> [card] [API Reference](https://docs.nimbleway.com/api-reference/webrouter/search.md)
>
> Every field of the request and response


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