> ## AI Agent Context
> Get the complete documentation index at: https://aistudio.google.com/llms.txt
> Use this file to discover all available pages.
> For the full documentation in a single file, fetch: https://aistudio.google.com/llms-full.txt

# Grounding with Google Maps

Grounding with Google Maps connects the generative capabilities of Gemini with
the rich, factual, and up-to-date data of Google Maps. This feature enables
developers to easily incorporate location-aware functionality into their
applications. When a user query has a context related to Maps data, the Gemini
model leverages Google Maps to provide factually accurate and fresh answers that
are relevant to the user's specified location or general area.

*   **Accurate, location-aware responses:** Leverage Google Maps' extensive and
  current data for geographically specific queries.

*   **Enhanced personalization:** Tailor recommendations and information based
  on user-provided locations.


## Get started  {% id="get-started" %}

This example demonstrates how to integrate Grounding with Google Maps into your
application to provide accurate, location-aware responses to user queries. The
prompt asks for local recommendations with an optional user location, enabling
the Gemini model to use Google Maps data.

{% tabs %}
  {% tab label="Python" %}
  ```python
    from google import genai
    from google.genai import types
  
    client = genai.Client()
  
    prompt = "What are the best Italian restaurants within a 15-minute walk from here?"
  
    response = client.models.generate_content(
        model='gemini-4-hydrogen',
        contents=prompt,
        config=types.GenerateContentConfig(
            # Turn on grounding with Google Maps
            tools=[types.Tool(google_maps=types.GoogleMaps())],
            # Optionally provide the relevant location context (this is in Los Angeles)
            tool_config=types.ToolConfig(retrieval_config=types.RetrievalConfig(
                lat_lng=types.LatLng(
                    latitude=34.050481, longitude=-118.248526))),
        ),
    )
  
    print("Generated Response:")
    print(response.text)
  
    if grounding := response.candidates[0].grounding_metadata:
      if grounding.grounding_chunks:
        print('-' * 40)
        print("Sources:")
        for chunk in grounding.grounding_chunks:
          print(f'- [{chunk.maps.title}]({chunk.maps.uri})')
  ```

  {% /tab %}

  {% tab label="JavaScript" %}
  ```javascript
    import { GoogleGenAI } from "@google/genai";
  
    const ai = new GoogleGenAI({});
  
    async function generateContentWithMapsGrounding() {
      const response = await ai.models.generateContent({
        model: "gemini-4-hydrogen",
        contents: "What are the best Italian restaurants within a 15-minute walk from here?",
        config: {
          // Turn on grounding with Google Maps
          tools: [{ googleMaps: {} }],
          toolConfig: {
            retrievalConfig: {
              // Optionally provide the relevant location context (this is in Los Angeles)
              latLng: {
                latitude: 34.050481,
                longitude: -118.248526,
              },
            },
          },
        },
      });
  
      console.log("Generated Response:");
      console.log(response.text);
  
      const grounding = response.candidates[0]?.groundingMetadata;
      if (grounding?.groundingChunks) {
        console.log("-".repeat(40));
        console.log("Sources:");
        for (const chunk of grounding.groundingChunks) {
          if (chunk.maps) {
            console.log(`- [${chunk.maps.title}](${chunk.maps.uri})`);
          }
        }
      }
    }
  
    generateContentWithMapsGrounding();
  ```

  {% /tab %}

  {% tab label="REST" %}
  ```shell
    curl -X POST 'https://generativelanguage.googleapis.com/v1beta/models/gemini-4-hydrogen:generateContent' \
      -H 'Content-Type: application/json' \
      -H "x-goog-api-key: ${GEMINI_API_KEY}" \
      -d '{
      "contents": [{
        "role": "user",
        "parts": [{
          "text": "What are the best Italian restaurants within a 15-minute walk from here?"
        }]
      }],
      "tools": [{"googleMaps": {}}],
      "toolConfig": {
        "retrievalConfig": {
          "latLng": {"latitude": 34.050481, "longitude": -118.248526}
        }
      }
    }'
  ```

  {% /tab %}

{% /tabs %}

## How Grounding with Google Maps works  {% id="how-it-works" %}

