Google AI Overview API

Our Google AI Overview API allows you to scrape results from the AI Overview block from Google search results. The API is accessed through the following endpoint: /search?engine=google_ai_overview.

This engine is used only when Google requires a separate request to fetch AI Overview results. See AI Overview Results for results embedded in the main search results.

A user may query the following URL: https://serpapi.com/search?engine=google_ai_overview utilizing a GET request.

API Parameters

Search Query

page_token

Required

Parameter defines the token to fetch the AI Overview from. Use ai_overview.page_token from the AI Overview Results section of our Google Search API — see the extra request example.

ai_overview.page_token expires within 4 minutes of the search and should be used immediately.

Serpapi Parameters

engine

Required

Set parameter to google_ai_overview to use the Google AI Overview API engine.

no_cache

Optional

Parameter will force SerpApi to fetch the Google AI Overview results even if a cached version is already present. A cache is served only if the query and all parameters are exactly the same. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month. It can be set to false (default) to allow results from the cache, or true to disallow results from the cache. no_cache and async parameters should not be used together.

async

Optional

Parameter defines the way you want to submit your search to SerpApi. It can be set to false (default) to open an HTTP connection and keep it open until you got your search results, or true to just submit your search to SerpApi and retrieve them later. In this case, you'll need to use our Searches Archive API to retrieve your results. async and no_cache parameters should not be used together. async should not be used on accounts with Ludicrous Speed enabled.

api_key

Required

Parameter defines the SerpApi private key to use.

output

Optional

Parameter defines the final output you want. It can be set to json (default) to get a structured JSON of the results, or html to get the raw html retrieved.

API Results

JSON Results

JSON output includes structured data for text_blocks, thumbnail and references.

A search status is accessible through search_metadata.status. It flows this way: Processing -> Success || Error. If a search has failed, error will contain an error message. search_metadata.id is the search ID inside SerpApi.

HTML Results

HTML output is useful to debug JSON results or support features not supported yet by SerpApi. HTML output gives you the raw HTML results from Google AI Overview.

API Examples

Typical example

The type of results are basically the same as the ones you would see on embedded AI Overview results. See AI Overview Results for more examples.

Typical example

JSON Example

