serpapi / public-roadmap

Public Roadmap for SerpApi, LLC (https://serpapi.com)
56 stars 6 forks source link

[Google Search API] Disable AI overview result #2161

Open hilmanski opened 1 day ago

hilmanski commented 1 day ago

An enterprise customer asked for an option to disable the AI overview result.

The real issue is with the HTML view since they need to screenshot it for internal records.

Internal links: Front

dsojevic commented 14 hours ago

@hilmanski, if there are any particular elements that they would like removed from the HTML before taking screenshots, they could do the following:

  1. Load the .xray format (still HTML, but with additional markup) instead of the .html format e.g. https://serpapi.com/searches/<search-id>.xray?api_key=<api-key> e.g. https://serpapi.com/searches/<token>/<search-id>.xray
  2. Prior to rendering the HTML (or prior to screenshotting if able to action this in browser), use a CSS selector to find the following element: [xray-json-path="ai_overview"]
  3. Delete the element if found
  4. Render + screenshot

This approach can be extended to remove any other blocks that we parse that they may not want in a screenshot.

hilmanski commented 10 hours ago

Thanks, @dsojevic . I'll share this with the customer.