1515class SourcePolicy (TypedDict , total = False ):
1616 """Source policy for web search results.
1717
18- This policy governs which sources are allowed/disallowed in results.
18+ Plain domains match that domain and its subdomains. Domain/path entries use
19+ case-sensitive path matching at segment boundaries; trailing slashes are ignored,
20+ dot segments are normalized, and other percent-encoded path spelling is preserved.
21+ Entries omit schemes, ports, query strings, and fragments. When include_domains is
22+ non-empty, it defines the complete allowlist and exclude_domains is ignored.
1923 """
2024
2125 after_date : Annotated [Union [str , date , None ], PropertyInfo (format = "iso8601" )]
@@ -26,19 +30,21 @@ class SourcePolicy(TypedDict, total=False):
2630 """
2731
2832 exclude_domains : SequenceNotStr [str ]
29- """List of domains to exclude from results.
33+ """List of domains or domain/path prefixes to exclude from results.
3034
31- If specified, sources from these domains will be excluded. Accepts plain domains
32- (e.g., example.com, subdomain.example.gov) or bare domain extension starting
33- with a period (e.g., .gov, .edu, .co.uk). The combined number of domains in
34- include_domains and exclude_domains cannot exceed 200.
35+ Applied only when include_domains is empty. If specified, matching sources will
36+ be excluded. Accepts plain domains (e.g., reddit.com), domain/path prefixes
37+ (e.g., youtube.com/shorts), or bare domain extensions (e.g., .gov, .edu,
38+ .co.uk). The combined number of entries in include_domains and exclude_domains
39+ cannot exceed 200.
3540 """
3641
3742 include_domains : SequenceNotStr [str ]
38- """List of domains to restrict the results to.
43+ """List of domains or domain/path prefixes to restrict results to.
3944
40- If specified, only sources from these domains will be included. Accepts plain
41- domains (e.g., example.com, subdomain.example.gov) or bare domain extension
42- starting with a period (e.g., .gov, .edu, .co.uk). The combined number of
43- domains in include_domains and exclude_domains cannot exceed 200.
45+ If specified, only matching sources will be included and exclude_domains will be
46+ ignored. Accepts plain domains (e.g., wikipedia.org), domain/path prefixes
47+ (e.g., docs.python.org/3), or bare domain extensions (e.g., .gov, .edu, .co.uk).
48+ The combined number of entries in include_domains and exclude_domains cannot
49+ exceed 200.
4450 """
0 commit comments