The Aerial View API supports two general workflows. Your approach depends on
whether the video you're requesting exists or not. If you're unsure whether the
video exists, you should use
[`lookupVideoMetadata`](https://developers.google.com/maps/documentation/aerial-view/lookup-video-metadata.md.txt)
to determine the video's state.

## Workflow to generate or retrieve videos

Use the following workflow to generate or retrieve an aerial view video:

1. Check if Google has already generated a video for the location using [`lookupVideoMetadata`](https://developers.google.com/maps/documentation/aerial-view/lookup-video-metadata.md.txt).
2. If no video exists (`lookupVideoMetadata` returned a 404), call [`renderVideo`](https://developers.google.com/maps/documentation/aerial-view/generate-video.md.txt) to generate a new video.
   1. Call `lookupVideoMetadata` using the `videoId` or address to poll the endpoint until the video's state is `ACTIVE`. 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.
3. If the video is active (`lookupVideoMetadata` returned a state of `ACTIVE`),
   call [`lookupVideo`](https://developers.google.com/maps/documentation/aerial-view/lookup-video.md.txt) to fetch
   the video's URIs.

   > [!NOTE]
   > **Note:** After Google generates the video for a specific address, that video is available to anyone. That is, a video is not associated with a specific user or account.

This workflow is represented in the diagram below:

![Chart displaying the workflow outlined above](https://developers.google.com/static/maps/documentation/aerial-view/images/flow.png)

### Save video IDs for later use

Subject to the Service Specific Terms for Aerial View API, Aerial View API
video IDs are **exempt from** the caching restrictions stated in [Section
3.2.3(b)(No
Caching)](https://cloud.google.com/maps-platform/terms/) of the
Google Maps Platform Terms of Service. You can therefore store video ID values
for later use.