Skip to content
AnswerWell geo Documentation

Research · 7 min read · Answerwell

Search Domain Filter: Allowlist, Path Rules, and Academic Sources

How API domain filters restrict web search to trusted hosts, block noisy sites, and target scholarly sources—with limits and date pairing.

This page summarizes Perplexity documentation on limiting web search to specific hosts—or excluding unwanted ones—through search_domain_filter and related controls. The same idea appears on the Search API, Agent API web_search tool, legacy Sonar, and the Perplexity CLI. If you need “only .gov” or “no Reddit” behavior in an automated research flow, these parameters are the lever—not wording alone in the user prompt.

search_domain_filter: what it does and where it lives

Section titled “search_domain_filter: what it does and where it lives”

search_domain_filter is an array of host strings (optionally with a path prefix) that tells the search backend which origins may contribute results. On the Search API you pass it on client.search.create; on the Agent API it sits under tools[].filters for web_search. Sonar chat completions accept the same field at the top level or in extra_body when using OpenAI-compatible clients.

The search_domain_filter parameter allows you to limit search results to specific domains (allowlist) or exclude certain domains (denylist) for focused research.

— Perplexity, Search API Quickstart

The Search Domain Filter reference and the Search Domain Filtering Patterns cookbook share one rule: each request uses either allowlist or denylist mode, never both.

Mode Syntax Effect
Allowlist nature.com, .gov (no - prefix) Only matching origins
Denylist -reddit.com, -.gov Drop matching origins; search the rest of the web

Hard limits from the Search API overview: up to 20 entries per request; domains without https://; do not mix allowlist and denylist strings in one array.

Allowlists fit when you already know trustworthy sources—major journals, agency sites, or your own documentation set. The cookbook’s news and government presets are allowlist-only lists such as reuters.com, apnews.com, and .gov (Search Domain Filtering Patterns).

Denylists fit when you want the open web minus a few noisy domains (forums, aggregators, competitors). Example from Search API Quickstart: ["-pinterest.com", "-reddit.com", "-quora.com"].

Keep allowlists focused. 5-10 domains is usually sufficient. Too many domains dilutes the filter’s purpose.

— Perplexity, Search Domain Filtering Patterns

On the CLI, allowlist maps to --domains and denylist to --excluded-domains; you cannot pass both in one invocation (Perplexity CLI).

How this compares to query-level site: filters

Section titled “How this compares to query-level site: filters”

Perplexity applies domain rules server-side on every result, independent of how the model phrases the query. That differs from typing site:example.com in a browser or Brave Web Search query, where the operator lives inside q (Brave Web Search, Google search operators).

Approach Where configured Typical use
search_domain_filter API request body / tool filters Agents, batch search, fixed source policy
site: in query Query string (q) One-off human or operator-driven searches

Common conclusion: APIs need explicit filter parameters so tools—not chat text—define the source boundary. Prompt-only “please use Nature.com” does not replace search_domain_filter; for time windows, Agent API story timeline notes that date filters decide which pages the search tool sees, while the prompt only shapes synthesis.

Brave Goggles use a separate rule file ($boost, $downrank, $discard on site=) to rerank results rather than a single allowlist array—useful for ranking tweaks, not a drop-in substitute for Perplexity’s 20-entry filter list.

Root domains match the registrable host and subdomains. TLD entries such as .gov or .edu match every site in that suffix (Search Domain Filter).

Filter by top-level domain to target specific categories of sites: “search_domain_filter”: [“.gov”]

— Perplexity, Search Domain Filter

Path prefixes narrow one vertical on a site: nature.com/articles matches /articles and subpaths, not nature.com/news. Denylisting works too: -reddit.com/r/all excludes a subcommunity while searching the rest of Reddit (Search Domain Filtering Patterns).

Format pitfalls from the same guide:

  • Wrong: https://nature.com (protocol), *.gov (wildcards—not supported; use .gov)
  • Prefer root nature.com over www.nature.com

Agent API web_search also accepts full URLs for granular allowlists (Web Search tool).

Two complementary paths appear in Perplexity docs.

The Academic and Scholarly Search cookbook sets search_domain_filter on web_search to targets such as arxiv.org, pubmed.ncbi.nlm.nih.gov, nature.com, science.org, .edu, scholar.google.com, and semanticscholar.org.

