# web_search

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/tools/web_search)

Search the web for current information.

## Signature

```python
web_search(
    query: Annotated[str, Field(description='The search query (be specific and detailed).')],
    max_results: Annotated[int, Field(description='Number of results to return.')] = 5,
    topic: Annotated[Literal['general', 'news', 'finance'], Field(description='Search topic type: "general" for most queries, "news" for current events, or "finance".')] = 'general',
    include_raw_content: Annotated[bool, Field(description='Include full page content (uses more tokens). Prefer `fetch_url` for a single URL.')] = False,
)
```

## Returns

`null`

Search hits with title, URL, snippet, and score.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/3812967c84d90619848f3185f22470204fc88bd8/libs/code/deepagents_code/tools.py#L319)