> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter-d02e98a0-mintlify-7021d5f4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# WebSearchPlugin - Python SDK

> WebSearchPlugin method reference

<Warning>
  The Python SDK and docs are currently in beta.
  Report issues on [GitHub](https://github.com/OpenRouterTeam/python-sdk/issues).
</Warning>

## Fields

| Field             | Type                                                                                           | Required             | Description                                                                                                                                    | Example                                                                                                                     |
| ----------------- | ---------------------------------------------------------------------------------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `enabled`         | *Optional\[bool]*                                                                              | :heavy\_minus\_sign: | Set to false to disable the web-search plugin for this request. Defaults to true.                                                              |                                                                                                                             |
| `engine`          | [Optional\[components.WebSearchEngine\]](../components/websearchengine.md)                     | :heavy\_minus\_sign: | The search engine to use for web search.                                                                                                       | exa                                                                                                                         |
| `exclude_domains` | List\[*str*]                                                                                   | :heavy\_minus\_sign: | A list of domains to exclude from web search results. Supports wildcards (e.g. "\*.substack.com") and path filtering (e.g. "openai.com/blog"). | \[<br />"example.com",<br />"\*.substack.com",<br />"openai.com/blog"<br />]                                                |
| `id`              | [components.WebSearchPluginID](/client-sdks/python/api-reference/components/websearchpluginid) | :heavy\_check\_mark: | N/A                                                                                                                                            |                                                                                                                             |
| `include_domains` | List\[*str*]                                                                                   | :heavy\_minus\_sign: | A list of domains to restrict web search results to. Supports wildcards (e.g. "\*.substack.com") and path filtering (e.g. "openai.com/blog").  | \[<br />"example.com",<br />"\*.substack.com",<br />"openai.com/blog"<br />]                                                |
| `max_results`     | *Optional\[int]*                                                                               | :heavy\_minus\_sign: | N/A                                                                                                                                            |                                                                                                                             |
| `max_uses`        | *Optional\[int]*                                                                               | :heavy\_minus\_sign: | Maximum number of times the model can invoke web search in a single turn. Passed through to native providers that support it (e.g. Anthropic). |                                                                                                                             |
| `search_prompt`   | *Optional\[str]*                                                                               | :heavy\_minus\_sign: | N/A                                                                                                                                            |                                                                                                                             |
| `user_location`   | [OptionalNullable\[components.UserLocation\]](../components/userlocation.md)                   | :heavy\_minus\_sign: | N/A                                                                                                                                            | `{"city": "San Francisco","country": "USA","region": "California","timezone": "America/Los_Angeles","type": "approximate"}` |