{
  "search_metadata": {
    "id": "6704d8e815afff064f16921d",
    "status": "Success",
    "json_endpoint": "https://serpapi.com/searches/b71a9505c46d58cd/6704d8e815afff064f16921d.json",
    "created_at": "2024-10-08 07:02:00 UTC",
    "processed_at": "2024-10-08 07:02:00 UTC",
    "google_ai_overview_url": "https://www.google.com/async/folsrch?uule=w+CAIQICIaQXVzdGluLFRleGFzLFVuaXRlZCBTdGF0ZXM&gl=us&hl=en&yv=3&cs=0&ei=3NgEZ6eoKsfFp84PkJnYyQk&async=_basejs:/xjs/_/js/k%3Dxjs.s.en_US.IPwIHgHAxUU.es5.O/am%3DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAABCgQCAAAAAAACgAAAAAAAAAAAAAAAAAAAAAQCACAkBAAAAQAAAAWAAAiQEIAACAAAAQEAAAQIAL4_ScAAAAAAAAAAACIAGACAAAAAAAuAAAIFAEAAAACAAAwAAAAEAAAAAAAoAAAAACgAAAAAAAAAAAAAAAAAAAEEIB-AAAAAAAAAAAAAAIAAAAAwAAFAAL4AQAAAEAAAAAQBAAAHJABCAAAAAAAAOA-AHgeMBxSWAAAAAAAAAAAAAAAAAQgQTAHpL8gAAQAAAAAAAAAAAAAAAAAgJSgicsNACQ/dg%3D0/br%3D1/rs%3DACT90oF9ar19S0BoWafPRynlm6pejW3v8A,_basecss:/xjs/_/ss/k%3Dxjs.s.N7uEhNpUhSA.L.B1.O/am%3DQOoQIAQAAAJAHBpAAAAAAAAAAAAAAAAAAAAAIAEAACAAAAAAABAAgAgAsEwCAADyAgAANgAgAADwAQAcEAAYAAAAAAAAkAAAAAAAAgBUCAAAAAAAAIAAAEAEBAAAFAIAAAAAAAAABgAAAACEAAEACOAAQgCgAAkIFAHoRyEAAAAwAACAEBAGGAYgqABgAKegAAAABAAAAQAAAYAQAAAAUEAAAAECAPQIBIABICcCAIQAgAAlABAAAEAAAAABAgEAiJkAHJABCAAAAAAAAAASAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAABA/br%3D1/rs%3DACT90oG2wqar9iCOTUVgk3bflc-u0BNSfA,_basecomb:/xjs/_/js/k%3Dxjs.s.en_US.IPwIHgHAxUU.es5.O/ck%3Dxjs.s.N7uEhNpUhSA.L.B1.O/am%3DQOoQIAQAAAJAHBpAAAAAAAAAAAAAAAAAAAAAIAEAACAAAAAAABAAhCgQuEwCAADyCgAANgAgAADwAQAcEAAYAAAQCACAkBAAAAQAAgBWCAAiQEIAAKAAAEQEBAAQNAL4_ScAAAAABgAAAACMAGECCOAAQgCuAAkIFAHoRyECAAAwAACAEBAGGAYgqABgAKegAAAABAAAAQAAAYAQAAAEUMB-AAECAPQIBIABICcCAIQAwAAlABL4AUAAAEABAgEQjJkAHJABCAAAAAAAAOA-AHgeMBxSWAAAAAAAAAAAAAAAAAQgQTAHpL8gAAQAAAAAAAAAAAAAAAAAgJSgicsNACQ/d%3D1/ed%3D1/dg%3D0/br%3D1/ujg%3D1/rs%3DACT90oF6CdxYKsNg0wVitUFBrg92jUhLrQ,_fmt:prog,_id:B2Jtyd&q=how+does+art+work+in+android&mlro=0a5rzhVg-Dr-nhjLti0LENrAucxBae2OZMicnlfNG6eyS_-Lie5s4iFM_p8uhyVesMvHqoMBkGNIPiIIJhhg5e26dwekmq9qinW0jMRw3oWSnWeYgEI5D7RBLbLhG_NHrht4o_ODeIw8lz00&mlros=XKE4ZbPBZ-o&sca_esv=159f37a1251190f9&mgtyp=1",
    "raw_html_file": "https://serpapi.com/searches/b71a9505c46d58cd/6704d8e815afff064f16921d.html",
    "total_time_taken": 1.37
  },
  "search_parameters": {
    "engine": "google_ai_overview",
    "page_token": "KIVu-nictZPdjrI4GMeTPdkrWU8cFXV0dBKyKbUgiigy6OgJQawFQapUBpmzvZe9qr2aLYzO6I5vsm-yW0Ip7dPn4__L88efoR8Ff_36i3c87tlzrZamaZVQSkJcdemu5rAscmsbGrLY9X5PkhCLaRkC1VCh6hivs_e1EiaaPA2xIr9r8ixxXqfhEkova0UWlq-jEgnFhJW8UMRRKXsTmyWXiUIJ-2JTJ2jZxnTINvK-8zgJBtEiM4JSEVG0Vw7DW57Qactqdo1PwW_NHv-psiqObMusqpNU7ZM-OFlWFbNWdVxzdtwE_NsBv5YSJMblF5K71vwcgkAqlvk0569vIPXsx0D5pALt0Tbd6yAqUD4jJfxVZYAu0dN8gc6H9MfREVKlyu2WWszcgQx4zCKlD0dGnmJ_wEu6mI5BBfQJHkknc_69LGK8gP5e65BzXTeDDEziu0wH0KitCRdXqK1i_qnXYpZLDV-6ApW7TlzvmoJE585mMs2icNfe4-28-dYBDwVGl31yZNcc9acEefre8kxQ1apS_YLQGFMuZZ7OAPSl_T0cXAD0hZDXTPjDUMp3ehlfAj3fAL2Uu3G55eJyL_isTbLgl7NcPpRLJ5-lLdwWMCDKD-E4FyvHE3CEfTrN0JkAzC8qCliQQ35jiMk5pQ9FFx-6WoU5gmBiqJIKJBW6eRflSYaFMTpXQhDwB8EtQgDMuyJcj-EP9iVwh5nSSA9O3PXh-MWakaC52oRuJREk3dxcmNHd6qeaz_1_uHq8NZMzV3if621rEmkOL62Za4KMnKuhX7XmmesIKAieuSZXXOFPcEXWKG_N71zTgitvTatgm3M1tv_k-l-1ZoEXf3xu-zTZkm_92obr02LIdCKkM_9oyVJMuo2t5Wmx8WBvdsfnfUzJg-2vn6XG4JitSwfRo2l5TTErO_GxnNI4KPtR2YnWMfXXpV0YU1FwWvG7NyOVXlyJvK129AUN6TFI3JPk4MZ4OfLdKNzoShtnpl3RfNxij748svedxMtmmI3e-gc6kgJFVye-qg48j7Rwo71OcbA7dA9-NBe2o2napHMzmuMFQWqr9zSVtJXmKbbej73jI7XHPaymnfBdEIqsmPg6RI_L1URaVmiJuY6N2ZtYb3U3zSen3mjV611h0y3tyDHbi_W_AU9HHA0"
  },
  "ai_overview": {
    "text_blocks": [
      {
        "type": "paragraph",
        "snippet": "Android Runtime (ART) is the virtual machine that runs apps and some system services on Android devices. ART works by:",
        "reference_indexes": [
          0,
          2,
          3
        ]
      },
      {
        "type": "list",
        "list": [
          {
            "title": "Compiling code ahead of time",
            "snippet": "ART uses Ahead of Time (AOT) compilation to compile code before the app is executed. This is different from Dalvik, the previous virtual machine, which used Just In Time (JIT) compilation. AOT compilation makes the machine code ready before the app runs, which significantly improves runtime performance.",
            "reference_indexes": [
              3,
              4
            ]
          },
          {
            "title": "Generating a profile",
            "snippet": "When an app is first run, ART interprets methods that aren't AOT-compiled. It then generates a local profile based on how the app is executed. If the app was installed with a dex metadata file, ART combines the local profile with the cloud profile.",
            "reference_indexes": [
              1
            ]
          },
          {
            "title": "Recompiling the app",
            "snippet": "When the device is idle and charging, a compilation daemon re-compiles the app based on the profile generated during the first few runs.",
            "reference_indexes": [
              1
            ]
          },
          ...
        ]
      },
      {
        "type": "paragraph",
        "snippet": "ART has been the default virtual machine for Android since Android 5.0 (Lollipop). However, some older devices may still use Dalvik if they haven't been updated to a newer version of Android.",
        "reference_indexes": [
          2
        ]
      }
    ],
    "references": [
      {
        "title": "Android runtime and Dalvik | Android Open Source Project",
        "link": "https://source.android.com/docs/core/runtime#:~:text=Android%20runtime%20(ART)%20is%20the,major%20features%20implemented%20by%20ART.",
        "snippet": "Aug 26, 2024 — Android runtime (ART) is the managed runtime used by apps and some system services on Android. ART and its predecessor...",
        "source": "Android Open Source Project",
        "index": 0
      },
      {
        "title": "Configure ART - Android Open Source Project",
        "link": "https://source.android.com/docs/core/runtime/configure",
        "snippet": "How ART works * An application is initially installed with a dex metadata ( . dm ) file distributed by Play Store, which contains...",
        "source": "Android Open Source Project",
        "index": 1
      },
      {
        "title": "Android Runtime 101: ART Component of Android Architecture",
        "link": "https://medium.com/@acceldia/android-runtime-101-art-component-of-android-architecture-7b89d701c71e#:~:text=Summary,a%20newer%20version%20of%20Android.",
        "snippet": "Mar 3, 2023 — Summary. In the mobile device domain, different operating systems (OS) exist. Android OS has become highly popular and ...",
        "source": "Medium",
        "index": 2
      },
      ...
    ]
  }
}

