เรียกข้อมูลเมตาของวิดีโอ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เมื่อระบุที่อยู่หรือวิดีโอที่ถูกต้อง เมธอด
lookupVideoMetadata
จะแสดงข้อมูลเมตาที่เชื่อมโยงกับวิดีโอที่ระบุ ข้อมูลเมตาในเนื้อหาการตอบกลับช่วยให้คุณระบุความใหม่ของภาพ ความยาวของวิดีโอ และยังมีเวิร์กโฟลว์ฟรีสำหรับยืนยันการมีอยู่ของวิดีโอด้วย
วิธีใช้ API
เรียกใช้ปลายทางนี้โดยส่งที่อยู่ไปรษณีย์ในสหรัฐอเมริกาที่เข้ารหัส URL หรือvideoId
curl -X GET "https://aerialview.googleapis.com/v1/videos:lookupVideoMetadata?key=YOUR_API_KEY&address=POSTAL_ADDRESS"
จากนั้น API จะแสดงการตอบกลับ 2 อย่างต่อไปนี้
- หากมีวิดีโออยู่
lookupVideoMetadata
จะแสดงข้อมูลเมตาของวิดีโอ
- หากไม่มีวิดีโอ API จะแสดงรหัสข้อผิดพลาด 404
ตัวอย่างคำขอ
ตัวอย่างโค้ดต่อไปนี้ขอวิดีโอมุมมองทางอากาศของ Transamerica
Pyramid ซึ่งตั้งอยู่ที่ 600 Montgomery St, San Francisco, CA 94111
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 Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\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 }"]]