Can Claude web search be limited to specific domains?

The Citead team, updated

In short. Claude web search accepts an allowed or blocked domain list, with matching rules and additional restrictions depending on the API environment.

Definition: As of 17 October 2026, Anthropic documents API domain controls that restrict Claude web search results to an allowed list or exclude a blocked list. These settings belong to the search tool configuration in an application using Claude.

Key facts

How is a domain restriction configured?

An allowed list selects the domains eligible for results. A blocked list excludes named domains. Anthropic's web search tool definition places either setting on the tool object supplied in the API request.

This JSON fragment adapts the documented tool definition to restrict search to example.com:

{
  "tools": [
    {
      "type": "web_search_20250305",
      "name": "web_search",
      "allowed_domains": ["example.com"]
    }
  ]
}

For exclusion, the configuration replaces allowed_domains with blocked_domains. Entries use bare domains, optionally followed by a path, without https://. The fragment is a tool configuration; the complete request also supplies the model and messages shown in the same documentation.

Which URLs match a list entry?

Anthropic's domain filtering rules specify that example.com covers docs.example.com. Listing docs.example.com restricts results to that subdomain and excludes the parent domain and sibling api.example.com.

Web search supports paths: the documented example.com/blog example matches example.com/blog/post-1. A wildcard is permitted in the path, as in example.com/*/articles; a domain wildcard such as *.example.com is invalid. Invalid formats produce a 400 invalid_request_error.

The Managed Agents guide adds a hostname detail: www.example.com covers its own subdomains, while listing example.com covers both the bare domain and www.example.com.

How do organization and agent settings interact?

The Server tools guide requires a request's allowed_domains to fit within any organization-level allowed list configured in Claude Console. An entry outside that list causes a validation error. A request that allows an organization-blocked domain also receives a 400 error naming the conflict.

Anthropic's Managed Agents guide states that Console organization settings apply to Messages API requests only. Managed Agents sessions use lists on their agent toolset instead, with each list capped at 64 domains. An environment using limited networking additionally applies allowed_hosts, its permitted network hosts; the tool lists further restrict access within those hosts.

How can a filtered search be checked?

Anthropic's web search response documentation describes result blocks containing a source url and title. Inspecting these fields lets an application compare returned pages with the configured list. Citation objects separately identify cited source URLs. A successful search with no matches returns an empty content list.

FAQ

Can I use an allowed list and a blocked list together?

Choose one per tool configuration. The web search documentation specifies a 400 error when you submit both in the same request.

Does a search restriction also configure web fetch?

For Managed Agents, you configure each tool separately. The domain restrictions guide states that each tool carries its own list.

Can I restrict search to part of a website?

You can supply a path such as example.com/blog. For Managed Agents, Anthropic recommends plain hostnames because the search provider matches path suffixes as URL patterns.

Sources

  1. Anthropic, "Web search tool", undated
  2. Anthropic, "Server tools", undated
  3. Anthropic, "Restrict web search and web fetch domains", undated

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark