Use Google Search entry point

Using Google Search entry points

To use Google Search entry points, you need to display an entry point based on the search query included in the grounded response's metadata. The response includes:

  • "content": LLM generated response.
  • "searchQuery": The query to be used for the Google Search entry point.

For example, in the following code snippet, Gemini responds to a Google Search grounded prompt which is asking about a type of tropical plant.

"predictions": [
  {
    "content": "Monstera is a type of vine that thrives in bright indirect light…",
    "groundingMetadata": {
      "webSearchQueries": ["What's a monstera?"],
    }
  }
]

You can take this output and display it by using Google Search entry points.

Requirements for Google Search entry points

Do:

  • Display the entry point exactly as provided without any modifications while complying with the Display Requirements below.
  • Take users directly to the Google Search results page (SRP) when they interact with the entry point.

Don't:

  • Include any interstitial screens or additional steps between the user's tap and the display of the SRP
  • Display any other search results or suggestions alongside the entry point or associated grounded LLM response.

Display requirements

  • Display the entry point exactly as provided and don't make any modifications to colors, fonts, or appearance. Ensure the entry point renders as specified in the following mocks, including for light and dark mode:
  • Whenever a grounded response is shown, its corresponding Google Search entry point should remain visible.
  • Branding: You must strictly follow Google's Guidelines for Third Party Use of Google Brand Features
  • Google Search entry points should be at minimum the full width of the grounded response.

Behavior on tap

When a user taps the chip, they are taken directly to a Google Search results page (SRP) for the search term displayed in the chip. The SRP can open either within your in-app browser or in a separate browser app. It's important to not minimize, remove, or obstruct the SRP's display in any way. The following animated mockup illustrates the tap-to-SRP interaction.

app/desktop example

Code to implement a Google Search entry point

When you use the API to ground a response to search, the model response provides compliant HTML and CSS styling in the renderedContent field which you implement to display search entry points in your application. To see an example of the API response, see the response section in Grounding with Google Search.

What's next