How can domains be excluded from OpenAI API web search?

The Citead team, updated

In short. Use blocked_domains inside the Responses API web_search tool's filters object to exclude named domains from a search request.

Definition: blocked_domains is a domain filter inside the filters object of the Responses API web_search tool. It lets an API request name domains that the web search configuration should leave out, using host names without an HTTP or HTTPS prefix.

Key facts

  • OpenAI's web search documentation says the filters parameter supports up to 100 allowed_domains or up to 100 blocked_domains.
  • The same documentation says to omit the HTTP or HTTPS prefix when formatting a domain, such as openai.com rather than https://openai.com/.
  • OpenAI says the domain filtering approach also includes subdomains in the search.
  • Domain filtering is documented only for the Responses API with the web_search tool.
  • OpenAI's Responses API reference describes filters as an optional object on the web search tool.

How do I add blocked domains to a request?

Put blocked_domains inside filters, which is inside the web search tool definition. The guide's example combines an allowed list with three blocked domains:

{
  "type": "web_search",
  "filters": {
    "blocked_domains": ["reddit.com", "quora.com", "wikipedia.org"]
  }
}

Each array item is a domain name. The documented format uses example.com, without https:// and without a path. The guide permits up to 100 entries in blocked_domains, so a longer exclusion list must be reduced to that documented limit.

Which API supports this setting?

OpenAI places domain filtering in the Responses API's hosted web_search tool. Its guide states that domain filtering is available only there, even though the same page also describes web search in some Chat Completions cases. The API reference identifies the tool type as web_search or web_search_2025_08_26 and describes filters as optional search configuration.

This scope matters when comparing request formats. A Chat Completions request that uses a specialized search model is a different path from a Responses request containing a web_search tool and its filters object.

The web search guide documents a sources field for viewing all URLs retrieved during a web search. It says this list is complete for the URLs the model consulted, while inline citations show only the most relevant references. The guide's example requests the source list with this option:

{
  "include": ["web_search_call.action.sources"]
}

The API reference describes external_web_access separately: when omitted, live internet access defaults to true; when set to false, the tool runs in offline or cache-only mode. That setting controls access mode, while blocked_domains controls domain filtering.

FAQ

Can I use blocked_domains in Chat Completions?

OpenAI documents domain filtering only with the Responses API web_search tool. Chat Completions search models follow a separate request path.

Should a blocked domain include https://?

No. The web search guide says to omit the HTTP or HTTPS prefix and use the domain name itself.

Are subdomains covered?

OpenAI says the domain filtering approach includes subdomains in the search. The documentation does not give a separate matching rule for a blocked parent domain and each subdomain.

Sources

  1. OpenAI, "Web search", n.d.
  2. OpenAI, "Create a model response", n.d.

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