フィードバックを送信
ストリートビュー画像のメタデータ
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
はじめに
Street View Static API メタデータ リクエストは、ストリートビュー パノラマに関するデータを提供します。メタデータを使用すると、特定の場所でストリートビューの画像が利用可能かどうかを確認できるほか、緯度と経度の座標、パノラマ ID、写真の撮影日、画像の著作権情報にプログラムでアクセスできます。このメタデータにアクセスすると、アプリケーションのエラー動作をカスタマイズできます。
注: 日付フィールドの値は次のようになります。
日付フィールドの粒度は、パノラマごとに異なる場合があります。たとえば、一部のパノラマの写真の日付フィールドには年と月が含まれていますが、年のみが含まれているものもあります。
データがない場合、日付フィールドは省略されます。
Street View Static API メタデータ リクエストは無料でご利用いただけます。メタデータをリクエストしても、割り当ては消費されません。
割り当ては、 Street View Static API を使用して画像を読み込む場合にのみ消費されます。
ストリートビュー画像のメタデータ リクエストを行う場合、パノラマ画像の精度は 50 メートルです。
画像メタデータにアクセスする
ストリートビュー画像のメタデータ リクエストは、次の形式の HTTP URL です。
https://maps.googleapis.com/maps/api/streetview/metadata?parameters
注 : メタデータ リクエストには https:// プロトコルが必要です。URL の標準規則と同様に、すべてのパラメータはアンパサンド(&)文字を使用して区切ります。
メタデータ リクエストは、Street View Static API の画像リクエストと同じ URL パラメータを受け入れますが、次のパラメータのみが必須です。
次のいずれかを実行します。
location
- テキスト文字列(Chagrin Falls, OH
など)または緯度と経度の座標のカンマ区切りのペア(40.457375,-80.009353
)のいずれかになります。
または
pano
- 特定のパノラマ ID。パノラマの ID は時間とともに変化する可能性があるため、この ID を永続化しないでください。代わりに、位置の住所または緯度と経度の座標を保存して、パノラマ ID を更新できるようにします。詳細については、削除されたパノラマ ID を更新する をご覧ください。
さらに:
key
と signature
- リクエストの認証に API キーが必要です。デジタル署名は、特定のインスタンスで必須であり、常に推奨されます。詳細については、鍵と署名を取得する をご覧ください。
必須パラメータのみを含むメタデータ リクエストは次のようになります。
https://maps.googleapis.com/maps/api/streetview/metadata?location=& key=YOUR_API_KEY & signature=< YOUR_SIGNATURE >
または
https://maps.googleapis.com/maps/api/streetview/metadata?pano=& key=YOUR_API_KEY & signature=< YOUR_SIGNATURE >
削除されたパノラマ ID を更新する
パノラマ ID を取得しようとして ZERO_RESULTS
または値なしが返された場合、パノラマ ID は削除されているため、更新する必要があります。
パノラマ ID の取得に使用した場所の住所または緯度と経度の座標を保存して、必要に応じて更新できるようにします。
パノラマ ID が変更されたことを検出したら、元の場所の住所または緯度と経度の座標を使用して、その場所の最も近いパノラマを再度検索し、新しいパノラマ ID を取得します。
注: ストリートビューの画像は定期的に更新され、写真は毎回わずかに異なる位置から撮影される可能性があるため、画像またはパノラマ ID が更新されると、特定のパノラマ ID が別のパノラマにスナップされることがあります。
メタデータ リクエストには、size
、heading
、fov
、pitch
の各パラメータを含めることができます。これらのパラメータは、パノラマに関するデータや、どのパノラマが見つかるかに影響しません。API では、画像リクエスト と同じパラメータを含めることができるため、特定のリクエストに関連するメタデータ リクエストを簡単に作成できますが、メタデータ リクエストの場合、API は省略可能なパラメータとその値を無視します。これらのパラメータの使用方法については、ストリートビュー静止画像 API デベロッパー ガイド をご覧ください。
メタデータのレスポンスは、JSON 形式でのみ返されます。
例
例 1: パノラマが見つかった場合
次の URL は、同じパノラマのメタデータと画像を正常にリクエストします。
メタデータのリクエストとレスポンス
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"
}
画像リクエストとレスポンス。画像が見つからないことが想定されています。
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
例 2: パノラマが見つからない
次の URL は、指定された場所またはその付近で見つからなかったパノラマのメタデータと画像をリクエストします。
メタデータのリクエストとレスポンス
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"
}
画像のリクエストとレスポンス
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
ステータス コード
メタデータ レスポンス オブジェクト内の status
フィールドには、リクエストのステータスが格納されます。ストリートビュー リクエストが機能しない原因をトラブルシューティングできるようにデバッグ情報が格納される場合もあります。status
フィールドには次の値が含まれることがあります。
ステータス
説明
"OK"
エラーが発生せず、パノラマが見つかり、メタデータが返されたことを示します。
"ZERO_RESULTS"
指定された場所の近くにパノラマが見つからなかったことを示します。このレスポンスは、存在しないパノラマ ID または無効なパノラマ ID を指定した場合に発生することがあります。[削除されたパノラマ ID を更新する](#refresh-pano) をご覧ください。
"NOT_FOUND"
location
パラメータで指定されたアドレス文字列が見つからなかったことを示します。このメッセージは、存在しないアドレスが指定された場合に発生することがあります。
"OVER_QUERY_LIMIT"
この API の 1 日あたりの割り当てまたは 1 秒あたりの割り当てを超過したことを示します。
"REQUEST_DENIED"
リクエストが拒否されたことを示します。このメッセージは、リクエストが承認 されていない場合、または API キーを含む Google Cloud コンソール プロジェクトで Street View Static API が有効になっていない場合に表示されることがあります。
"INVALID_REQUEST"
一般的に、クエリ パラメータ(住所、緯度と経度の座標、コンポーネント)が不足していることを示します。
"UNKNOWN_ERROR"
サーバーエラーが原因でリクエストを処理できなかったことを示します。この問題は一時的なものであることがよくあります。もう一度試すと正常に処理される可能性があります。
詳細
Street View Static API やその他の Google Maps API プロダクトの使用について詳しくは、Maps API のサポートページ をご覧ください。
フィードバックを送信
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンス により使用許諾されます。コードサンプルは Apache 2.0 ライセンス により使用許諾されます。詳しくは、Google Developers サイトのポリシー をご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
ご意見をお聞かせください
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eThe Street View Static API metadata request provides data about Street View panoramas, such as location, date, and panorama ID, without consuming quota.\u003c/p\u003e\n"],["\u003cp\u003eYou need to provide either a \u003ccode\u003elocation\u003c/code\u003e (address or coordinates) or a \u003ccode\u003epano\u003c/code\u003e ID along with your API key to make a metadata request.\u003c/p\u003e\n"],["\u003cp\u003eThe response is in JSON format and includes the status of the request (e.g., \u003ccode\u003eOK\u003c/code\u003e, \u003ccode\u003eZERO_RESULTS\u003c/code\u003e, \u003ccode\u003eNOT_FOUND\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003ePanorama IDs can change over time, so it's recommended to save the location information to refresh the ID when necessary.\u003c/p\u003e\n"],["\u003cp\u003eWhile optional parameters like \u003ccode\u003esize\u003c/code\u003e, \u003ccode\u003eheading\u003c/code\u003e, \u003ccode\u003efov\u003c/code\u003e, and \u003ccode\u003epitch\u003c/code\u003e are accepted, they do not affect the returned metadata.\u003c/p\u003e\n"]]],["The Street View Static API metadata requests provide panorama data, including location coordinates, panorama ID, photo date, and copyright. These requests are free and don't consume quotas. To access metadata, send an HTTP URL request with required parameters: either a `location` (address or coordinates) or `pano` (panorama ID), plus an API `key` and `signature`. If a panorama ID returns `ZERO_RESULTS`, refresh it using the original location. The response, in JSON, includes a `status` field indicating success or failure.\n"],null,["# Street View Image Metadata\n\nIntroduction\n------------\n\nThe Street View Static API metadata requests provide data about Street\nView panoramas. Using the metadata, you can find out if a Street View image\nis available at a given location, as well as getting programmatic access to\nthe latitude and longitude coordinates, the panorama ID, the date the photo was\ntaken, and the copyright information for the image. Accessing this\nmetadata lets you customize error behavior in your application.\n| **Note:** The value of the date field can vary:\n|\n| - 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.\n| - The date field is omitted if no data is available.\n\nStreet View Static API metadata requests are available at no\ncharge. No quota is consumed when you request metadata.\n[Quota is only consumed](/maps/documentation/streetview/usage-limits) when you load an image using the\n[Street View Static API](/maps/documentation/streetview/overview).\n\nWhen making Street View imagery metadata requests, the panorama imagery\nis accurate to 50 meters.\n\nAccess the imagery metadata\n---------------------------\n\nA Street View image metadata request is an HTTP URL of the following form: \n\n```html\nhttps://maps.googleapis.com/maps/api/streetview/metadata?parameters\n```\n| **Note** : the **https://** protocol is required for metadata requests.\n\nAs is standard in URLs, all parameters are separated using the ampersand\n(\\&) character.\n\n### Required parameters for metadata requests\n\nThe metadata requests accept the\n[same URL parameters](/maps/documentation/streetview/overview#url_parameters)\nas the Street View Static API imagery requests, although only\nthe following parameters are required:\n\nEither:\n\n- `location` --- can be either a text string (such as `Chagrin Falls, OH`) or a comma-separated pair of latitude and longitude coordinates (`40.457375,-80.009353`).\n\nOr:\n\n- `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](#refresh-pano).\n\nAs well as:\n\n- `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](/maps/documentation/streetview/get-api-key).\n\nYour metadata request, with only required parameters, looks like this: \n\n```html\nhttps://maps.googleapis.com/maps/api/streetview/metadata?location=&key=YOUR_API_KEY&signature=\u003cYOUR_SIGNATURE\u003e\n```\n\nor like this: \n\n```html\nhttps://maps.googleapis.com/maps/api/streetview/metadata?pano=&key=YOUR_API_KEY&signature=\u003cYOUR_SIGNATURE\u003e\n```\n\n### Refresh deleted panorama IDs\n\nIf you attempt to retrieve a panorama ID and get either `ZERO_RESULTS` or\nno value, then the panorama ID has been deleted and needs to be refreshed.\n\n1. Save the location address or latitude and longitude coordinates you used to\n get a panorama ID so you can refresh when needed.\n\n2. When you detect that a panorama ID has changed, use the original location\n address or latitude and longitude coordinates to search again for the nearest\n panoramas to that location and get a new panorama ID.\n\n| **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.\n\n### Optional parameters for metadata requests\n\nYou can include the following parameters in your metadata request: `size`,\n`heading`, `fov`, and `pitch`. Note that these parameters don't influence\nthe data about the panorama, or which panorama is found.\nThe API allows the inclusion of the same parameters as the\n[imagery request](/maps/documentation/streetview/overview#url_parameters)\nto make it easier to construct a metadata request related to a specific imagery\nrequest, but for metadata requests, the API ignores the optional parameters and\ntheir values. For information about using these parameters, see the\n[Street View Static API developer's guide](/maps/documentation/streetview/overview#url_parameters).\n\nResponse format\n---------------\n\nMetadata responses are returned in JSON format only.\n\nExamples\n--------\n\n#### Example 1: Panorama found\n\nThe following URLs successfully request the metadata and image of the same\npanorama.\n\nMetadata request and response \n\n```html\nhttps://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\n``` \n\n```scdoc\n{\n \"copyright\" : \"© 2017 Google\",\n \"date\" : \"2016-05\",\n \"location\" : {\n \"lat\" : 48.85783227207914,\n \"lng\" : 2.295226175151347\n },\n \"pano_id\" : \"tu510ie_z4ptBZYo2BGEJg\",\n \"status\" : \"OK\"\n}\n```\n\nImagery request and response, where the missing image is expected. \n\n```html\nhttps://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\n```\n\n#### Example 2: Panorama not found\n\nThe following URLs request the metadata and image for a panorama that\ncouldn't be found at or near the specified location.\n\n**Metadata request and response** \n\n```html\nhttps://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\n``` \n\n```scdoc\n{\n \"status\" : \"ZERO_RESULTS\"\n}\n```\n\n**Imagery request and response** \n\n```html\nhttps://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\n```\n\nStatus codes\n------------\n\nThe `status` field within the metadata response object contains the status of\nthe request, and may contain debugging information to help you troubleshoot\nwhy the Street View request is not working. The `status` field may contain\nthe following values:\n\n| Status | Description |\n|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `\"OK\"` | Indicates that no errors occurred; a panorama is found and metadata is returned. |\n| `\"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). |\n| `\"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. |\n| `\"OVER_QUERY_LIMIT\"` | Indicates that you have exceeded your daily quota or per-second quota for this API. |\n| `\"REQUEST_DENIED\"` | Indicates that your request was denied. This message may occur if you did not [authorize](/maps/documentation/streetview/get-api-key) your request, or if the Street View Static API is not activated in the Google Cloud console project containing your API key. |\n| `\"INVALID_REQUEST\"` | Generally indicates that the query parameters (address, latitude and longitude coordinates, or components) are missing. |\n| `\"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. |\n\nMore information\n----------------\n\nFor more information on using the Street View Static API, or\nother Google Maps API products, be sure to check out the Maps API\n[Support page](/maps/support)."]]