@@ -398,21 +398,29 @@ def web_scrape_images(
398398 self ,
399399 * ,
400400 url : str ,
401+ enrichment : web_web_scrape_images_params .Enrichment | Omit = omit ,
402+ max_age_ms : int | Omit = omit ,
401403 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
402404 # The extra values given here take precedence over values defined on the client or passed to this method.
403405 extra_headers : Headers | None = None ,
404406 extra_query : Query | None = None ,
405407 extra_body : Body | None = None ,
406408 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
407409 ) -> WebWebScrapeImagesResponse :
408- """Scrapes all images from the given URL.
409-
410- Extracts images from img, svg,
411- picture/source, link, and video elements including inline SVGs, base64 data
412- URIs, and standard URLs .
410+ """
411+ Extract image assets from a web page, including standard URLs, inline SVGs, data
412+ URIs, responsive image sources, metadata, CSS backgrounds, video posters, and
413+ embeds. The base request costs 1 credit; enrichment costs 1 credit per returned
414+ image .
413415
414416 Args:
415- url: Full URL to scrape images from (must include http:// or https:// protocol)
417+ url: Page URL to inspect. Must include http:// or https://.
418+
419+ enrichment: Optional per-image processing, sent as deep-object query params such as
420+ enrichment[resolution]=true.
421+
422+ max_age_ms: Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
423+ day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).
416424
417425 extra_headers: Send extra headers
418426
@@ -429,7 +437,14 @@ def web_scrape_images(
429437 extra_query = extra_query ,
430438 extra_body = extra_body ,
431439 timeout = timeout ,
432- query = maybe_transform ({"url" : url }, web_web_scrape_images_params .WebWebScrapeImagesParams ),
440+ query = maybe_transform (
441+ {
442+ "url" : url ,
443+ "enrichment" : enrichment ,
444+ "max_age_ms" : max_age_ms ,
445+ },
446+ web_web_scrape_images_params .WebWebScrapeImagesParams ,
447+ ),
433448 ),
434449 cast_to = WebWebScrapeImagesResponse ,
435450 )
@@ -922,21 +937,29 @@ async def web_scrape_images(
922937 self ,
923938 * ,
924939 url : str ,
940+ enrichment : web_web_scrape_images_params .Enrichment | Omit = omit ,
941+ max_age_ms : int | Omit = omit ,
925942 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
926943 # The extra values given here take precedence over values defined on the client or passed to this method.
927944 extra_headers : Headers | None = None ,
928945 extra_query : Query | None = None ,
929946 extra_body : Body | None = None ,
930947 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
931948 ) -> WebWebScrapeImagesResponse :
932- """Scrapes all images from the given URL.
933-
934- Extracts images from img, svg,
935- picture/source, link, and video elements including inline SVGs, base64 data
936- URIs, and standard URLs .
949+ """
950+ Extract image assets from a web page, including standard URLs, inline SVGs, data
951+ URIs, responsive image sources, metadata, CSS backgrounds, video posters, and
952+ embeds. The base request costs 1 credit; enrichment costs 1 credit per returned
953+ image .
937954
938955 Args:
939- url: Full URL to scrape images from (must include http:// or https:// protocol)
956+ url: Page URL to inspect. Must include http:// or https://.
957+
958+ enrichment: Optional per-image processing, sent as deep-object query params such as
959+ enrichment[resolution]=true.
960+
961+ max_age_ms: Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
962+ day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).
940963
941964 extra_headers: Send extra headers
942965
@@ -953,7 +976,14 @@ async def web_scrape_images(
953976 extra_query = extra_query ,
954977 extra_body = extra_body ,
955978 timeout = timeout ,
956- query = await async_maybe_transform ({"url" : url }, web_web_scrape_images_params .WebWebScrapeImagesParams ),
979+ query = await async_maybe_transform (
980+ {
981+ "url" : url ,
982+ "enrichment" : enrichment ,
983+ "max_age_ms" : max_age_ms ,
984+ },
985+ web_web_scrape_images_params .WebWebScrapeImagesParams ,
986+ ),
957987 ),
958988 cast_to = WebWebScrapeImagesResponse ,
959989 )
0 commit comments