## Introduction

The Street View Static 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 coordinates, the panorama ID, the date the photo was
taken, and the copyright information for the image. Accessing this
metadata lets you customize error behavior in your application.

> [!NOTE]
> **Note:** The value of the date field can vary:
>
> - The date field can have a different granularity for different panoramas. For example, the date field for some panoramas contains a year and month, while for others it contains just the year.
> - The date field is omitted if no data is available.

Street View Static API metadata requests are available at no
charge. No quota is consumed when you request metadata.
[Quota is only consumed](https://developers.google.com/maps/documentation/streetview/usage-limits) when you load an image using the
[Street View Static API](https://developers.google.com/maps/documentation/streetview/overview.md.txt).

When making Street View imagery metadata requests, the panorama imagery
is accurate to 50 meters.

## Access the imagery metadata

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

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

> [!NOTE]
> **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](https://developers.google.com/maps/documentation/streetview/overview.md.txt#url_parameters)
as the Street View Static API imagery requests, although only
the following parameters are required:

Either:

- `location` --- can be a text string (such as `Chagrin Falls, OH`), a comma-separated pair of latitude and longitude coordinates (`40.457375,-80.009353`), or a [place ID](https://developers.google.com/maps/documentation/places/web-service/place-id.md.txt) prefixed with `place_id:` (such as `place_id:ChIJj61dQgK6j4AR4GeTYWZsKWw`).

Or:

- `pano` --- a specific panorama ID. Panoramas may change IDs over time, so don't persist this ID. Instead, save the location address or latitude and longitude coordinates so you can refresh the panorama ID. For details, see [Refresh deleted panorama IDs](https://developers.google.com/maps/documentation/streetview/metadata.md.txt#refresh-pano).

As well as:

- `key` and `signature` --- the API key is required to authenticate the request. The digital signature is also required in certain instances, and always recommended. For more information, see [Get a Key and Signature](https://developers.google.com/maps/documentation/streetview/get-api-key.md.txt).

Your metadata request, with only required parameters, looks like this:

```html
https://maps.googleapis.com/maps/api/streetview/metadata?location=&key=YOUR_API_KEY&signature=<YOUR_SIGNATURE>
```

or like this:

```html
https://maps.googleapis.com/maps/api/streetview/metadata?pano=&key=YOUR_API_KEY&signature=<YOUR_SIGNATURE>
```

### Refresh deleted panorama IDs

If you attempt to retrieve a panorama ID and get either `ZERO_RESULTS` or
no value, then the panorama ID has been deleted and needs to be refreshed.

1. Save the location address or latitude and longitude coordinates you used to
   get a panorama ID so you can refresh when needed.

2. When you detect that a panorama ID has changed, use the original location
   address or latitude and longitude coordinates to search again for the nearest
   panoramas to that location and get a new panorama ID.

> [!NOTE]
> **Note:** Because Street View imagery is periodically refreshed, and photographs may be taken from slightly different positions each time, a given panorama ID may snap to a different panorama when imagery or the panorama ID is updated.

### Optional parameters for metadata requests

You can include the following parameters in your metadata request: `size`,
`heading`, `fov`, and `pitch`. Note that these parameters don't influence
the data about the panorama, or which panorama is found.
The API allows the inclusion of the same parameters as the
[imagery request](https://developers.google.com/maps/documentation/streetview/overview.md.txt#url_parameters)
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. For information about using these parameters, see the
[Street View Static API developer's guide](https://developers.google.com/maps/documentation/streetview/overview.md.txt#url_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

```html
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&signature=YOUR_SIGNATURE
```

```
{
   "copyright" : "© 2017 Google",
   "date" : "2016-05",
   "location" : {
      "lat" : 48.85783227207914,
      "lng" : 2.295226175151347
   },
   "pano_id" : "tu510ie_z4ptBZYo2BGEJg",
   "status" : "OK"
}
```

Imagery request and response, where the missing image is expected.

```html
https://maps.googleapis.com/maps/api/streetview?size=600x300&location=eiffel%20tower,%20paris,%20france&heading=-45&pitch=42&fov=110&key=YOUR_API_KEY&signature=YOUR_SIGNATURE
```
![Eiffel Tower](https://maps.googleapis.com/maps/api/streetview?size=600x300&location=eiffel+tower,+paris,+france&heading=-45&pitch=42&fov=110&key=AIzaSyA3kg7YWugGl1lTXmAmaBGPNhDW9pEh5bo&signature=ztxYUpcLfttp6A9EBybHqnCOw80%3D)

### Example 2: Panorama not found

The following URLs request the metadata and image for a panorama that
couldn't be found at or near the specified location.

**Metadata request and response**

```html
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&signature=YOUR_SIGNATURE
```

```
{
   "status" : "ZERO_RESULTS"
}
```

**Imagery request and response**

```html
https://maps.googleapis.com/maps/api/streetview?size=600x300&location=78.648401,14.194336&fov=90&heading=235&pitch=10&key=YOUR_API_KEY&signature=YOUR_SIGNATURE
```
![No Imagery Here Placeholder](https://maps.googleapis.com/maps/api/streetview?size=600x300&location=78.648401,14.194336&fov=90&heading=235&pitch=10&key=AIzaSyA3kg7YWugGl1lTXmAmaBGPNhDW9pEh5bo&signature=zqYzfBsrogHNZdVCFY7rbCPsAjw%3D)

## 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 response can occur if you provide a non-existent or invalid panorama ID. See \[Refresh deleted panorama IDs\](#refresh-pano). |
| `"NOT_FOUND"` | Indicates that the address string provided in the `location` parameter couldn't be found. This message 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 message may occur if you did not [authorize](https://developers.google.com/maps/documentation/streetview/get-api-key.md.txt) your request, or if the Street View Static API is not activated in the Google Cloud console project containing your API key. |
| `"INVALID_REQUEST"` | Generally indicates that the query parameters (address, latitude and longitude coordinates, or components) are missing. |
| `"UNKNOWN_ERROR"` | Indicates that the request couldn't be processed due to a server error. This issue is often temporary. The request may succeed if you try again. |

## More information

For more information on using the Street View Static API, or
other Google Maps API products, be sure to check out the Maps API
[Support page](https://developers.google.com/maps/support.md.txt).