Search Grounding: Real-Time Data in Responses
Connect the google_search tool to Gemini 4 Hydrogen through the Interactions API, stream a company report and extract source links. Search pricing and limits, URL context, Google Maps and the Deep Research agent.
Grounding with Google Search
The google_search tool connects Gemini to live Google Search. The model decides whether a search would help, writes one or more queries, reads the results and answers with links to its sources. The tool is supported on Gemini 4 models (Argon, Hydrogen and others) and on Gemini 3.x: 3.8 Flash, 3.6 Flash, 3.5 Flash-Lite, 3.1 Pro preview.
Google recommends the Interactions API (client.interactions.create) for new projects. The older generate_content is now called legacy: it is still supported, but the examples below use the new API.
from google import genai
client = genai.Client() # reads the key from GEMINI_API_KEY
MODEL_ID = "gemini-4-hydrogen"
gemini-4-hydrogen launched in November 2026 and suits everyday agent tasks. gemini-3.8-flash works too. gemini-2.5-flash is deprecated: since December 1, 2026, requests to it are automatically routed to gemini-3.5-flash-lite.
The rest of this lesson opens after a free sign-up
Sign up with email or Google: the first two lessons of every course stay open for good, and the whole catalog is open for 7 days. No card needed.


