Home › Claude API lesson 2: Web search, JSON

Claude API lesson 2: Web search, JSON

Last checked

The web search tool gives Claude current web content with cited sources, and structured outputs make its reply match your JSON schema so code can use it directly.

Step by step

  1. Add the web search tool to the tools list of your request (for example type web_search_20250305 for basic search).
  2. Show users the citations included in the response.
  3. Use domain controls to allow or block particular sites.
  4. For JSON, set output_config.format with your schema.
  5. For tools, add strict: true to guarantee tool names and inputs match the schema.

Try it: examples

Good to know

Sources (official pages, read Nov 8, 2026)

Written from Anthropic's official documentation and product pages; we don't run hands-on tests. Features and limits vary by plan and country.

Report an error on this page