@@ -209,6 +209,7 @@ def web_scrape_html(
209209 self ,
210210 * ,
211211 url : str ,
212+ max_age_ms : int | Omit = omit ,
212213 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
213214 # The extra values given here take precedence over values defined on the client or passed to this method.
214215 extra_headers : Headers | None = None ,
@@ -222,6 +223,10 @@ def web_scrape_html(
222223 Args:
223224 url: Full URL to scrape (must include http:// or https:// protocol)
224225
226+ max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
227+ younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
228+ omitted. Set to 0 to always scrape fresh.
229+
225230 extra_headers: Send extra headers
226231
227232 extra_query: Add additional query parameters to the request
@@ -237,7 +242,13 @@ def web_scrape_html(
237242 extra_query = extra_query ,
238243 extra_body = extra_body ,
239244 timeout = timeout ,
240- query = maybe_transform ({"url" : url }, web_web_scrape_html_params .WebWebScrapeHTMLParams ),
245+ query = maybe_transform (
246+ {
247+ "url" : url ,
248+ "max_age_ms" : max_age_ms ,
249+ },
250+ web_web_scrape_html_params .WebWebScrapeHTMLParams ,
251+ ),
241252 ),
242253 cast_to = WebWebScrapeHTMLResponse ,
243254 )
@@ -288,6 +299,7 @@ def web_scrape_md(
288299 url : str ,
289300 include_images : bool | Omit = omit ,
290301 include_links : bool | Omit = omit ,
302+ max_age_ms : int | Omit = omit ,
291303 shorten_base64_images : bool | Omit = omit ,
292304 use_main_content_only : bool | Omit = omit ,
293305 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -309,6 +321,10 @@ def web_scrape_md(
309321
310322 include_links: Preserve hyperlinks in Markdown output
311323
324+ max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
325+ younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
326+ omitted. Set to 0 to always scrape fresh.
327+
312328 shorten_base64_images: Shorten base64-encoded image data in the Markdown output
313329
314330 use_main_content_only: Extract only the main content of the page, excluding headers, footers, sidebars,
@@ -334,6 +350,7 @@ def web_scrape_md(
334350 "url" : url ,
335351 "include_images" : include_images ,
336352 "include_links" : include_links ,
353+ "max_age_ms" : max_age_ms ,
337354 "shorten_base64_images" : shorten_base64_images ,
338355 "use_main_content_only" : use_main_content_only ,
339356 },
@@ -568,6 +585,7 @@ async def web_scrape_html(
568585 self ,
569586 * ,
570587 url : str ,
588+ max_age_ms : int | Omit = omit ,
571589 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
572590 # The extra values given here take precedence over values defined on the client or passed to this method.
573591 extra_headers : Headers | None = None ,
@@ -581,6 +599,10 @@ async def web_scrape_html(
581599 Args:
582600 url: Full URL to scrape (must include http:// or https:// protocol)
583601
602+ max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
603+ younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
604+ omitted. Set to 0 to always scrape fresh.
605+
584606 extra_headers: Send extra headers
585607
586608 extra_query: Add additional query parameters to the request
@@ -596,7 +618,13 @@ async def web_scrape_html(
596618 extra_query = extra_query ,
597619 extra_body = extra_body ,
598620 timeout = timeout ,
599- query = await async_maybe_transform ({"url" : url }, web_web_scrape_html_params .WebWebScrapeHTMLParams ),
621+ query = await async_maybe_transform (
622+ {
623+ "url" : url ,
624+ "max_age_ms" : max_age_ms ,
625+ },
626+ web_web_scrape_html_params .WebWebScrapeHTMLParams ,
627+ ),
600628 ),
601629 cast_to = WebWebScrapeHTMLResponse ,
602630 )
@@ -647,6 +675,7 @@ async def web_scrape_md(
647675 url : str ,
648676 include_images : bool | Omit = omit ,
649677 include_links : bool | Omit = omit ,
678+ max_age_ms : int | Omit = omit ,
650679 shorten_base64_images : bool | Omit = omit ,
651680 use_main_content_only : bool | Omit = omit ,
652681 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -668,6 +697,10 @@ async def web_scrape_md(
668697
669698 include_links: Preserve hyperlinks in Markdown output
670699
700+ max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
701+ younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
702+ omitted. Set to 0 to always scrape fresh.
703+
671704 shorten_base64_images: Shorten base64-encoded image data in the Markdown output
672705
673706 use_main_content_only: Extract only the main content of the page, excluding headers, footers, sidebars,
@@ -693,6 +726,7 @@ async def web_scrape_md(
693726 "url" : url ,
694727 "include_images" : include_images ,
695728 "include_links" : include_links ,
729+ "max_age_ms" : max_age_ms ,
696730 "shorten_base64_images" : shorten_base64_images ,
697731 "use_main_content_only" : use_main_content_only ,
698732 },
0 commit comments