@@ -261,6 +261,7 @@ def map_urls(
261261 self ,
262262 * ,
263263 domain : str ,
264+ exclude_url_regex : str | Omit = omit ,
264265 headers : Dict [str , str ] | Omit = omit ,
265266 include_subdomains : bool | Omit = omit ,
266267 max_links : int | Omit = omit ,
@@ -284,6 +285,9 @@ def map_urls(
284285 Args:
285286 domain: Domain to map, e.g. `stripe.com`.
286287
288+ exclude_url_regex: Optional RE2-compatible regex pattern. URLs matching this pattern are not
289+ returned, even when they match urlRegex.
290+
287291 headers: HTTP headers for the target origin. Non-empty headers bypass caching.
288292
289293 include_subdomains: Include URLs on subdomains.
@@ -323,6 +327,7 @@ def map_urls(
323327 query = maybe_transform (
324328 {
325329 "domain" : domain ,
330+ "exclude_url_regex" : exclude_url_regex ,
326331 "headers" : headers ,
327332 "include_subdomains" : include_subdomains ,
328333 "max_links" : max_links ,
@@ -1412,6 +1417,7 @@ def web_crawl_md(
14121417 ]
14131418 | Omit = omit ,
14141419 exclude_selectors : Optional [SequenceNotStr [str ]] | Omit = omit ,
1420+ exclude_url_regex : str | Omit = omit ,
14151421 follow_subdomains : bool | Omit = omit ,
14161422 include_frames : bool | Omit = omit ,
14171423 include_images : bool | Omit = omit ,
@@ -1449,6 +1455,9 @@ def web_crawl_md(
14491455
14501456 exclude_selectors: Remove matching elements after inclusions. Exclusions take precedence.
14511457
1458+ exclude_url_regex: RE2 regex pattern. URLs matching this pattern are never followed or scraped,
1459+ even when they match urlRegex. The starting URL is always scraped.
1460+
14521461 follow_subdomains: When true, follow links on subdomains of the starting URL's domain (e.g.
14531462 docs.example.com when starting from example.com). www and apex are always
14541463 treated as equivalent.
@@ -1510,6 +1519,7 @@ def web_crawl_md(
15101519 "url" : url ,
15111520 "country" : country ,
15121521 "exclude_selectors" : exclude_selectors ,
1522+ "exclude_url_regex" : exclude_url_regex ,
15131523 "follow_subdomains" : follow_subdomains ,
15141524 "include_frames" : include_frames ,
15151525 "include_images" : include_images ,
@@ -1759,6 +1769,7 @@ async def map_urls(
17591769 self ,
17601770 * ,
17611771 domain : str ,
1772+ exclude_url_regex : str | Omit = omit ,
17621773 headers : Dict [str , str ] | Omit = omit ,
17631774 include_subdomains : bool | Omit = omit ,
17641775 max_links : int | Omit = omit ,
@@ -1782,6 +1793,9 @@ async def map_urls(
17821793 Args:
17831794 domain: Domain to map, e.g. `stripe.com`.
17841795
1796+ exclude_url_regex: Optional RE2-compatible regex pattern. URLs matching this pattern are not
1797+ returned, even when they match urlRegex.
1798+
17851799 headers: HTTP headers for the target origin. Non-empty headers bypass caching.
17861800
17871801 include_subdomains: Include URLs on subdomains.
@@ -1821,6 +1835,7 @@ async def map_urls(
18211835 query = await async_maybe_transform (
18221836 {
18231837 "domain" : domain ,
1838+ "exclude_url_regex" : exclude_url_regex ,
18241839 "headers" : headers ,
18251840 "include_subdomains" : include_subdomains ,
18261841 "max_links" : max_links ,
@@ -2910,6 +2925,7 @@ async def web_crawl_md(
29102925 ]
29112926 | Omit = omit ,
29122927 exclude_selectors : Optional [SequenceNotStr [str ]] | Omit = omit ,
2928+ exclude_url_regex : str | Omit = omit ,
29132929 follow_subdomains : bool | Omit = omit ,
29142930 include_frames : bool | Omit = omit ,
29152931 include_images : bool | Omit = omit ,
@@ -2947,6 +2963,9 @@ async def web_crawl_md(
29472963
29482964 exclude_selectors: Remove matching elements after inclusions. Exclusions take precedence.
29492965
2966+ exclude_url_regex: RE2 regex pattern. URLs matching this pattern are never followed or scraped,
2967+ even when they match urlRegex. The starting URL is always scraped.
2968+
29502969 follow_subdomains: When true, follow links on subdomains of the starting URL's domain (e.g.
29512970 docs.example.com when starting from example.com). www and apex are always
29522971 treated as equivalent.
@@ -3008,6 +3027,7 @@ async def web_crawl_md(
30083027 "url" : url ,
30093028 "country" : country ,
30103029 "exclude_selectors" : exclude_selectors ,
3030+ "exclude_url_regex" : exclude_url_regex ,
30113031 "follow_subdomains" : follow_subdomains ,
30123032 "include_frames" : include_frames ,
30133033 "include_images" : include_images ,
0 commit comments