The
search_domain_filter parameter allows you to limit search results to specific domains or exclude certain domains from search results. This supports domain-level filtering for precise content control.Domain filters allow you to specify which domains to include or exclude in search results. You can filter by specific domains, top-level domains (TLDs), or domain parts. You can specify up to 20 domains per request. Domains should be provided without the protocol (e.g., “nature.com” not “https://nature.com”).
Overview
The domain filter for the Search API allows you to control which sources appear in your search results by limiting them to specific domains or excluding certain domains. This is particularly useful when you need to:- Focus research on authoritative or trusted sources
- Filter out specific domains from search results
- Search within specific publication networks or organizations
- Build domain-specific search applications
- Conduct competitive research within specific industry domains
search_domain_filter parameter accepts an array of domain strings. The filter operates in two modes:
- Allowlist mode: Include only the specified domains (no
-prefix) - Denylist mode: Exclude the specified domains (use
-prefix)
Filtering Capabilities
Domain filters support flexible matching across different domain components:Root Domain Filtering
Specify a root domain to match all content from that domain and its subdomains:en.wikipedia.orgfr.wikipedia.orgde.wikipedia.org- Any other Wikipedia language subdomain
Top-Level Domain (TLD) Filtering
Filter by top-level domain to target specific categories of sites:nasa.govcdc.govirs.gov- Any other
.govdomain
Domain Part Filtering
Any part of a domain can be used as a filter. The system will match domains containing that component.Examples
1. Allowlist Specific Domains This example limits search results to authoritative academic publishers: Request Example-):
Parameter Reference
search_domain_filter
- Type: Array of strings
- Format:
- Domain names without protocol (e.g., “example.com”)
- Prefix with
-for denylisting (e.g., “-reddit.com”)
- Description: Filters search results to include or exclude content from specified domains
- Optional: Yes
- Maximum: 20 domains per request
- Modes:
- Allowlist mode: Include only specified domains (no
-prefix) - Denylist mode: Exclude specified domains (use
-prefix)
- Allowlist mode: Include only specified domains (no
- Example:
- Allowlist:
"search_domain_filter": ["nature.com", "science.org"] - Denylist:
"search_domain_filter": ["-reddit.com", "-pinterest.com"]
- Allowlist:
Domain Format Guidelines
Correct Domain Formats:"nature.com"- Root domain (matches nature.com and all subdomains)"blog.example.com"- Specific subdomain"arxiv.org"- Root domain (matches all subdomains)".gov"- Top-level domain (matches all .gov sites)".edu"- Top-level domain (matches all .edu sites)".uk"- Country-code TLD (matches all .uk sites)"wikipedia.org"- Matches en.wikipedia.org, fr.wikipedia.org, etc."-reddit.com"- Exclude entire domain and all subdomains"-pinterest.com"- Exclude domain"-.gov"- Exclude all .gov domains
- ❌
"https://nature.com"- Don’t include protocol - ❌
"nature.com/"- Don’t include trailing slash - ❌
"nature.com/articles"- Don’t include path (path filtering coming soon) - ❌
"www.nature.com"- Avoid www prefix (use root domain)
Best Practices
Domain Selection Strategy
- Use Root Domains for Broad Coverage: Specify root domains (e.g., “wikipedia.org”) to match all subdomains automatically, including different language versions and regional sites.
- Use TLDs for Categorical Filtering: Target specific organization types with TLD filters like
.govfor government,.edufor education, or.orgfor non-profits. - Be Specific When Needed: Choose specific domains that are directly relevant to your search query to ensure high-quality results.
- Quality Over Quantity: Using fewer, highly relevant domains often produces better results than maximizing the 20-domain limit.
- Consider Domain Authority: Prioritize authoritative sources in your field for more reliable information.
- Choose Your Mode: Use either allowlist mode (include only) OR denylist mode (exclude), but not both in the same request. Denylisting is useful when you want broad search coverage but need to exclude specific low-quality or irrelevant sources.
Locale and Regional Targeting
While domain filters don’t directly filter by user location, you can target specific locales using:- Country-code TLDs: Use filters like
.uk,.ca,.de,.jpto target country-specific domains - Subdomain matching: Specify regional subdomains when available (e.g., “uk.domain.com”)
- Combined approach: Mix country TLDs with specific trusted domains for precise regional filtering
Domain Selection
- Use Trusted Sources: Select a specific set of trusted sources you want to search within (e.g., academic research, official documentation).
- Leverage TLD Filtering: When researching topics that span many sites of the same type, use TLD filters to cast a wider net (e.g.,
.govfor policy research). - Focus on Quality: Choose authoritative domains that consistently provide reliable information relevant to your queries.
Client-Side Validation
Validate domain formats on the client side before sending requests:Performance Considerations
- Result Availability: Narrowing to specific domains may reduce the number of available results. Be prepared to handle cases where fewer results are returned than requested.
- Domain Coverage: Ensure the domains you specify actually contain content relevant to your query. Overly restrictive filters may return zero results.
- Combination Effects: Domain filters combined with other restrictive filters (date, language) can significantly reduce result counts.