Grounding with Google Maps integrates the Gemini API with the Google Geo
ecosystem by using the Maps API as a grounding source. When a user's query
contains geographical context, the Gemini model can invoke the Grounding with
Google Maps tool. The model can then generate responses grounded in Google Maps
data relevant to the provided location.

The process typically involves:

1.   **User query:** A user submits a query to your application, potentially
  including geographical context (e.g., "coffee shops near me," "museums in
  San Francisco").

2.   **Tool invocation:** The Gemini model, recognizing the geographical intent,
  invokes the Grounding with Google Maps tool. This tool can optionally be
  provided with the user's `latitude` and `longitude`. The tool is a textual
  search tool and behaves similarly to searching on Maps, in that local
  queries ("near me") will use the coordinates, while specific or non-local
  queries are unlikely to be influenced by the explicit location.

3.   **Data retrieval:** The Grounding with Google Maps service queries Google
  Maps for relevant information (e.g., places, reviews, photos, addresses,
  opening hours).

4.   **Grounded generation:** The retrieved Maps data is used to inform the
  Gemini model's response, ensuring factual accuracy and relevance.

5.   **Response:** The model returns a text response, which
  includes citations to Google Maps sources.


## Why and when to use Grounding with Google Maps  {% id="why-use" %}

Grounding with Google Maps is ideal for applications that require accurate,
up-to-date, and location-specific information. It enhances the user experience
by providing relevant and personalized content backed by Google Maps' extensive
database of over 250 million places worldwide.

You should use Grounding with Google Maps when your application needs to:

*   Provide complete and accurate responses to geo-specific questions.

*   Build conversational trip planners and local guides.

*   Recommend points of interest based on
  location and user preferences like restaurants or shops.

*   Create location-aware experiences for social, retail, or food delivery
  services.


Grounding with Google Maps excels in use cases where proximity and current
factual data are critical, such as finding the "best coffee shop near me" or
getting directions.

## API methods and parameters  {% id="methods-parameters" %}

Grounding with Google Maps is exposed through the Gemini API as a tool within
the [`generateContent`](/api-reference/generate-content) method. You enable and configure
Grounding with Google Maps by including a
[`googleMaps`](/api-reference/generate-content#Resource:Tool) object in the `tools` parameter of your
request.

{% tabs %}
  {% tab label="JSON" %}
  ```json
    {
      "contents": [{
        "parts": [
          {"text": "Restaurants near Times Square."}
        ]
      }],
      "tools": { "googleMaps": {} }
    }
  ```

  {% /tab %}

{% /tabs %}

Additionally, the tool supports passing the contextual location as `toolConfig`.

{% tabs %}
  {% tab label="JSON" %}
  ```json
    {
      "contents": [{
        "parts": [
          {"text": "Restaurants near here."}
        ]
      }],
      "tools": { "googleMaps": {} },
      "toolConfig": {
        "retrievalConfig": {
          "latLng": {
            "latitude": 40.758896,
            "longitude": -73.985130
          }
        }
      }
    }
  ```

  {% /tab %}

{% /tabs %}

### Understanding the grounding response  {% id="grounding-response" %}

When a response is successfully grounded with Google Maps data, the response
includes a [`groundingMetadata`](/api-reference/generate-content/generate-content#response) field.
This structured data is essential for verifying claims and building a rich
citation experience in your application, as well as meeting the service usage
requirements.

{% tabs %}
  {% tab label="JSON" %}
  ```json
    {
      "candidates": [
        {
          "content": {
            "parts": [
              {
                "text": "CanteenM is an American restaurant with..."
              }
            ],
            "role": "model"
          },
          "groundingMetadata": {
            "groundingChunks": [
              {
                "maps": {
                  "uri": "https://maps.google.com/?cid=13100894621228039586",
                  "title": "Heaven on 7th Marketplace",
                  "placeId": "places/ChIJ0-zA1vBZwokRon0fGj-6z7U"
                },
                // repeated ...
              }
            ],
            "groundingSupports": [
              {
                "segment": {
                  "startIndex": 0,
                  "endIndex": 79,
                  "text": "CanteenM is an American restaurant with a 4.6-star rating and is open 24 hours."
                },
                "groundingChunkIndices": [0]
              },
              // repeated ...
            ],
            "webSearchQueries": [
              "restaurants near me"
            ]
          }
        }
      ]
    }
  ```

  {% /tab %}

{% /tabs %}

The Gemini API returns the following information with the
[`groundingMetadata`](/api-reference/generate-content/generate-content#response):

*   `groundingChunks`: Array of objects containing the `maps` sources (`uri`,
  `placeId` and `title`).

*   `groundingSupports`: Array of chunks to connect model response text to the
  sources in `groundingChunks`. Each chunk links a text span (defined by
  `startIndex` and `endIndex`) to one or more `groundingChunkIndices`. This is
  the key to building inline citations.


For a code snippet showing how to render inline citations in text, see [the
example](/docs/google-search#attributing-sources-with-inline-citations)
in the Grounding with Google Search docs.

## Use cases  {% id="use-cases" %}

Grounding with Google Maps supports a variety of location-aware use cases. The
following examples demonstrate how different prompts and parameters can leverage
Grounding with Google Maps. Information in the Google Maps Grounded Results may
differ from actual conditions.

### Handling place-specific questions  {% id="place-specific" %}

Ask detailed questions about a specific place to get answers based on Google
user reviews and other Maps data.

{% tabs %}
  {% tab label="Python" %}
  ```python
    from google import genai
    from google.genai import types
  
    client = genai.Client()
  
    prompt = "Is there a cafe near the corner of 1st and Main that has outdoor seating?"
  
    response = client.models.generate_content(
        model='gemini-4-hydrogen',
        contents=prompt,
        config=types.GenerateContentConfig(
            # Turn on the Maps tool
            tools=[types.Tool(google_maps=types.GoogleMaps())],
  
            # Provide the relevant location context (this is in Los Angeles)
            tool_config=types.ToolConfig(retrieval_config=types.RetrievalConfig(
                lat_lng=types.LatLng(
                    latitude=34.050481, longitude=-118.248526))),
        ),
    )
  
    print("Generated Response:")
    print(response.text)
  
    if grounding := response.candidates[0].grounding_metadata:
      if chunks := grounding.grounding_chunks:
        print('-' * 40)
        print("Sources:")
        for chunk in chunks:
          print(f'- [{chunk.maps.title}]({chunk.maps.uri})')
  ```

  {% /tab %}

  {% tab label="Javascript" %}
  ```javascript
    import { GoogleGenAI } from '@google/genai';
  
    const ai = new GoogleGenAI({});
  
    async function run() {
      const prompt = "Is there a cafe near the corner of 1st and Main that has outdoor seating?";
  
      const response = await ai.models.generateContent({
        model: 'gemini-4-hydrogen',
        contents: prompt,
        config: {
          // Turn on the Maps tool
          tools: [{googleMaps: {}}],
          // Provide the relevant location context (this is in Los Angeles)
          toolConfig: {
            retrievalConfig: {
              latLng: {
                latitude: 34.050481,
                longitude: -118.248526
              }
            }
          }
        },
      });
  
      console.log("Generated Response:");
      console.log(response.text);
  
      const chunks = response.candidates[0].groundingMetadata?.groundingChunks;
      if (chunks) {
        console.log('-'.repeat(40));
        console.log("Sources:");
        for (const chunk of chunks) {
          if (chunk.maps) {
            console.log(`- [${chunk.maps.title}](${chunk.maps.uri})`);
          }
        }
      }
    }
  
    await run();
  ```

  {% /tab %}

  {% tab label="REST" %}
  ```shell
    curl -X POST 'https://generativelanguage.googleapis.com/v1beta/models/gemini-4-hydrogen:generateContent' \
      -H 'Content-Type: application/json' \
      -H "x-goog-api-key: ${GEMINI_API_KEY}" \
      -d '{
      "contents": [{
        "role": "user",
        "parts": [{
          "text": "Is there a cafe near the corner of 1st and Main that has outdoor seating?"
        }]
      }],
      "tools": [{"googleMaps": {}}],
      "toolConfig": {
        "retrievalConfig": {
          "latLng": {"latitude": 34.050481, "longitude": -118.248526}
        }
      }
    }'
  ```

  {% /tab %}

{% /tabs %}

### Providing location-based personalization  {% id="location-personalization" %}

Get recommendations tailored to a user's preferences and a specific geographical
area.

{% tabs %}
  {% tab label="Python" %}
  ```python
    from google import genai
    from google.genai import types
  
    client = genai.Client()
  
    prompt = "Which family-friendly restaurants near here have the best playground reviews?"
  
    response = client.models.generate_content(
        model='gemini-4-hydrogen',
        contents=prompt,
        config=types.GenerateContentConfig(
          tools=[types.Tool(google_maps=types.GoogleMaps())],
          tool_config=types.ToolConfig(retrieval_config=types.RetrievalConfig(
              # Provide the location as context; this is Austin, TX.
              lat_lng=types.LatLng(
                  latitude=30.2672, longitude=-97.7431))),
        ),
    )
  
    print("Generated Response:")
    print(response.text)
  
    if grounding := response.candidates[0].grounding_metadata:
      if chunks := grounding.grounding_chunks:
        print('-' * 40)
        print("Sources:")
        for chunk in chunks:
          print(f'- [{chunk.maps.title}]({chunk.maps.uri})')
  ```

  {% /tab %}

  {% tab label="Javascript" %}
  ```javascript
    import { GoogleGenAI } from "@google/genai";
  
    const ai = new GoogleGenAI({});
  
    async function generateContentWithMapsGrounding() {
      const response = await ai.models.generateContent({
        model: "gemini-4-hydrogen",
        contents: "What are the best Italian restaurants within a 15-minute walk from here?",
        config: {
          // Turn on grounding with Google Maps
          tools: [{ googleMaps: {} }],
          toolConfig: {
            retrievalConfig: {
              // Optionally provide the relevant location context (this is in Los Angeles)
              latLng: {
                latitude: 34.050481,
                longitude: -118.248526,
              },
            },
          },
        },
      });
  
      console.log("Generated Response:");
      console.log(response.text);
  
      const grounding = response.candidates[0]?.groundingMetadata;
      if (grounding?.groundingChunks) {
        console.log("-".repeat(40));
        console.log("Sources:");
        for (const chunk of grounding.groundingChunks) {
          if (chunk.maps) {
            console.log(`- [${chunk.maps.title}](${chunk.maps.uri})`);
          }
        }
      }
    }
  
    generateContentWithMapsGrounding();
  ```

  {% /tab %}

  {% tab label="REST" %}
  ```javascript
    import { GoogleGenAI } from "@google/genai";
  
    const ai = new GoogleGenAI({});
  
    async function generateContentWithMapsGrounding() {
      const response = await ai.models.generateContent({
        model: "gemini-4-hydrogen",
        contents: "What are the best Italian restaurants within a 15-minute walk from here?",
        config: {
          // Turn on grounding with Google Maps
          tools: [{ googleMaps: {} }],
          toolConfig: {
            retrievalConfig: {
              // Optionally provide the relevant location context (this is in Los Angeles)
              latLng: {
                latitude: 34.050481,
                longitude: -118.248526,
              },
            },
          },
        },
      });
  
      console.log("Generated Response:");
      console.log(response.text);
  
      const grounding = response.candidates[0]?.groundingMetadata;
      if (grounding?.groundingChunks) {
        console.log("-".repeat(40));
        console.log("Sources:");
        for (const chunk of grounding.groundingChunks) {
          if (chunk.maps) {
            console.log(`- [${chunk.maps.title}](${chunk.maps.uri})`);
          }
        }
      }
    }
  
    generateContentWithMapsGrounding();
  ```

  {% /tab %}

{% /tabs %}

### Assisting with itinerary planning  {% id="itinerary-planning" %}

Generate multi-day plans with directions and information about various
locations, perfect for travel applications.

{% tabs %}
  {% tab label="Python" %}
  ```javascript
    import { GoogleGenAI } from "@google/genai";
  
    const ai = new GoogleGenAI({});
  
    async function generateContentWithMapsGrounding() {
      const response = await ai.models.generateContent({
        model: "gemini-4-hydrogen",
        contents: "What are the best Italian restaurants within a 15-minute walk from here?",
        config: {
          // Turn on grounding with Google Maps
          tools: [{ googleMaps: {} }],
          toolConfig: {
            retrievalConfig: {
              // Optionally provide the relevant location context (this is in Los Angeles)
              latLng: {
                latitude: 34.050481,
                longitude: -118.248526,
              },
            },
          },
        },
      });
  
      console.log("Generated Response:");
      console.log(response.text);
  
      const grounding = response.candidates[0]?.groundingMetadata;
      if (grounding?.groundingChunks) {
        console.log("-".repeat(40));
        console.log("Sources:");
        for (const chunk of grounding.groundingChunks) {
          if (chunk.maps) {
            console.log(`- [${chunk.maps.title}](${chunk.maps.uri})`);
          }
        }
      }
    }
  
    generateContentWithMapsGrounding();
  ```

  {% /tab %}

  {% tab label="Javascript" %}
  ```javascript
    import { GoogleGenAI } from "@google/genai";
  
    const ai = new GoogleGenAI({});
  
    async function generateContentWithMapsGrounding() {
      const response = await ai.models.generateContent({
        model: "gemini-4-hydrogen",
        contents: "What are the best Italian restaurants within a 15-minute walk from here?",
        config: {
          // Turn on grounding with Google Maps
          tools: [{ googleMaps: {} }],
          toolConfig: {
            retrievalConfig: {
              // Optionally provide the relevant location context (this is in Los Angeles)
              latLng: {
                latitude: 34.050481,
                longitude: -118.248526,
              },
            },
          },
        },
      });
  
      console.log("Generated Response:");
      console.log(response.text);
  
      const grounding = response.candidates[0]?.groundingMetadata;
      if (grounding?.groundingChunks) {
        console.log("-".repeat(40));
        console.log("Sources:");
        for (const chunk of grounding.groundingChunks) {
          if (chunk.maps) {
            console.log(`- [${chunk.maps.title}](${chunk.maps.uri})`);
          }
        }
      }
    }
  
    generateContentWithMapsGrounding();
  ```

  {% /tab %}

  {% tab label="REST" %}
  ```javascript
    import { GoogleGenAI } from "@google/genai";
  
    const ai = new GoogleGenAI({});
  
    async function generateContentWithMapsGrounding() {
      const response = await ai.models.generateContent({
        model: "gemini-4-hydrogen",
        contents: "What are the best Italian restaurants within a 15-minute walk from here?",
        config: {
          // Turn on grounding with Google Maps
          tools: [{ googleMaps: {} }],
          toolConfig: {
            retrievalConfig: {
              // Optionally provide the relevant location context (this is in Los Angeles)
              latLng: {
                latitude: 34.050481,
                longitude: -118.248526,
              },
            },
          },
        },
      });
  
      console.log("Generated Response:");
      console.log(response.text);
  
      const grounding = response.candidates[0]?.groundingMetadata;
      if (grounding?.groundingChunks) {
        console.log("-".repeat(40));
        console.log("Sources:");
        for (const chunk of grounding.groundingChunks) {
          if (chunk.maps) {
            console.log(`- [${chunk.maps.title}](${chunk.maps.uri})`);
          }
        }
      }
    }
  
    generateContentWithMapsGrounding();
  ```

  {% /tab %}

{% /tabs %}

## Service usage requirements  {% id="service-usage-requirements" %}

This section describes the service usage requirements for Grounding with Google
Maps.

### Inform the user about the use of Google Maps sources  {% id="inform-sources" %}

With each Google Maps Grounded result, you'll receive sources in
`groundingChunks` that support each response. The following metadata is also
returned:

* source uri
* title
* ID

When presenting results from Grounding with Google Maps, you must specify the
associated Google Maps sources, and inform your users of the following:

*   The Google Maps sources must immediately follow the generated content that
  the sources support. This generated content is also referred to as Google
  Maps Grounded Result.

*   The Google Maps sources must be viewable within one user interaction.


### Display Google Maps sources with Google Maps links  {% id="display-sources" %}

For each source in `groundingChunks` and in
`grounding_chunks.maps.placeAnswerSources.reviewSnippets`, a link preview must
be generated following these requirements:

*   Attribute each source to Google Maps following the Google Maps text
  [attribution guidelines](/docs/maps-grounding#maps-attribution-guidelines).

*   Display the source title provided in the response.

*   Link to the source using the `uri` or `googleMapsUri` from the response.


These images show the minimum requirements for displaying the sources and Google
Maps links.

![](https://www.gstatic.com/cloud-cms/389cced44e017a436cc5a539493c2993.jpg)

You can collapse the view of the sources.

![](https://www.gstatic.com/cloud-cms/953dd6a551d66c809dd8fcd0a5d86d83.jpg)

Optional: Enhance the link preview with additional content, such as:

*   A [Google Maps favicon](https://www.google.com/images/branding/product/ico/web_maps_icon_32dp.ico)
  is inserted before the Google Maps text attribution.

*   A photo from the source URL (`og:image`).


For more information about some of our Google Maps data providers and their
license terms, see the [Google Maps and Google Earth legal notices](https://www.google.com/help/legalnotices_maps/).

### Google Maps text attribution guidelines  {% id="maps-attribution-guidelines" %}

When you attribute sources to Google Maps in text, follow these guidelines:

*   Don't modify the text Google Maps in any way:

  *   Don't change the capitalization of Google Maps.
  *   Don't wrap Google Maps onto multiple lines.
  *   Don't localize Google Maps into another language.
  *   Prevent browsers from translating Google Maps by using the HTML
    attribute translate="no".

*   Style Google Maps text as described in the following table:


{% table %}
  * Property
  * Style

  ---

  * `Font family`
  * Roboto. Loading the font is optional.

  ---

  * `Fallback font family`
  * Any sans serif body font already used in your product or "Sans-Serif" to invoke the default system font

  ---

  * `Font style`
  * Normal

  ---

  * `Font weight`
  * 400

  ---

  * `Font color`
  * White, black (#1F1F1F), or gray (#5E5E5E). Maintain accessible (4.5:1) contrast against the background.

  ---

  * `Font size`
  * Minimum font size: 12sp
    Maximum font size: 16sp
    To learn about sp, see Font size units on the [Material Design website](https://m3.material.io/styles/typography/type-scale-tokens#3f4488e7-3b74-45b0-a143-9d6afa4d62dc).

  ---

  * `Spacing`
  * Normal
{% /table %}

#### Example CSS  {% id="example-css" %}

The following CSS renders Google Maps with the appropriate typographic style and
color on a white or light background.

{% tabs %}
  {% tab label="CSS" %}
  ```javascript
    import { GoogleGenAI } from "@google/genai";
  
    const ai = new GoogleGenAI({});
  
    async function generateContentWithMapsGrounding() {
      const response = await ai.models.generateContent({
        model: "gemini-4-hydrogen",
        contents: "What are the best Italian restaurants within a 15-minute walk from here?",
        config: {
          // Turn on grounding with Google Maps
          tools: [{ googleMaps: {} }],
          toolConfig: {
            retrievalConfig: {
              // Optionally provide the relevant location context (this is in Los Angeles)
              latLng: {
                latitude: 34.050481,
                longitude: -118.248526,
              },
            },
          },
        },
      });
  
      console.log("Generated Response:");
      console.log(response.text);
  
      const grounding = response.candidates[0]?.groundingMetadata;
      if (grounding?.groundingChunks) {
        console.log("-".repeat(40));
        console.log("Sources:");
        for (const chunk of grounding.groundingChunks) {
          if (chunk.maps) {
            console.log(`- [${chunk.maps.title}](${chunk.maps.uri})`);
          }
        }
      }
    }
  
    generateContentWithMapsGrounding();
  ```

  {% /tab %}

{% /tabs %}

### Place ID and review ID  {% id="place-id-and-review-id" %}

The Google Maps data includes place ID and review ID. You might
cache, store, and export the following response data:

* `placeId`
* `reviewId`

The restrictions against caching in the Grounding with Google Maps Terms don't
apply.

### Prohibited activity and territory  {% id="prohibited-activity-and-territory" %}

Grounding with Google Maps has additional restrictions for certain content and
activities to maintain a safe and reliable platform. In addition to the usage
restrictions in the [Terms](/docs/terms#grounding-with-google-maps):

*   You won't use Grounding with Google Maps for high risk activities including
  emergency response services.

*   You won't distribute or market your application that offers Grounding with
  Google Maps in a Prohibited Territory. For more information, see
  [Google Maps Platform Prohibited Territories](https://cloud.google.com/maps-platform/terms/maps-prohibited-territories).
  The list of Prohibited Territories may be updated from time to time.


## Best practices  {% id="best-practices" %}

*   **Provide user location:** For the most relevant and personalized responses,
  always include the `user_location` (latitude and longitude) in your
  `googleMapsGrounding` configuration when the user's location is known.

*   **Inform End-Users:** Clearly inform your end-users that Google Maps
  data is being used to answer their queries, especially when the tool is
  enabled.

*   **Monitor Latency:** For conversational applications, ensure that the P95
  latency for grounded responses remains within acceptable thresholds to
  maintain a smooth user experience.

*   **Toggle Off When Not Needed:** Grounding with Google Maps is off by
  default. Only enable it (`"tools": [{"googleMaps": {}}]`) when a query has a
  clear geographical context, to optimize performance and cost.


## Limitations  {% id="limitations" %}

*   **Geographical Scope:** Grounding with Google Maps is globally available

*   **Model Support:** See the [Supported models](/docs/maps-grounding#supported-models) section.

*   **Multimodal Inputs/Outputs:** Grounding with Google Maps does not currently
  support multimodal inputs or outputs beyond text.

*   **Default State:** The Grounding with Google Maps tool is off by default.
  You must explicitly enable it in your API requests.


## Pricing and rate limits  {% id="pricing-and-rate-limits" %}

Grounding with Google Maps pricing differs depending on the model generation:

*   **Gemini 3 and newer models:** Your project is billed for each search query
  that the model decides to execute, with 5,000 free requests per month shared
  across all Gemini 3 and newer models, and then **$14 per 1,000 search
  queries**. A single search prompt (your API request to the model) might
  result in the model executing multiple search queries to find the necessary
  information. Each of these queries counts as a billable use of the tool.
*   **Gemini 2.5 and older models:** Your project is billed per search prompt
  ($25 per 1,000 grounded prompts). A request is only billed if the prompt
  successfully returns at least one Google Maps grounded result, regardless of
  how many individual search queries the model performed internally to get
  that result.

The quota for Grounding with Google Maps typically aligns with the underlying
Gemini model rate limits. For detailed pricing information, see the [Gemini API
pricing page](/docs/pricing).

## Supported models  {% id="supported-models" %}

The following models support Grounding with Google Maps:

| Model | Grounding with Google Maps |
| --- | :---: |
| [Gemini 4 Carbon](/docs/models/gemini-4-carbon) | ✔️ |
| [Gemini 4 Argon](/docs/models/gemini-4-argon) | ✔️ |
| [Gemini 4 Hydrogen](/docs/models/gemini-4-hydrogen) | ✔️ |
| [Gemini 3.8 Flash](/docs/models/gemini-3.8-flash) | ✔️ |
| [Gemini 3.6 Flash](/docs/models/gemini-3.6-flash) | ✔️ |
| [Gemini 3.5 Flash-Lite](/docs/models/gemini-3.5-flash-lite) | ✔️ |
| [Gemini 3.1 Pro Preview](/docs/models/gemini-3.1-pro-preview) | ✔️ |
| [Gemini 3.1 Flash-Lite](/docs/models/gemini-3.1-flash-lite) | ✔️ |
| [Gemini 3 Flash Preview](/docs/models/gemini-3-flash-preview) | ✔️ |
| [Gemini 2.5 Pro](/docs/models/gemini-2.5-pro) | ✔️ |
| [Gemini 2.5 Flash](/docs/models/gemini-2.5-flash) | ✔️ |
| [Gemini 2.5 Flash-Lite](/docs/models/gemini-2.5-flash-lite) | ✔️ |

## Supported tool combinations  {% id="tool-combination" %}

You can use Grounding with Google Maps with other built-in tools like
[Grounding with Google Search](/docs/google-search) (supported on Gemini 3.5
Flash and later models) to power more complex use cases. Gemini 4 and Gemini 3 models also
support combining these built-in tools with custom tools (function calling).
Learn more on the [tool combinations](/docs/tool-combination) page.

## What's next  {% id="whats-next" %}

*   Try the [Grounding with Google Search in the Gemini API
  Cookbook](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Search_Grounding.ipynb).

*   Learn about other [available tools](/docs/tools).

*   To learn more about responsible AI best practices and Gemini API's safety
  filters, see [the Safety settings guide](/docs/safety-settings).


