Maps Static API quick reference

The Maps Static API returns a Google Maps image based on URL parameters sent in a standard HTTP request, so you can embed a map on a web page by using an img tag; no JavaScript or dynamic page loading is required.

Maps Static API: key facts

  • Product: Maps Static API
  • Also known as: Static Maps, Static Maps API
  • Category: Maps
  • Platform: Web service (REST)
  • Runs on: Server (backend code)
  • Launch stage: GA
  • Lifecycle: Active
  • Overview: Maps Static API overview

Maps Static API: when to use it

Use Maps Static API when:

  • You need to show a map image on a web page without JavaScript or dynamic page loading.
  • You need a map image inside a web page or mobile application, or on a device where the Maps JavaScript API isn't suitable.
  • You need a non-interactive map image with markers, paths, or polygons defined in URL parameters.
  • You need a styled static map, using style parameters or a map ID with cloud-based maps styling.

Don't use Maps Static API when:

  • You need an interactive map that users can pan, zoom, or click in a web page. Use Maps JavaScript API instead.
  • You need an interactive map inside a native Android app. Use Maps SDK for Android instead.
  • You need an interactive map inside a native iOS app. Use Maps SDK for iOS instead.
  • You need a static (non-interactive) Street View panorama image instead of a map. Use Street View Static API instead.

Maps Static API: setup

Maps Static API: common mistakes

  • Problem: Parameter values with separators such as the pipe character (|) aren't URL-encoded, so requests are malformed. Fix: URL-encode all parameters before sending the request (for example, encode | as %7C). See /maps/documentation/maps-static/start.
  • Problem: Depending on usage, requests with only an API key might need a digital signature; Google strongly recommends using both an API key and a signature. Fix: Sign requests with the URL signing secret from the Cloud console, and limit unsigned requests on the Quotas page. See /maps/documentation/maps-static/digital-signature.
  • Problem: Marker locations given as addresses, place IDs, or polylines need geocoding, and a request is limited to 15 such markers. Fix: Specify marker locations as latitude/longitude coordinates when you need more than 15 markers. See /maps/documentation/maps-static/start.
  • Problem: Downloading and serving copies of Maps Static API images from your own site instead of pointing directly to the Maps Static API URL. Fix: Point the img src (or CSS background-image) directly at the Maps Static API URL so Google serves the image. See /maps/faq.

What you can do with Maps Static API

See the guides linked below for each task, or compare across products in the Capabilities Explorer.

Maps Static API: Maps

Maps Static API: Maps annotations

  • Add a shape or line to a map.
  • Add a marker to a map. Note: Navigation SDK for Android does not support AdvancedMarkerOptions; when using Navigation SDK for Android, add markers with GoogleMap.addMarker(MarkerOptions).
  • Customize a marker on a map. Note: Navigation SDK for Android does not support AdvancedMarkerOptions; when using Navigation SDK for Android, customize markers with MarkerOptions.

Maps Static API: Maps styling