检索视频的元数据
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
给定有效的地址或 videoID 后,lookupVideoMetadata
方法会返回与给定视频相关联的元数据。响应正文中的元数据可让您确定影像的新鲜度、视频的长度,还提供了一个免费的工作流来确认视频是否存在。
如何使用该 API
通过向此端点传递网址编码的美国邮政地址或 videoId
来调用此端点。
curl -X GET "https://aerialview.googleapis.com/v1/videos:lookupVideoMetadata?key=YOUR_API_KEY&address=POSTAL_ADDRESS"
然后,API 会返回以下两种响应之一:
- 如果视频存在,
lookupVideoMetadata
会返回视频的元数据。
- 如果视频不存在,API 会返回 404 错误代码。
示例请求
以下代码示例请求获取位于加利福尼亚州旧金山蒙哥马利街 600 号的泛美金字塔的鸟瞰视频。
curl -X GET "https://aerialview.googleapis.com/v1/videos:lookupVideoMetadata?key=YOUR_API_KEY&address=600%20Montgomery%20St%2C%20San%20Francisco%2C%20CA%2094111"
示例响应
以下 JSON 示例展示了对 lookupVideoMetadata
请求的所有可能响应。
找到视频
视频已渲染完毕。
{
"videoId": "Ul1naoFmqo69U1zUVrQRkc",
"captureDate": {
"year": 2022,
"month": 4,
"day": 1
},
"duration": "40s",
"state": "ACTIVE"
}
视频正在渲染
视频正在呈现。
{
"videoId": "Ul1naoFmqo69U1zUVrQRkc",
"state": "PROCESSING"
}
找不到视频
视频不在 Google 的数据库中。这可能是因为该位置信息尚未呈现,也可能是因为该位置信息位于不受支持的区域。
如果位置信息位于支持的区域,您可以使用 renderVideo
发起渲染请求。
{
"error": {
"code": 404,
"message": "Video not found.",
"status": "NOT_FOUND"
}
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThe \u003ccode\u003elookupVideoMetadata\u003c/code\u003e method retrieves metadata for an aerial view video using a valid address or videoID.\u003c/p\u003e\n"],["\u003cp\u003eThis method helps determine video freshness, length, and confirms video existence.\u003c/p\u003e\n"],["\u003cp\u003eThe API returns video metadata if the video exists, or a 404 error if it doesn't.\u003c/p\u003e\n"],["\u003cp\u003eYou can use a URL-encoded US postal address or a \u003ccode\u003evideoId\u003c/code\u003e to call this endpoint.\u003c/p\u003e\n"],["\u003cp\u003eIf a video isn't found in a supported area, you can initiate a render request using the \u003ccode\u003erenderVideo\u003c/code\u003e method.\u003c/p\u003e\n"]]],["The `lookupVideoMetadata` method retrieves metadata for a given video using a URL-encoded address or videoID. A GET request is sent to the API endpoint with an API key and address. The API returns either video metadata, including ID, capture date, duration, and state, or a 404 error if the video is not found. If the video is not found and in a supported area a `renderVideo` request can be initiated. Possible states for the video include \"ACTIVE\" or \"PROCESSING\".\n"],null,["Given a valid address or videoID, the\n[`lookupVideoMetadata`](/maps/documentation/aerial-view/reference/rest/v1/videos/lookupVideoMetadata)\nmethod returns metadata associated with a given video. The metadata in the\nresponse body lets you determine the freshness of the imagery, length of the\nvideo, and also provides a free workflow for confirming the existence of videos.\n\nHow to use the API\n\nCall this endpoint by passing it a [URL-encoded](/maps/url-encoding) US postal\naddress or a\n[`videoId`](/maps/documentation/aerial-view/reference/rest/v1/VideoMetadata). \n\n```json\ncurl -X GET \"https://aerialview.googleapis.com/v1/videos:lookupVideoMetadata?key=\u003cvar class=\"apiparam\" translate=\"no\"\u003eYOUR_API_KEY\u003c/var\u003e&address=\u003cvar translate=\"no\"\u003ePOSTAL_ADDRESS\u003c/var\u003e\"\n```\n\nThe API then returns one of the following two responses:\n\n- If the video exists, `lookupVideoMetadata` returns the video's metadata.\n- If the video doesn't exist, the API returns a 404 error code.\n\nExample request\n\nThe following code sample requests an aerial view video for the Transamerica\nPyramid, located at 600 Montgomery St, San Francisco, CA 94111. \n\n```json\ncurl -X GET \"https://aerialview.googleapis.com/v1/videos:lookupVideoMetadata?key=\u003cvar class=\"apiparam\" translate=\"no\"\u003eYOUR_API_KEY\u003c/var\u003e&address=600%20Montgomery%20St%2C%20San%20Francisco%2C%20CA%2094111\"\n```\n\nExample response\n\nThe following JSON examples demonstrate all possible responses to the\n`lookupVideoMetadata` request.\n\nVideo found\n\nThe video has already been rendered. \n\n {\n \"videoId\": \"Ul1naoFmqo69U1zUVrQRkc\",\n \"captureDate\": {\n \"year\": 2022,\n \"month\": 4,\n \"day\": 1\n },\n \"duration\": \"40s\",\n \"state\": \"ACTIVE\"\n }\n\nVideo is rendering\n\nThe video is rendering. \n\n {\n \"videoId\": \"Ul1naoFmqo69U1zUVrQRkc\",\n \"state\": \"PROCESSING\"\n }\n\nVideo not found\n\nThe video isn't in Google's database. This could be because it either hasn't yet\nbeen rendered, or because the location is in an area that isn't supported.\n\nIf the location is in a [supported\narea](/maps/documentation/aerial-view/overview#coverage_areas), you can use\n[`renderVideo`](/maps/documentation/aerial-view/reference/rest/v1/videos/renderVideo)\nto initiate a render request. \n\n {\n \"error\": {\n \"code\": 404,\n \"message\": \"Video not found.\",\n \"status\": \"NOT_FOUND\"\n }\n }"]]