Introduction
The Google Street View Image API lets you embed a static (non-interactive) Street View panorama or thumbnail into your web page, without the use of JavaScript. The viewport is defined with URL parameters sent through a standard HTTP request, and is returned as a static image.
https://maps.googleapis.com/maps/api/streetview?size=400x400&location=40.720032,-73.988354 &fov=90&heading=235&pitch=10 &key=YOUR_API_KEY
URL Parameters
A Street View Image request is an HTTP URL of the following form:
https://maps.googleapis.com/maps/api/streetview?parameters
The image is specified using request parameters. As is standard in URLs, all parameters are separated using the ampersand (&) character. Allowed parameters and their possible values are listed below.
Required parameters
Either:
locationcan be either a text string (such asChagrin Falls, OH) or a lat/lng value (40.457375,-80.009353). The Google Street View Image API will snap to the panorama photographed closest to this location. Because Street View imagery is periodically refreshed, and photographs may be taken from slightly different positions each time, it's possible that yourlocationmay snap to a different panorama when imagery is updated.
Or:
panois a specific panorama ID. These are generally stable.
As well as:
sizespecifies the output size of the image in pixels. Size is specified as{width}x{height}- for example,size=600x400returns an image 600 pixels wide, and 400 high.keyallows you to monitor your application's API usage in the Google Developers Console; enables per-key instead of per-IP-address quota limits; and ensures that Google can contact you about your application if necessary. For more information, see Get a Key and Signature.Note: Google Maps APIs Premium Plan customers may use either an API key and digital signature, or a valid client ID and digital signature, in your Street View requests. Get more information on authentication parameters for Premium Plan customers.
Optional parameters
signature(recommended) is a digital signature used to verify that any site generating requests using your API key is authorized to do so. For more information, see Get a Key and Signature.headingindicates the compass heading of the camera. Accepted values are from0to360(both values indicating North, with90indicating East, and180South). If no heading is specified, a value will be calculated that directs the camera towards the specifiedlocation, from the point at which the closest photograph was taken.fov(default is90) determines the horizontal field of view of the image. The field of view is expressed in degrees, with a maximum allowed value of120. When dealing with a fixed-size viewport, as with a Street View image of a set size, field of view in essence represents zoom, with smaller numbers indicating a higher level of zoom.
(Left:fov=120; Right:fov=20)pitch(default is0) specifies the up or down angle of the camera relative to the Street View vehicle. This is often, but not always, flat horizontal. Positive values angle the camera up (with90degrees indicating straight up); negative values angle the camera down (with-90indicating straight down).
An example request is shown below.
https://maps.googleapis.com/maps/api/streetview?size=600x300&location=46.414382,10.013988&heading=151.78&pitch=-0.76&key=YOUR_API_KEY
The sensor Parameter
The Google Street View Image API previously required that you include the
sensor parameter to indicate whether your application used a
sensor to determine the user's location. This parameter is no longer
required.
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.
