Gemini Search icon

Gemini Search

Perform searches and generate content using Google Gemini API

Web Search

AI-generated

Summary

Perform a web search using the specified Gemini model and prompt, optionally constraining the search context by URLs or organization, and configure generation parameters for the response.

Inputs

  • Model (required) — Select the Gemini model to use for the web search.
  • Prompt (required) — Enter the text prompt to send to the Gemini model to perform the search.
  • Enable URL Context Tool — Enable using specific URLs as context for the search instead of a general web search.
  • Restrict Search to URLs — Provide a comma-separated list of URLs to restrict the search to when URL context is enabled.
  • Enable Organization Context — Restrict the search to a specific organization domain.
  • Organization Context — Specify the organization name to limit the search context to when organization context is enabled.
  • System Instruction — Optional system-level instruction to guide the model's behavior during the search.
  • Options — Advanced options including batching (items per batch and interval between batches), randomness controls (temperature, topP, topK), max output tokens, and whether to extract the source URL from the response.

Output shape

a single JSON object per input item with the search response text and optional metadata fields including urlContextMetadata, restrictedUrls, sourceUrl, redirectedSourceUrl, redirectError, and the full raw API response

Returns one output item per input item. Each output includes the generated search response text under 'response'. If enabled, metadata such as source URLs and restrictions are included. Batching throttles requests when configured. Errors are returned in the output JSON if the request fails and continueOnFail is set.

Examples

Example 1: Web Search with URL Context

Set the prompt and enable URL context, restricting the search to specific URLs. Optionally extract the source URL from the response.

Example 2: Web Search with Organization Context

Enable organization context and specify the organization domain to restrict search results accordingly.

Links

Discussion