Use the Agent API’s domain filtering to restrict search to academic sources, extract DOIs and paper metadata, build citation chains, and create research summaries with proper attribution

— Perplexity, Academic and Scholarly Search

Field-specific lists (biomedical vs computer science vs social science) swap the allowlist per discipline (Academic and Scholarly Search). Pair the filter with instructions that demand author names, years, and a references section so answers stay attributable.

The changelog adds search_mode: "academic" on Sonar POST requests to prioritize peer-reviewed and research publications—composable with web_search_options such as search_context_size.

By setting search_mode: “academic” in your API requests, you can now prioritize results from peer-reviewed papers, journal articles, and research publications.

— Perplexity, Changelog

Use the cookbook allowlist when you need explicit control over which repositories count; use search_mode: "academic" when you want a built-in scholarly bias on Sonar without maintaining a domain list.

Combining domain filters with date and recency

Section titled “Combining domain filters with date and recency”

Domain filters stack with other Search API parameters (Search API overview, Date and Time Filters).

Parameter Role
search_recency_filter Relative window: hour, day, week, month, year
search_after_date_filter / search_before_date_filter Publication bounds, MM/DD/YYYY
last_updated_after_filter / last_updated_before_filter Last-modified bounds, same date format
search_language_filter Up to 20 ISO 639-1 codes (language filter)
country Regional relevance (Search API / CLI)

News-style allowlists plus search_recency_filter: "day" are documented in Search Domain Filtering Patterns. Legacy Sonar examples combine search_domain_filter with search_recency_filter: "month" via OpenAI SDK compatibility.

For Agent web_search, publication and last-updated filters use MM/DD/YYYY inside filters (Web Search tool).

Agent API, Search API, and Sonar: same filter, different envelopes

Section titled “Agent API, Search API, and Sonar: same filter, different envelopes”
Surface How you set search_domain_filter
Search API Top-level on POST /search (quickstart)
Agent API tools: [{ type: "web_search", filters: { search_domain_filter: [...] } }] (web search tool)
Sonar (Python SDK) Argument on chat.completions.create (Sonar filters)
OpenAI client + Perplexity base URL extra_body.search_domain_filter or tool filters (OpenAI compatibility)
LangChain filters inside web_search tool config (LangChain integration)

Deep research flows combine domain allowlists (for example .gov, .edu, who.int) with long-form instructions (Async Deep Research). image_search uses a parallel domain_filter name with the same allowlist/denylist rule (max 10 domains)—do not confuse it with search_domain_filter on web_search.

Common mistakes and verification checklist

Section titled “Common mistakes and verification checklist”

Mistakes:

  1. Mixing -reddit.com with nature.com in one array.
  2. Sending an empty search_domain_filter: [] instead of omitting the field (Search Domain Filtering Patterns).
  3. Over-constraining: domain + language + tight dates can return fewer hits than max_results (Search Domain Filter).
  4. Relying on the prompt for source or week boundaries when the tool needs search_after_date_filter / search_before_date_filter (story timeline cookbook).
  5. Using search_recency_filter together with explicit date filters in one request (Date and Time Filters).

Quick verification: run the same query with and without filters; allowlists should drop off-domain URLs in results or citations (Search Domain Filtering Patterns).

from perplexity import Perplexity
client = Perplexity()
search = client.search.create(
query="IPCC AR6 synthesis report key findings",
search_domain_filter=["science.org", "pnas.org", "cell.com"],
max_results=10,
)

The same shape appears in Search API Quickstart.

  1. Call the Search API with your production query twice—once with no search_domain_filter, once with your allowlist or denylist—and confirm every returned url host matches your policy.
  2. If you use agents, inspect web_search tool filters in a Agent API request and verify citations in the response align with the configured domains (Web Search tool).
  3. For command-line checks, run Perplexity CLI pplx search web with --domains or --excluded-domains (not both) and compare result hosts to an unfiltered run.
  4. When combining time bounds, validate date strings as MM/DD/YYYY per Date and Time Filters and avoid mixing search_recency_filter with explicit date filters in one request.
  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page conflicts with current Perplexity API behavior, email yimasynthetic@gmail.com with the page URL, the statement you question, and any request IDs or sample responses you can share.