You're all set!

To start developing, please head over to our developer documentation.

Activate the Google Street View Image API

To get you started we'll guide you through the Google Developers Console to do a few things first:

  1. Create or choose a project
  2. Activate the Google Street View Image API
  3. Create appropriate keys
Continue

Street View Image Metadata

Introduction

The Google Street View Image API metadata requests provide data about Street View panoramas. Using the metadata, you can find out if a Street View image is available at a given location, as well as getting programmatic access to the latitude and longitude, the panorama ID, the date the photo was taken, and the copyright information for the image. Accessing this metadata allows you to customize error behavior in your application.

Google Street View Image API metadata requests are free to use. No quota is consumed when you request metadata. Quota is only consumed when you load an image using the Google Street View Image API.

Accessing the imagery metadata

A Street View image metadata request is an HTTP URL of the following form:

https://maps.googleapis.com/maps/api/streetview/metadata?parameters

Note: the https:// protocol is required for metadata requests.

As is standard in URLs, all parameters are separated using the ampersand (&) character.

Required parameters for metadata requests

The metadata requests accept the same URL parameters as the Street View Image API imagery requests, although only the following parameters are required:

Either:

  • location — can be either a text string (such as Chagrin Falls, OH) or a comma-separated pair of latitude/longitude coordinates (40.457375,-80.009353).

Or:

  • pano — a specific panorama ID. These are generally stable, though panoramas may change ID over time as imagery is refreshed.

As well as:

  • key or client and signature — the API key or client ID are credentials required to authenticate the request. The digital signature is also required in certain instances. For more information, see Get a Key and Signature.

Optional parameters for metadata requests

You can include the following parameters in your metadata request: size, heading, fov, and pitch. Note that these parameters do not influence the data about the panorama, or which panorama is found. The API allows the inclusion of the same parameters as the imagery request to make it easier to construct a metadata request related to a specific imagery request, but for metadata requests, the API ignores the optional parameters and their values. See the Street View Image API developer's guide for information about using these parameters.

Response format

Metadata responses are returned in JSON format only.

Examples

Example 1: Panorama found

The following URLs successfully request the metadata and image of the same panorama.

Metadata request and response

https://maps.googleapis.com/maps/api/streetview/metadata?size=600x300&location=eiffel%20tower,%20paris,%20france&heading=-45&pitch=42&fov=110&key=YOUR_API_KEY
{
   "copyright" : "© 2017 Google",
   "date" : "2016-05",
   "location" : {
      "lat" : 48.85783227207914,
      "lng" : 2.295226175151347
   },
   "pano_id" : "tu510ie_z4ptBZYo2BGEJg",
   "status" : "OK"
}

Imagery request and response

https://maps.googleapis.com/maps/api/streetview?size=600x300&location=eiffel%20tower,%20paris,%20france&heading=-45&pitch=42&fov=110&key=YOUR_API_KEY

Example 2: Panorama not found

The following URLs request the metadata and image for a panorama that could not be found at or near the specfied location.

Metadata request and response

https://maps.googleapis.com/maps/api/streetview/metadata?size=600x300&location=78.648401,14.194336&fov=90&heading=235&pitch=10&key=YOUR_API_KEY
{
   "status" : "ZERO_RESULTS"
}

Imagery request and response

https://maps.googleapis.com/maps/api/streetview?size=600x300&location=78.648401,14.194336&fov=90&heading=235&pitch=10&key=YOUR_API_KEY

Status codes

The status field within the metadata response object contains the status of the request, and may contain debugging information to help you troubleshoot why the Street View request is not working. The status field may contain the following values:

Status Description
"OK" Indicates that no errors occurred; a panorama is found and metadata is returned.
"ZERO_RESULTS" Indicates that no panorama could be found near the provided location. This may occur if a non-existent or invalid panorama ID is given.
"NOT_FOUND" Indicates that the address string provided in the location parameter could not be found. This may occur if a non-existent address is given.
"OVER_QUERY_LIMIT" Indicates that you have exceeded your daily quota or per-second quota for this API.
"REQUEST_DENIED" Indicates that your request was denied. This may occur if you did not use an API key or client ID, or if the Google Street View Image API is not activated in the Google API Console project containing your API key.
"INVALID_REQUEST" Generally indicates that the query parameters (address or latlng or components) are missing.
"UNKNOWN_ERROR" Indicates that the request could not be processed due to a server error. This is often a temporary status. The request may succeed if you try again.

More information

For more information on using the Google Street View Image API, or other Google Maps API products, be sure to check out the Maps API Support page.

Send feedback about...

Google Street View Image API
Need help? Visit our support page.