Skip to main content

Add the new Google Maps to your Website with Street View

Google Maps open on a laptop screen showing a city street

Short answer: Use the official Google Maps Embed API. Get a free API key, drop a single iframe into your page with mode set to a map, place or streetview, and add a little CSS to make it responsive. No JavaScript required.

I embed maps on client sites all the time, and the cleanest current method is Google's own Maps Embed API. It lets you show a road map, satellite view, a specific place, directions, or an interactive Street View panorama, all through one iframe. Here is how I set it up from scratch.

What is the Maps Embed API?

The Maps Embed API is Google's officially supported way to put a map on a web page using a plain iframe rather than loading the full JavaScript maps library. It supports several modes, including place, view, directions, search and, the one people most often want, streetview. Because it is just an iframe, it works on any site including static HTML, WordPress and most CMS platforms.

Do I need an API key, and is it free?

Yes, you need a free API key, and for the Embed API the standard map, place, directions, search and Street View embeds are offered at no cost. Here is how to get the key.

  1. Go to the Google Cloud Console and create or select a project.
  2. Open APIs & Services > Library and enable Maps Embed API.
  3. Go to APIs & Services > Credentials and click Create credentials > API key.
  4. Copy the key. Immediately restrict it (more on that below).

How do I embed a standard map?

Once you have a key, a basic place map is a single iframe. Replace YOUR_API_KEY and the query with your own values.

<iframe
  width="600" height="450"
  style="border:0"
  loading="lazy"
  allowfullscreen
  referrerpolicy="no-referrer-when-downgrade"
  src="https://www.google.com/maps/embed/v1/place?key=YOUR_API_KEY&q=Brandenburg+Gate,Berlin">
</iframe>

How do I embed Street View?

This is the mode the classic embed dropped, and the Embed API brings it back cleanly. Use the streetview mode and give it coordinates plus an optional heading and pitch.

<iframe
  width="600" height="450"
  style="border:0"
  loading="lazy"
  allowfullscreen
  src="https://www.google.com/maps/embed/v1/streetview?key=YOUR_API_KEY&location=52.5163,13.3777&heading=210&pitch=10&fov=90">
</iframe>

The location is latitude and longitude, heading is the compass direction the camera faces, pitch tilts up or down, and fov sets the zoom. I grab the coordinates by right-clicking the spot in Google Maps and copying the lat/long.

How do I make the embed responsive?

The fixed width and height look wrong on phones. I wrap the iframe in a container that keeps a 16:9 ratio so it scales with the page.

<div style="position:relative; padding-bottom:56.25%; height:0; overflow:hidden;">
  <iframe
    style="position:absolute; top:0; left:0; width:100%; height:100%; border:0;"
    loading="lazy" allowfullscreen
    src="https://www.google.com/maps/embed/v1/place?key=YOUR_API_KEY&q=Eiffel+Tower,Paris">
  </iframe>
</div>

Embed modes at a glance

ModeShowsKey parameter
placeA pin on a specific locationq
viewA map centered on coordinatescenter
directionsA route between pointsorigin, destination
searchResults for a queryq
streetviewAn interactive panoramalocation or pano

A tip most guides skip: restrict your API key

Because the key sits in your public HTML, anyone can read it. The fix is not to hide it, it is to restrict it. In the Cloud Console, edit the key and add an HTTP referrer restriction listing only your own domains, and limit the key to the Maps Embed API only. Now even if someone copies your key, it will not work on their site and cannot be used for other paid Google APIs. Skipping this is the most common mistake I see, and on paid APIs it can lead to a surprise bill.

Frequently asked questions

Do I really need an API key to embed a Google Map?

Yes. The official Maps Embed API requires a free API key. Get one in the Google Cloud Console by enabling the Maps Embed API and creating an API key credential.

Can I still embed Street View panoramas?

Yes. Use the streetview mode of the Maps Embed API with a location or pano ID plus optional heading, pitch and field of view parameters. It produces an interactive panorama inside an iframe.

Is the Maps Embed API free?

The standard map, place, view, directions, search and Street View embeds through the Maps Embed API are offered at no cost. Always confirm current pricing in the Google Maps Platform documentation.

How do I stop others from stealing my API key?

Restrict the key in the Cloud Console. Add an HTTP referrer restriction limiting it to your own domains, and restrict it to only the Maps Embed API so it cannot be abused for other services.

Comments

Popular posts from this blog

How to Completely Uninstall Programs on Windows (Free Tools and Tips)

Short answer: you do not need a cracked Revo Uninstaller Pro, because Revo has a capable free version and there are free open-source alternatives that remove programs completely, leftover files and registry entries included. Here is how to uninstall cleanly and why leftovers matter. Why leftovers are a problem Windows' built-in uninstaller often leaves behind folders, registry keys and startup entries. Over time these accumulate, clutter your system, and occasionally cause conflicts when you reinstall software. A dedicated uninstaller sweeps them up. Free tools that remove programs completely Revo Uninstaller Free , uninstalls the program, then scans for and removes leftover files and registry entries. The free version covers what most people need. Bulk Crap Uninstaller , free, open source, and excellent for removing many programs at once and cleaning leftovers. How to uninstall cleanly with Revo Free Open Revo and select the program. Click Uninstall; let the progra...

How to Recover Deleted Files for Free (Better Than a Cracked Tool)

Short answer: you do not need a cracked 7-Data Recovery serial, because excellent free tools like Recuva and PhotoRec recover deleted files, and the most important factor is not the software at all, it is stopping use of the drive immediately. Here is how to recover files the safe, effective way. The one rule that decides success: stop using the drive When you delete a file, the data is not erased, the space is just marked reusable. The moment you keep saving new files, you risk overwriting the deleted data permanently. So the instant you realize something is gone: stop using that drive . Do not install recovery software onto it either, download it to a different drive or USB stick. The best free recovery tools Recuva , free, friendly, great for recovering deleted documents, photos and files from Windows drives and USB sticks. PhotoRec , free and open source, extremely powerful, especially for photos and media, though its interface is basic. Windows File History / backups , ...

How to Transfer Contacts Between Phones the Easy Way (2026)

Short answer: The easiest way to move contacts is to sync them to a cloud account first. Save contacts to your Google account on Android or iCloud on iPhone, then sign in to that same account on the new phone and they appear automatically. For everything else, export a vCard (.vcf) file and import it. Every time I set up a new phone the very first thing I want back is my contacts. Years ago this meant fiddly SIM copies and desktop software. These days I almost never touch a cable. Here are the modern methods I actually use, ranked from easiest to most manual. Method 1: Google account sync (best for Android) If your contacts are saved to your Google account rather than the phone itself, switching Android phones is basically automatic. On the old phone, open Settings > Accounts > Google and confirm Contacts sync is on. Wait a minute for the sync to finish, or tap the three-dot menu and choose Sync now . On the new phone, sign in with the same Google account during setup....