@@ -2376,6 +2376,7 @@ def web_scrape_html(
23762376 self ,
23772377 * ,
23782378 url : str ,
2379+ max_age_ms : int | Omit = omit ,
23792380 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
23802381 # The extra values given here take precedence over values defined on the client or passed to this method.
23812382 extra_headers : Headers | None = None ,
@@ -2389,6 +2390,10 @@ def web_scrape_html(
23892390 Args:
23902391 url: Full URL to scrape (must include http:// or https:// protocol)
23912392
2393+ max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
2394+ younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
2395+ omitted. Set to 0 to always scrape fresh.
2396+
23922397 extra_headers: Send extra headers
23932398
23942399 extra_query: Add additional query parameters to the request
@@ -2404,7 +2409,13 @@ def web_scrape_html(
24042409 extra_query = extra_query ,
24052410 extra_body = extra_body ,
24062411 timeout = timeout ,
2407- query = maybe_transform ({"url" : url }, brand_web_scrape_html_params .BrandWebScrapeHTMLParams ),
2412+ query = maybe_transform (
2413+ {
2414+ "url" : url ,
2415+ "max_age_ms" : max_age_ms ,
2416+ },
2417+ brand_web_scrape_html_params .BrandWebScrapeHTMLParams ,
2418+ ),
24082419 ),
24092420 cast_to = BrandWebScrapeHTMLResponse ,
24102421 )
@@ -2455,6 +2466,7 @@ def web_scrape_md(
24552466 url : str ,
24562467 include_images : bool | Omit = omit ,
24572468 include_links : bool | Omit = omit ,
2469+ max_age_ms : int | Omit = omit ,
24582470 shorten_base64_images : bool | Omit = omit ,
24592471 use_main_content_only : bool | Omit = omit ,
24602472 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -2476,6 +2488,10 @@ def web_scrape_md(
24762488
24772489 include_links: Preserve hyperlinks in Markdown output
24782490
2491+ max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
2492+ younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
2493+ omitted. Set to 0 to always scrape fresh.
2494+
24792495 shorten_base64_images: Shorten base64-encoded image data in the Markdown output
24802496
24812497 use_main_content_only: Extract only the main content of the page, excluding headers, footers, sidebars,
@@ -2501,6 +2517,7 @@ def web_scrape_md(
25012517 "url" : url ,
25022518 "include_images" : include_images ,
25032519 "include_links" : include_links ,
2520+ "max_age_ms" : max_age_ms ,
25042521 "shorten_base64_images" : shorten_base64_images ,
25052522 "use_main_content_only" : use_main_content_only ,
25062523 },
@@ -4873,6 +4890,7 @@ async def web_scrape_html(
48734890 self ,
48744891 * ,
48754892 url : str ,
4893+ max_age_ms : int | Omit = omit ,
48764894 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
48774895 # The extra values given here take precedence over values defined on the client or passed to this method.
48784896 extra_headers : Headers | None = None ,
@@ -4886,6 +4904,10 @@ async def web_scrape_html(
48864904 Args:
48874905 url: Full URL to scrape (must include http:// or https:// protocol)
48884906
4907+ max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
4908+ younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
4909+ omitted. Set to 0 to always scrape fresh.
4910+
48894911 extra_headers: Send extra headers
48904912
48914913 extra_query: Add additional query parameters to the request
@@ -4901,7 +4923,13 @@ async def web_scrape_html(
49014923 extra_query = extra_query ,
49024924 extra_body = extra_body ,
49034925 timeout = timeout ,
4904- query = await async_maybe_transform ({"url" : url }, brand_web_scrape_html_params .BrandWebScrapeHTMLParams ),
4926+ query = await async_maybe_transform (
4927+ {
4928+ "url" : url ,
4929+ "max_age_ms" : max_age_ms ,
4930+ },
4931+ brand_web_scrape_html_params .BrandWebScrapeHTMLParams ,
4932+ ),
49054933 ),
49064934 cast_to = BrandWebScrapeHTMLResponse ,
49074935 )
@@ -4954,6 +4982,7 @@ async def web_scrape_md(
49544982 url : str ,
49554983 include_images : bool | Omit = omit ,
49564984 include_links : bool | Omit = omit ,
4985+ max_age_ms : int | Omit = omit ,
49574986 shorten_base64_images : bool | Omit = omit ,
49584987 use_main_content_only : bool | Omit = omit ,
49594988 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -4975,6 +5004,10 @@ async def web_scrape_md(
49755004
49765005 include_links: Preserve hyperlinks in Markdown output
49775006
5007+ max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
5008+ younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
5009+ omitted. Set to 0 to always scrape fresh.
5010+
49785011 shorten_base64_images: Shorten base64-encoded image data in the Markdown output
49795012
49805013 use_main_content_only: Extract only the main content of the page, excluding headers, footers, sidebars,
@@ -5000,6 +5033,7 @@ async def web_scrape_md(
50005033 "url" : url ,
50015034 "include_images" : include_images ,
50025035 "include_links" : include_links ,
5036+ "max_age_ms" : max_age_ms ,
50035037 "shorten_base64_images" : shorten_base64_images ,
50045038 "use_main_content_only" : use_main_content_only ,
50055039 },
0 commit comments