← ContentsClaude API · advanced

Web search tool (API)

The web search tool is a built-in, server-side API feature that gives Claude autonomous access to live web content during inference. Unlike custom function-calling tools that require developers to write their own search or scraping logic, this tool runs entirely on Anthropic's infrastructure. When included in an API request, Claude decides when to issue searches based on the prompt, Anthropic's servers execute the queries and retrieve web content, and Claude synthesizes the results into a final response with cited source URLs — all within a single API turn. The tool operates as what Anthropic calls a 'server tool,' meaning the client application never needs to handle intermediate tool-use round trips for the search itself. Claude can issue multiple searches during one request, filter and reason over results, and return a coherent answer with citations. This makes it suitable for any use case where Claude's training knowledge cutoff would otherwise limit accuracy: current events, live pricing, recent documentation updates, regulatory changes, and more. As of early 2026, the latest tool version (web_search_20260209) adds dynamic filtering, where Claude can write and execute code server-side to pre-filter retrieved HTML before it enters the context window. This reduces token consumption and improves response accuracy compared to the earlier version (web_search_20250305), which passed full HTML into context without pre-filtering.

When you’d use it

  • Real-time financial data retrievalA fintech application needs to provide users with current stock prices, P/E ratios, and recent earnings summaries. Because these figures change daily, static training data is unreliable. The web search tool lets Claude pull live data from financial sites and cite the source so users can verify the figures.
  • Domain-restricted documentation assistantA developer tools company wants Claude to answer questions using only their official docs site (docs.example.com). By setting allowed_domains to that subdomain, they get a highly accurate documentation assistant without building and maintaining a custom RAG vector database or chunking pipeline.
  • Legal and regulatory researchA legal tech platform needs Claude to surface recent court decisions, newly enacted regulations, or agency guidance that postdate its training cutoff. Web search lets the platform build a research tool that always reflects the current regulatory landscape, with citations back to primary sources.
  • Competitive intelligence and market researchA business intelligence agent needs to enrich a list of companies with current funding rounds, product launches, and executive changes. The tool can be combined with batch processing or agentic loops to research dozens of entities in a single pipeline, grounding summaries in live sources.
  • SEC filing and earnings analysisA financial research agent needs to ground earnings analysis and due-diligence workflows in primary SEC filings rather than summaries. The web search tool returns structured SEC filing data, allowing the agent to cite specific filings with direct URLs rather than relying on potentially outdated or paraphrased secondary sources.

What changed recently

  • 2025-09-10Web search tool launched on the Anthropic API as a new server-side tool, giving Claude access to current information from the web with automatic citation generation. Initial tool version identifier: web_search_20250305.
  • 2025-11-04Web search tool and programmatic tool calling moved to general availability; the beta header is no longer required for API requests.
  • 2026-01-20Programmatic tool calling launched for code_execution_20260120, enabling models to script multi-tool orchestration workflows without client round-trips for each iteration.
  • 2026-02-09New tool version web_search_20260209 released with dynamic filtering support. Claude can now write and execute server-side code to pre-filter retrieved HTML before it enters the context window, reducing token consumption and improving accuracy. Supported on Claude Opus 4.7, Claude Opus 4.6, Claude Sonnet 4.6, and Claude Mythos Preview. Previous version web_search_20250305 remains available without dynamic filtering.
This is the short version

The full chapter has three worked examples, the common pitfalls, and the workflow that makes it pay — plus the other 84 features, kept current.

Get Claude Master — $97
CLAUDEMASTER
An independent publication.
Independent product. Not affiliated with or endorsed by Anthropic. “Claude” is a trademark of Anthropic, used here only to describe the subject of this manual.
© 2026 Claude Master — All rights reserved.