The Maps Embed API quickstart

Place an interactive map, or Street View panorama on your web page with a simple HTTP request—no JavaScript required.

Costs

All Maps Embed API requests are free with unlimited usage. For more information, see Usage and Billing.

Before you begin

To create an embedded map on your web page, complete the required setup steps by clicking through the following tabs:

Step 1

  1. In the Google Cloud Console, on the project selector page, click Create Project to begin creating a new Cloud project.

    Go to the project selector page

  2. Make sure that billing is enabled for your Cloud project. Confirm that billing is enabled for your project.

    Google Cloud offers a $300 free trial, and Google Maps Platform features a recurring $200 monthly credit. For more information, see Billing account credits and Billing.

Step 2

To use Google Maps Platform, you must enable the APIs or SDKs you plan to use with your project on Cloud Console.

Enable the Maps Embed API

Step 3

This step only goes through the API Key creation process. If you use your API Key in production, we strongly recommend that you restrict your API key. You can find more information in the product-specific Using API Keys page.

The API key is a unique identifier that authenticates requests associated with your project for usage and billing purposes. You must have at least one API key associated with your project.

To create an API key:

  1. Go to the APIs & Services > Credentials page.

    Go to the Credentials page

  2. On the Credentials page, click Create credentials > API key.
    The API key created dialog displays your newly created API key.
  3. Click Close.
    The new API key is listed on the Credentials page under API keys.
    (Remember to restrict the API key before using it in production.)

Generating an iframe

Click through the following options and add a location and API key to generate an iframe for your webpage. For additional parameters and options, see Embedding a map.

Testing your iframe

To see your iframe in an HTML browser window:

  1. Open your default text editor. You should have text editors such as TextEdit or Microsoft Windows Notepad installed on your device by default.
  2. Create an HTML file and name it index.html.
  3. Add the following code with the iframe you generated above:

    <html>
      <!-- Replace this code comment with your iframe. -->
    </html>
    
  4. Save your index.html HTML file.

  5. Load the HTML file in a web browser by dragging it from your desktop onto your browser; alternatively, double-clicking the file works on most operating systems.

Congratulations! You just set up and built a map using the Maps Embed API.

Cleaning up

You can delete your Google Cloud project to stop billing for all the resources used within that project.

  1. In the Google Cloud Console, go to the Manage resources page:

    Go to the Manage resources page

  2. If the project that you plan to delete is attached to an organization, select and expand the organization list at the top of the page.
  3. In the project list, select the project that you want to delete and click Delete.
  4. In the dialog, type the project ID and click Shut down to delete the project.

Next steps

  • Start developing with the Maps Embed API by setting up your Google Cloud project:

    Set up in Cloud Console

  • For a list of additional parameters and options you can add in your iframe:

    Embedding a map