The
[`renderVideo`](https://developers.google.com/maps/documentation/aerial-view/reference/rest/v1/videos/renderVideo.md.txt)
method requests the generation of an aerial view video for the specified US
postal address. If the video already exists for the specified address, then this
method returns metadata about the video.

> [!NOTE]
> **Note:** This usage of `renderVideo` assumes that Google hasn't already generated the aerial view video that you need. That is, you need to generate a new aerial view video.

## How to use the API

Generate a new aerial video by making an HTTPS POST request to the
[`renderVideo`](https://developers.google.com/maps/documentation/aerial-view/reference/rest/v1/videos/renderVideo.md.txt)
endpoint, passing your [API Key](https://developers.google.com/maps/documentation/aerial-view/get-api-key.md.txt) and a US postal address, as shown
in the following example. The rendering process can take anywhere from an hour
to a few hours.

> [!NOTE]
> **Note:** There is no charge for using this endpoint.

```json
curl -X POST -d '{
  "address": "POSTAL_ADDRESS"
}' \
-H 'Content-Type: application/json' \
"https://aerialview.googleapis.com/v1/videos:renderVideo?X-Goog-Api-Key=YOUR_API_KEY"
```

## Example request

The following code example requests the generation of an aerial view video for
500 W 2nd St, Austin, TX, 78701.

```json
curl -X POST -d '{
  "address": "500 W 2nd St, Austin, TX 78701"
}' \
-H 'Content-Type: application/json' \
"https://aerialview.googleapis.com/v1/videos:renderVideo?X-Goog-Api-Key=YOUR_API_KEY"
```

## Example response

The following JSON code samples show the possible responses to the example video
request.

### Invalid address response

The address is either incorrect, or it isn't within the United States.

```json
{
  "error": {
    "code": 400,
    "message": "Address not supported.",
    "status": "INVALID_ARGUMENT"
  }
}
```

### Processing response

The Aerial View API is now rendering your video. The response contains the
`videoId`, which you can use to retrieve the video.

```json
{
  "state": "PROCESSING",
  "metadata": {
    "videoId": "x89iJAJi1wzs7DIAFQF7Va"
  }
}
```

The rendering process can take anywhere from an hour to a few hours. If the
video is still processing, you can use `lookupVideo` to poll the video status
until it returns a state of `ACTIVE`.

To poll, make a request to `lookupVideo`, passing the `videoId`. Rendering can
take several hours, so use [exponential
backoff](https://developers.google.com/maps/documentation/aerial-view/web-api-best-practices#exponential-backoff) to space out your calls.

### Active response

When `renderVideo` returns a `state` value of `ACTIVE`, it means the video has
finished rendering, and you can retrieve it by calling `lookupVideo` with the
`videoId`.

```json
{
  "state": "ACTIVE",
  "metadata": {
    "videoId": "x89iJAJi1wzs7DIAFQF7Va"
  }
}
```