JSON structure overview

{
  ...
  "ai_overview": {
    "text_blocks": [
      {
        "type": "String - Type of the text block. Can be 'paragraph', 'list', 'expandable'",
        "snippet": "String - Snippet of the text block",
        "snippet_highlighted_words": "Array of strings - Highlighted words in the snippet",
        "reference_indexes": "Array of integers - Indexes of the references in the root 'references' field",
        "thumbnail": "String - URL to the thumbnail image",
        // Only for 'list' type
        "list": [
          {
            "title": "String - Title of the list item",
            "snippet": "String - Snippet of the list item",
            "reference_indexes": "Array of integers - Indexes of the references in the root 'references' field",
            "thumbnail": "String - URL to the thumbnail image",
            // Nested lists
            "list": [
              {
                "snippet": "String - Snippet of the nested list item",
                "reference_indexes": "Array of integers - Indexes of the references in the root 'references' field",
              },
              ...
            ]
          },
          ...
        ],
        // Only for 'expandable' type
        "text_blocks": [
          // The same structure as the parent 'text_blocks' field
        ]
      },
      {
    ],
    "thumbnail": "String - URL to the thumbnail image",
    "references": [
      {
        "title": "String - Title of the reference",
        "link": "String - URL to the reference",
        "snippet": "String - Snippet of the reference",
        "source": "String - Source of the reference",
        "index": "Integer - Index of the reference"
      },
      ...
    ],
    "error": "String - Error message if the AI Overview results are not available",
  },
  ...
}