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
API Key
Note: Maps for Work users must include
client
and signature
parameters with their requests instead of a key.
All Street View API applications should use an API key. Including a key in your request:
- Allows you to monitor your application's API usage in the Google APIs Console.
- Enables per-key instead of per-IP-address quota limits.
- Ensures that Google can contact you about your application if necessary.
The Street View API uses an API key to identify your application. API keys are managed through the Google APIs console. To create your key:
- Visit the APIs console at Google APIs Console and log in with your Google Account.
- Click the Services link from the left-hand menu in the APIs Console, then activate the Street View API service.
- Once the service has been activated, your API key is available from the API Access page, in the Simple API Access section. Street View API applications use the Key for server apps.
To specify a key in your request, include it as the value of a
key
parameter.
Note: By default, a key can be used from any server. We strongly recommend that you restrict the use of your key by IP address to servers that you administer. You can specify which IP addresses are allowed to use your API key by clicking the Edit allowed referers... link in the API console.
Note: HTTPS is enforced for requests that include an API key.
Examples in this document exclude the key
parameter so that they
will work for people who cut and paste the code.
To specify a key in your request, include it as the value of a
key
parameter:
https://maps.googleapis.com/maps/api/streetview?size=400x400&location=40.720032,-73.988354&key=API_KEY
Usage Limits
Google Maps API for Work customers have different quotas than those listed below. A Static Street View request is considered a 'page view' for the purposes of Google Maps API for Work quota management and is applied against the total number of page views purchased with the Google Maps API for Work license.
Most websites and applications may use the Google Street View API free of charge. However, if you consistently generate a high amount of traffic, usage limits apply and you will need to pay for extra usage. If your site or application generates 25 000 Street View image requests or more each day, for more than 90 consecutive days, we'll attempt to get in touch with you to talk about payment. Don't worry, if you go over the limits, we won't immediately shut off your API access or display error messages on your site.
If you think your website or application will generate high Street View image requests consistently in the long term, you should consider one of the following options:
- Modify your application so that your usage is less than 25 000 Street View image requests per day.
- Enroll for automated billing of excess image requests in the Google APIs Console. Additional image requests can be purchased at the rate currently listed in the FAQ.
- Purchase a Google Maps API for Work license.
Image Sizes
Street View images can be returned in any size up to 640 by 640 pixels.
Google Maps API for Work customers who are correctly signing their URLs can request images up to 2048 by 2048 pixels.
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:
location
can be either a text string (such asChagrin Falls, OH
) or a lat/lng value (40.457375,-80.009353
). The 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 yourlocation
may snap to a different panorama when imagery is updated.
Or:
pano
is a specific panorama ID. These are generally stable.
As well as:
size
specifies the output size of the image in pixels. Size is specified as{width}x{height}
- for example,size=600x400
returns an image 600 pixels wide, and 400 high.
Google Maps API for Work users must include valid
client
and signature
parameters with their
requests. Please refer to the
Google Maps API for Work Web
Services chapter for more information.
Optional parameters
heading
indicates the compass heading of the camera. Accepted values are from0
to360
(both values indicating North, with90
indicating East, and180
South). 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 (with90
degrees indicating straight up); negative values angle the camera down (with-90
indicating straight down).key
(optional) identifies your application for quota purposes, and enables reports in the Google APIs Console. For information about obtaining a unique key for your application, please read the API Key section of this document.
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
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 Street View Image API, or other Google Maps API products, be sure to check out the Maps API Support page.