@@ -240,6 +240,7 @@ def fetch(
240240 url : str ,
241241 include_raw_html : Optional [bool ] = None ,
242242 render_js : Optional [bool ] = None ,
243+ extract_images : Optional [bool ] = None ,
243244 ) -> LinkupFetchResponse :
244245 """Fetch the content of a web page using the Linkup API `fetch` endpoint.
245246
@@ -251,6 +252,8 @@ def fetch(
251252 url: The URL of the web page to fetch.
252253 include_raw_html: Whether to include the raw HTML of the webpage in the response.
253254 render_js: Whether the API should render the JavaScript of the webpage.
255+ extract_images: Whether the API should extract images from the webpage and return them
256+ in the response.
254257
255258 Returns:
256259 The response of the web page fetch, containing the web page content.
@@ -263,6 +266,7 @@ def fetch(
263266 url = url ,
264267 include_raw_html = include_raw_html ,
265268 render_js = render_js ,
269+ extract_images = extract_images ,
266270 )
267271
268272 response : httpx .Response = self ._request (
@@ -281,6 +285,7 @@ async def async_fetch(
281285 url : str ,
282286 include_raw_html : Optional [bool ] = None ,
283287 render_js : Optional [bool ] = None ,
288+ extract_images : Optional [bool ] = None ,
284289 ) -> LinkupFetchResponse :
285290 """Asynchronously fetch the content of a web page using the Linkup API `fetch` endpoint.
286291
@@ -292,6 +297,8 @@ async def async_fetch(
292297 url: The URL of the web page to fetch.
293298 include_raw_html: Whether to include the raw HTML of the webpage in the response.
294299 render_js: Whether the API should render the JavaScript of the webpage.
300+ extract_images: Whether the API should extract images from the webpage and return them
301+ in the response.
295302
296303 Returns:
297304 The response of the web page fetch, containing the web page content.
@@ -304,6 +311,7 @@ async def async_fetch(
304311 url = url ,
305312 include_raw_html = include_raw_html ,
306313 render_js = render_js ,
314+ extract_images = extract_images ,
307315 )
308316
309317 response : httpx .Response = await self ._async_request (
@@ -480,6 +488,7 @@ def _get_fetch_params(
480488 url : str ,
481489 include_raw_html : Optional [bool ],
482490 render_js : Optional [bool ],
491+ extract_images : Optional [bool ],
483492 ) -> dict [str , Union [str , bool ]]:
484493 params : dict [str , Union [str , bool ]] = {
485494 "url" : url ,
@@ -488,6 +497,8 @@ def _get_fetch_params(
488497 params ["includeRawHtml" ] = include_raw_html
489498 if render_js is not None :
490499 params ["renderJs" ] = render_js
500+ if extract_images is not None :
501+ params ["extractImages" ] = extract_images
491502 return params
492503
493504 def _parse_search_response (
0 commit comments